LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

mouse click on LED which is already ON + message display

Hi,
I am reading 96 bits corressponding to the 96 lines from a binary file and switching ON/OFF 96 LEDs in a subpanel VI(Sub VI ia named STATUS.vi) in my front panel. The LEDs are of CONTROL type and their mechanical action is "switch when pressed". Now, I want to display some details about each line(like why it is OFF or ON) in another subpanel when I click on any one of the LEDs. I tried using event structure in the STATUS.vi, but it waits for the key down event of the 1st LED, displays the message and then only displays the status (ON/OFF) of the second LED. If I want to see the status of 3rd, then again I have to click the 1st or 2nd LED. Is there any way to first display the status and then display the mess
age upon mouse click?
I hope I have made my question clear.
0 Kudos
Message 1 of 8
(2,704 Views)
The control of your leds is updated only if it is in the event in which its own modifications are detected.

Put the led control in the event where you detect a "mouse down" or a "value changed"

Doc-Doc
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 2 of 8
(2,704 Views)
Hey Srini,
AS a work around i have this sample code see it ,it will help you.
vicky
0 Kudos
Message 3 of 8
(2,704 Views)
Hi,
I tried. As a individual VI, there is no problem. If the LEDs are made as indicators, then they intially display the status(i.e) ON/OFF and then display message on mouse click. But when I want to call this VI in one of the subpanels in the main VI, I am changing the LEDs as controls and then I am facing the problem which I previously stated. Where is it getting wrong?
0 Kudos
Message 4 of 8
(2,704 Views)
Hi Srini

I don't fully understand what you want to do.
Could you please send your source code (tell me your LV version) so I can have a look at it and tell you my feed back.

Doc-Doc
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 5 of 8
(2,704 Views)
Hi,
I have attached a zip file that contains all the VIs required by the main VI, test.vi. Click the GNG button on the test.vi front panel. Three subpanels will open. In the acquisition panel, just click the acquire button and choose the binaryfile1.dat. The LEDs(right now only 6 out of 96 of them) will show some status. Now, if I click any of those LEDs, some message should be displayed on the details window. Run the status1.vi separately and you will know my problem.

Thanx & Regards,
Srini.
0 Kudos
Message 6 of 8
(2,704 Views)
Hi,
Sorry! I forgot to attach 2 files. Now you can run the copy of menutest.vi. Click the GNG button on the front panel. Kindly see my VI and help me. Awaiting for a reply.

Thanx & Regards,
Srini.
0 Kudos
Message 7 of 8
(2,704 Views)
Dear Srini,

I am sorry to tell you that your code is a good example of what we call "racing conditions".

This means that you designed your VI in a way you cannot be sure in what order LabVIEW will execute your code. Remember LV is not "reading" from left-top to Right-bottom your VI. It tries to run everything that is not interconnected at the SAME time. (It is not exactly the same time but kind of).

In order to be sure your actions will occure in the right order, there are 2 ways to do it :
1 - Use a sequence with each action in a separate frame
2 - Interconnect VIs (with error cluster for example).

Once you will have done this, your VI will run as you expected.

Doc-Doc
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 8 of 8
(2,704 Views)