ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically trigger a latch boolean?

Solved!
Go to solution

Searched for previously solved solution but could not find a conclusive solution.

 

so I have a reset button set as a latch. I want a change value event to trigger this latch.

 

If there is no way to do it via a latch, in this case how to implement:

 

A value change event within my program ( non user triggered) which should trigger the latch which is found in another loop?

 

Many thanks for recommendations and help.

0 Kudos
Message 1 of 13
(5,951 Views)

Hi rajiv,

 

I have a reset button set as a latch. I want a change value event to trigger this latch.

Usually the button triggers the event case, not the other way around…

 

If there is no way to do it via a latch, in this case how to implement:

Simple solution: change from latch to switch…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(5,938 Views)

So Gerd,

 

Does it mean that once the event is triggered, and I set the boolean to true as a switch then I need to use a sequence to set it back to false? Am just wondering if there is a better practice.

0 Kudos
Message 3 of 13
(5,930 Views)
Solution
Accepted by topic author rajiv85

Hi rajiv,

 

Does it mean that once the event is triggered, and I set the boolean to true as a switch then I need to use a sequence to set it back to false?

For the simple solution: yes.

 

Am just wondering if there is a better practice.

Sure!

  • Run your command only on value changes of your button (using BooleanCrossing).
  • Use a QMH and send a command from your event loop to your loop containing the button…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 13
(5,922 Views)

Thank you very much!!

 

I already have a QMH in my program, so I will see how implement one for this. 

 

If I can please squeeze additional questions: I have one QMH, as an enum from my events box which trigggers a notification as shown:

QMH1.JPG

1. So if I add a new notification ( based on an event) should I use a cluster or can I use multiple notifications? Further I see that for multiple notifications I have only ' wait on notification' .. while for a single notification I have 'get status' -> am wondering if the 'wait on notification' will stop my loop from running until it gets a notification ( in the case of multiple notifications 'bundled together' as an array--> build array. ?)

2. Just on this topic, am wondering why does mutiple notification does not have a get status, instead, wait on notification?

 

Big thanks for further clarifications.

0 Kudos
Message 5 of 13
(5,910 Views)

Gerd, thank you so much again, the boolean crossing ( also very useful) led me to check the: ''Value Has Changed PtByPt VI'' which was actually what I needed. So I simply need to wire my dbl to this and it will trigger the boolean when there is a change. I was trying to implement this using a more complicated and long way 🙂

 

0 Kudos
Message 6 of 13
(5,898 Views)

Hi rajiv,

 

So if I add a new notification ( based on an event) should I use a cluster or can I use multiple notifications?

When you need a different notification you need to use a different notification!

(I don't get the question on "use a cluster"…)

 

am wondering if the 'wait on notification' will stop my loop from running until it gets a notification

There is a timeout input…

 

Just on this topic, am wondering why does mutiple notification does not have a get status, instead, wait on notification?

Ask the NI support as they should know…

Why do you even compare the "Wait for…" functions with the "notifier status" function? There is a WaitForNotification and WaitForMultipleNotification…

 

the boolean crossing ( also very useful) led me to check the: ''Value Has Changed PtByPt VI'' which was actually what I needed.

Then why didn't you ask for that in the first message?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 13
(5,897 Views)

So: the notifier status, am using it to communicate with different SubVis. I did not test it yet, but am assuming that wait on notification will cause a waiting for a notification to arrive for it to run the SubVI. That subVI needs to run all the time. So I wondered why we dont have 'notifier status' for the multiple notifiers.

0 Kudos
Message 8 of 13
(5,890 Views)

Hi rajiv,

 

but am assuming that wait on notification will cause a waiting for a notification to arrive for it to run the SubVI. That subVI needs to run all the time.

But you don't need to read the notifier each microsecond!

Set a reasonable timeout value…

 

So I wondered why we dont have 'notifier status' for the multiple notifiers.

Because you don't need it…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 13
(5,883 Views)

Thank you Gerd!

-I will include a time out!!!

 

-Am not quite understanding why we would not need it for the case of multiple notifiers. But this is surely a lack of knowledge from my side. I will need to find out what is the difference between: notifier status and wait on notification.

 

 

 

 

0 Kudos
Message 10 of 13
(5,879 Views)