LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serveral questions about Labview programming

Hi, sirs,

I have some questions about the labview programming:

1. How can I click a button on the Panel so that a small window can be poped up or a menu can be pulled down?

2. How can I flash the button when some values are bigger than a certain value by showing the button's color between red and the current color of the button internatively, and when some values are smaller than
a certain value the flash can be shown between blue and the current of the button internatively?

3. How can I display more than one curve lines on one graph at the same time and the different curve lines are displayed by different colors?

4. Where can I find an item to change the color of the panel and the "DBL" input/output slot on
the panel?

5. How can I read in the parameter from Analog/Digit card? Moreover, how can I distinguish the parameters from different instruments on one A/D card?

If some simple examples are provided, it is the best. I am using Labview 6i.

Thanks a lot.
0 Kudos
Message 1 of 6
(3,101 Views)
I'm using LV7 so I can't give you examples that you can open, however there are hundreds of excellent examples on most things you want to do reachable from the help->find examples menu in LabVIEW. If you e..g. search for graph you will find an example that shows you how to put multiple curves on the same graph. But let me briefly go trhough the questions:

1. If you place a button on the panel, put a case structure next to the terminal on the diagramme and draw a wire from the button terminal to the case selector and then put a dialog function (from the time and dialog palette) inside the true case you're pretty much there. Draw a while loop around it all and wire the button to the loop condition and run the VI..click the button and you get the dialog. If you want your own VI to pop up when the button is clicked you need to make a subVI and set that VI to open when called (and close when finished)...Search for how to create a sub-VI here on the zone.

2. If you have a button and a numeric control and you want the button to change color based on the numeric value use e.g. the In range and coerce function to check if the number is within a range, if it's not check if it's above or below...based on these boolean values select a color and wire that color constant to the color property of the button (right-click on the button and select create-> property node, then click on the property node and select colors...you'll need to use a bundle function to bundle the colors. Since you want to just flash the value create a shift register with a boolean that you switch from true to false on every n iteration and then give that value to a selector with one terminal fed with the default colors and the other fed the alarm colors...wire the output of the selector to the color property of the button. If the value is within range you can just overrun the toggling of that boolean and set it to the value that makes the selector give the default values...

3. The color and other properties of the different curves can be manually set from the plot legend of the graph (just expand it to show more plots and click on the plots in the legend to set their properties). To get more than one plot on the graph you need to build a 2D array to feed to the graph, again this is shown in the example that comes with LV. The plot properties can also be controlled programmatically by selecting an active plot using a property ndoe for the graph and then set the plot properties with the same node.

4. The color of the panel and any other item on it can be changed manually by using the paint tool, just select the color and use the brush tool to paint wherever you want. To change the color of the front panel programmatically open a reference to the VI, get the font panel reference and wire it to a property node, you can then select the color property, set it to write and wire whatever color value you want to it...remember to close the references afterwards.

5. This is really well documented, if you check the help-> find examples section and search for analogue you'll see how to aquire single and multiple channels and samples. If you have multiple instruments on the same card they are on different channels...you identify them with the channel number.
Message 2 of 6
(3,101 Views)
Hi, Mads,

Thank you very very much for your answer. It is very helpful.

By your direction, I completed some functions that I need to do. But for other functions, I tried, but didn't finish it. Can you or other person give me any suggestion or example program in Labview 6i?

I hope to a button having the following functions:

when I click it, the words (letters) on it can become bold, and when I click it again, the words (letters) on it can be changed to be not bold;

When some values are higher than a certain value, the color of the button can flash between red and the current color; when some values are lower than a certain value, the color of the button can flash between blue and the current value. I tried the answer from Mads, but I didn't succ
eed in it;

When I click the button, I hope to pop up a window and I can choose one of several optional items on the window to set some property. I try Mads' idea, and the way just can pop up a window to display some information.

Moreover, if I separate the panel into 3 parts by using 2 mark lines and hope to paint 3 different colors on the panel, every window having one color.
How can I do that?

Thanks a lot.
0 Kudos
Message 3 of 6
(3,101 Views)
Hi

find attached an example , there are answered some of
your questions

Regards
Werner
0 Kudos
Message 4 of 6
(3,101 Views)
> when I click it, the words (letters) on it can become bold, and when I
> click it again, the words (letters) on it can be changed to be not
> bold;

There are two things to worry about here. How do you get the visual
feedback you want, and how do you detect the action. Detecting the
action is the same as before. You need to detect the button changes via
value change events, mouse or key events, etc. Build small state
machines to keep track of what you have seen and which transitions are
valid.

For the visual changes, most of them will be done via property nodes.
Towards the bottom, the property node for a Boolean gives you access to
the Boolean Text's font and to the properties like Bold that can be changed.

> Moreover, if I
separate the panel into 3 parts by using 2 mark lines
> and hope to paint 3 different colors on the panel, every window having
> one color.

If you just want three colored sections behind the controls in this
panel, place three graphical decorations. LV has built in rectangular
decorations, or you can import a bitmap if you like. Use the cycling
arrows or Ctl-Shift-J to move the graphics to the back of the controls.
If you want this color to change, use an indicator instead -- the
color control works pretty well, but so does the ring, the Boolean, and
the color ramp.

If you want to have three panels displayed in one window, you need to
look at using the subPanel feature in LV7.

Greg McKaskle
0 Kudos
Message 5 of 6
(3,101 Views)
Thanks a lot.
0 Kudos
Message 6 of 6
(3,101 Views)