From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
02-13-2012 03:10 PM
For the GRAPH version to make sense, you have to manually assign PLOT 1 = AMPLITUDE 2 scale, PLOT 2 = AMPLITUDE 3 scale, and PLOT 3 = AMPLITUDE 4 scale.
The graph doesn't seem to remember these assignments upon saving.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2012 04:35 PM
For the record, the reference DOES have to be to the chart/graph itself, and the event DOES have to be the SHORTCUT MENU ACTIVATION? event.
Other events, other items don't cause a problem.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2012 05:11 PM - edited 02-13-2012 05:14 PM
Well, dang.
What my real code is doing is gathering ALL references to ALL controls on ALL pages of the tab, and registering the whole lot with one REGISTER EVENTS function.
I tried a workaround:
Step 1: Find the chart reference in that array and delete it before registering.
--- When I do that, normal behavior is restored. My menu mods don't get done if I click on the chart, but the scales are handled correctly.
Step 2: Create a NEW event case, Set it to SHORTCUT ACTIVATION? and attach it directly to the chart.
--- When I do that, the wonky behavior is restored. Popping up on any scale and changing AUTOSCALE affects Scale #0, not the one you clicked on.
I don't have to actually do anything in the new handler. Just having it present will cause the problem.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2012 06:32 PM
Mike Porter: If you delete that event registration and the dynamic event terminals and create a normal shortcut menu activation event, all is well with the world.
I took what you said as true when I worked up my workaround attempt, but when that failed, I tested what you said directly, and found it to be false, in both LV 2010 and LV 2011.
I'd like to know what you based the statement on.
See attached VI "Chart with 4 chans" (I didn't update the graph version).
With NO dynamic registration, but a static event tied to the chart's SHORTCUT MENU ACTIVATION? event, it fails (see instructions on diagram).
Delete the Event case, and it works normally.
The rule seems to be:
If there is an event attached (directly or via dynamic registration of a reference) to the SHORTCUT ACTIVATION, then the WHICH SCALE portion of the event is lost, and the menu applies to scale #0 ONLY.
I can't really tell with the rest of the menu, as I can't get ARBITRARY/UNIFORM to work at run time. But this is certainly true of the AUTOSCALE Y item.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-13-2012 08:14 PM
02-14-2012 06:11 AM
I based my statement on deleting the event registration, all the associated wiring and the dynamic event terminals. I then created a shortcut menu activation event on the graph and it worked.
Interesting. Message 14 contains a VI that I did, and it works in neither 2010 nor 2011.
"Works" is defined as turning on/off Autoscaling on the scale you clicked on.
I wonder what could be different.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-14-2012 07:37 AM
Attached is the latest version of both the CHART and the GRAPH versions.
These are ready to go - simply RUN it and choose any scale OTHER than the left one.
Turn AUTOSCALE Y on or off, and notice that the LEFT scale changes.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-14-2012 09:28 AM - edited 02-14-2012 09:31 AM
Ok did a bit more poking and I can't duplicate what (I thought) I saw earlier. Moreover in a sense what we are seeing makes sense. There are predefined menu tags that are used with APP shortcut menus. In the list of these predefined menu tags there is only one for toggling the autoscaling of the Y axis so when you use the menu activation event LV can't tell which Y axis you want to manipulate, so it does the first one - or perhaps the last one set as the "Active Y Axis" -- havent't had the time to look into that...
In any case, if you replace the existig shortcut menu of one of your own making you can toggle the autoscale on or off as desired -- see the attachment.
Mike...
02-14-2012 09:49 AM
@mikeporter wrote:
Ok did a bit more poking and I can't duplicate what (I thought) I saw earlier. Moreover in a sense what we are seeing makes sense. There are predefined menu tags that are used with APP shortcut menus. In the list of these predefined menu tags there is only one for toggling the autoscaling of the Y axis so when you use the menu activation event LV can't tell which Y axis you want to manipulate, so it does the first one - or perhaps the last one set as the "Active Y Axis" -- havent't had the time to look into that...
--- I don't think it's the ACTIVE Y AXIS setting, or else having the event case wouldn't make any difference.As I suggested in bold above, I think that the event carries a WHICH SCALE WAS CLICKED ON parameter, that's not brought out to the EVENT structure.Internally, it's carried with the event data and used correctly, but when the event goes thru an EVENT structure, it's not carried thru, and thus defaults to 0 on the other side.@mikeporter wrote:
In any case, if you replace the existig shortcut menu of one of your own making you can toggle the autoscale on or off as desired -- see the attachment.
Yes, we've come to the same conclusion. The rest of the menu is not valuable in my case, but I have a hunch that it would misbehave as well.
In your scheme, you get the same menu wherever on the chart you click. I'm thinking of using the BOUNDS of the different scales to determine WHICH scale you clicked on, and offering a single ON/OFF for that one.
In any case, it sure looks like an LV bug, doesn't it?
(Tech support still has not responded).
Blog for (mostly LabVIEW) programmers: Tips And Tricks
02-14-2012 10:16 AM