LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter and Trigger

Hello,
I am using a DAQ mx counter to count front edges. I have a sensor that sends 0 to 5 V connected to an NI 9411. What I want to do is, when I detect a rising edge, I want to set the variable "Trigger" to true. This variable will be used in another loop to set another variable to true. What I have noticed is that when the counter is incremented, my "Trigger" variable does not switch to true.

Capture d'écran 2024-04-17 092620.png

 

 


Thank you, 

 

 

 

KS200_1-1713338710612.png

 

 

0 Kudos
Message 1 of 4
(116 Views)

Hi KS200,

 


@KS200 wrote:

Hello,
I am using a DAQ mx counter to count front edges. I have a sensor that sends 0 to 5 V connected to an NI 9411. What I want to do is, when I detect a rising edge, I want to set the variable "Trigger" to true. This variable will be used in another loop to set another variable to true. What I have noticed is that when the counter is incremented, my "Trigger" variable does not switch to true.


Do you mind to cleanup block diagrams before posting such images? Thank you…

 

On topic:

  • Does the counter task loop set your "Trigger" SharedVariable to TRUE?
  • Did you debug your VI using probes to determine wire values while running the VI?

 

Best regards,
GerdW


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

Hello,

 

Thank you for the response. I apologize for the images; I will keep that in mind for next time.

Yes, the counter task loop sets my variable to true. Yes, I did debug, and I can see that the wire values change. For example, when the counter increments, I can see that the condition x > y becomes true, but my shared variable doesn't.

 

Thank you,

0 Kudos
Message 3 of 4
(103 Views)

Hi KS200,

 


@KS200 wrote:

For example, when the counter increments, I can see that the condition x > y becomes true, but my shared variable doesn't.


We cannot tell you why the SharedVariables don't work as expected from looking at images of code…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(84 Views)