MichaelHill Posted July 19, 2007 Report Share Posted July 19, 2007 Due to the nature of my work, i cannot post much more than what I will, but I am having trouble selecting what data should be charted. I want to take the first 4 channels that I select in the mutiple selection list of "LiveDAS" and plot them in individual channels using "MultiChart". I believe my trouble is wanting to set the default value of the dropdown boxes in MultiChart. I am able to do almost exactly what I want if I change the drop-down boxes to "indicators". But them being dropdown boxes is rather useless if I can't "drop them down" and select another channel to plot individually if I desire. If I set them as controls, I am able to drop them down, but they will not default to the first 4 channels that I selected in "LiveDAS". I was told to try using an "invoke node". I had to look up the term as I just started programming in LabVIEW this summer. I read that it deals with ActiveX, but, as you may see from the screenshots, I am using a Sun machine, so ActiveX doesn't really apply. Thanks in advance. LiveDAS: MultiChart: Quote Link to comment
Yair Posted July 19, 2007 Report Share Posted July 19, 2007 If multichart is a subVI, the easiest solution is probably to set those rings to be in the connector pane and then you can feed a value into them when you call the subVI. Invoke and property (or attribute, in your case) nodes are used with object oriented systems (including ActiveX controls), but I don't think it will help you much in this case, because I'm pretty sure LV 5 did not allow accessing the attributes of controls in other VIs. You can do this inside the subVI (for instance, by wiring the selection array into the subVI), but you need an attribute node with the Value property, not an invoke node. Another option is creating a local variable for the control and wiring the value into that. Your other option would be to use some other means of transferring the selected values into the subVI, like a global variable or a functional global. Quote Link to comment
Neville D Posted July 19, 2007 Report Share Posted July 19, 2007 QUOTE(MichaelHill @ Jul 18 2007, 12:09 PM) I want to take the first 4 channels that I select in the mutiple selection list of "LiveDAS" and plot them in individual channels using "MultiChart". I believe my trouble is wanting to set the default value of the dropdown boxes in MultiChart. I am able to do almost exactly what I want if I change the drop-down boxes to "indicators". But them being dropdown boxes is rather useless if I can't "drop them down" and select another channel to plot individually if I desire. If I set them as controls, I am able to drop them down, but they will not default to the first 4 channels that I selected in "LiveDAS". I was told to try using an "invoke node". I had to look up the term as I just started programming in LabVIEW this summer. I read that it deals with ActiveX, but, as you may see from the screenshots, I am using a Sun machine, so ActiveX doesn't really apply. Thanks in advance. You can set the default value in one of two ways: 1 Make a local variable of the list box (make sure listbox is set to Selection mode of more than 1 item) 2 write an array to it of 0, 1, 2, 3 http://forums.lavag.org/index.php?act=attach&type=post&id=6396''>http://forums.lavag.org/index.php?act=attach&type=post&id=6396'>http://forums.lavag.org/index.php?act=attach&type=post&id=6396 You can also use property nodes for the listbox to do the same thing. I leave that as an excercise for you. Neville. Quote Link to comment
gb119 Posted July 19, 2007 Report Share Posted July 19, 2007 QUOTE(Neville D @ Jul 18 2007, 08:33 PM) You can set the default value in one of two ways:1 Make a local variable of the list box (make sure listbox is set to Selection mode of more than 1 item) 2 write an array to it of 0, 1, 2, 3 http://forums.lavag.org/index.php?act=attach&type=post&id=6396''>http://forums.lavag.org/index.php?act=attach&type=post&id=6396'>http://forums.lavag.org/index.php?act=attach&type=post&id=6396 You can also use property nodes for the listbox to do the same thing. I leave that as an excercise for you. I'm pretty sure that you can't use property nodes (or attribute nodes as they were called in LabVIEW 5) because I seem to recall that the Value property came with property nodes in LV6... Unless I'm missing something, the question is actually how to set the value of the 4 ring controls in the sub-vi based on the first 4 selected values of the list control in the parent. The way to do this is to have a hidden array control of integers (I think you can hide controls in LV5 by right clicking on them in the block diagram) that is connected to the connector pane of the MultiPlot sub-vi. Have the ring control in LiveDAS wired to this array input on Multiplot, then in Multiplot before you start doing anything else index elements 0-3 of the hidden array and feed those numbers into local vairable nodes (structures palette) for the 4 ring controls. Local variable nodes let you read/write to control or indicators irrespective of whether they are controls or indicators. They're very useful for exactly this sort of problem of sorting out initial values in a user interface, but are also very easy to abuse. Be very very careful when writing to a local variable and reading back from the control that you make sure that order of the write and read is deterinistic - i.e. controlled by data flow, otherwise you get all sorts of horrible race conditions. These typically come and bite you when you change something in the code or hardware that marginally changes the execution timings. Quote Link to comment
MichaelHill Posted July 19, 2007 Author Report Share Posted July 19, 2007 QUOTE(Neville D @ Jul 18 2007, 03:33 PM) You can set the default value in one of two ways:1 Make a local variable of the list box (make sure listbox is set to Selection mode of more than 1 item) 2 write an array to it of 0, 1, 2, 3 http://forums.lavag.org/index.php?act=attach&type=post&id=6396''>http://forums.lavag.org/index.php?act=attach&type=post&id=6396'>http://forums.lavag.org/index.php?act=attach&type=post&id=6396 You can also use property nodes for the listbox to do the same thing. I leave that as an excercise for you. Neville. Wow! That worked exactly how I wanted it to. Thanks a lot. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.