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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Value Change event on a boolean LED

Hi,

I have an event that I want to trigger on the value change of a LED, but the event keeps running the Timeout even if the value of a LED changes.

I have attached my code, and would greatly appreciate any help.

Also, can anyone tell me why I can't write all 3 of those DAQmx channels in 1? I've tried it and not all of the lines will reflect the correct values. (I know it doesn't get activated yet in this code, but I used them all in one virtual channel in an older version of this software, and it doesn't quite work, but it works fine in the 3 separate channels).

Thanks,
Nicholas
0 Kudos
Message 1 of 12
(3,144 Views)
It would help to post the code!

If we assume quickly that you have a switch that controls your LED, then when the true statement is returned, you can wire the LED to the switch and a case statement to the switch where the True case activates whatever you want triggered.  
Anthony Wong
University of Toronto
Chemistry Department
0 Kudos
Message 2 of 12
(3,129 Views)
I attached the code last time, let's see if it works this time...ahh, when you preview the post, it removes your attachment...
0 Kudos
Message 3 of 12
(3,126 Views)
Hi Nicholas,
I cannot see your code because I have up to 7.1, but I can say that the Value changed event will be triggered only in two cases:
a) the user changes the value by Front Panel (obviously impossible for indicators)
b) the value is changed by code using the Value(Signaling) property

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 12
(3,103 Views)
I've tried using the Value (Signaling) [not in the code that I posted], but it keeps locking up my front panel. I'm assuming that I've tried using it incorrectly, because everywhere that I read suggests using that.
0 Kudos
Message 5 of 12
(3,099 Views)
Yes, the place where you put the event case structure is very important. The event structure is recommended to be "ready to run" when the event occurs.
Another option is to configure the event case in such a way that it doesn't lock the FP, but you need to be sure that you won't get into troubles.
Take a look at the example vi's to understand how to use events.
See also this running thread http://forums.ni.com/ni/board/message?board.id=170&message.id=188253
for an example of misplaced event structure.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 6 of 12
(3,094 Views)
I've been using events for a while now, but I guess what I really need is for one event to triger another. In one event, I have a sequence, and depending on the frame of the sequence, I need to trigger another event. So, say on frame 1 I have to triger an event, and then skip frame 2, and trigger the same event on frame 3. However, this sequence itself is in another event structure. So is there any way to trigger an event from inside another event?
0 Kudos
Message 7 of 12
(3,090 Views)
Any event triggered in an event handler, whose handler is in the same structure will only be executed after the current handler has finished.
To accomplish what you said, you would need two event structures. The 2°nd  structure should be devoted to executing events triggered in the 1st one event handlers.Such an architecture is discouraged, though, because it can easily lead to bugs, due to the inherent complexity.
If you are sure that things will be simple forever, you may try this way.


Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 12
(3,088 Views)
Rather than having two event structures, you can have one event structure that controls a second loop using queues or notifiers. Look here for some more information. You can also access a template of this design from LabVIEW by selecting File >> New to bring up the template dialog. Then browse to the Producer/Consumer (Events) template as shown below:

Message Edited by Jarrod S. on 06-05-2006 03:38 PM

Jarrod S.
National Instruments
0 Kudos
Message 9 of 12
(3,079 Views)
I've posted a new llb with some comments in it that may make what I want to do easier to understand. I'm not sure if it's possible, but I don't see it as a strange thing to do, so I'm sure that it must be possible.

Thanks for all of the continued suggestions, I appreciate the help a lot!
0 Kudos
Message 10 of 12
(3,066 Views)