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.
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?
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.
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.