LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Falling edge to trigger event case

I'm collecting voltage measurements from a photodiode using a NI PCI-6229. I'm thresholding this signal and converting it to digital with a simple comperator. Currently, I'm using some boolean gates to detect a falling edge on this signal. However this gives me a boolean array which I can't wire to a case structure. How can I trigger an event when a falling edge is detected?

 

I've searched through the forums and looked through some examples and it seems like I have to create my own user event, but even with the help documentation, I have no idea how to actually implement this. Am I even on the right track? Is there a simpler way to go about this?

0 Kudos
Message 1 of 9
(5,230 Views)

Hi light dark,

 

using the BooleanCrossing function you can detect falling edges quite easily!

 

a boolean array which I can't wire to a case structure. How can I trigger an event

First you speak about boolean arrays and a case structure, then you mix in (user) events. How is all this related?

Best regards,
GerdW


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

Sorry that was confusing.

 

So the output of my analog to digital conversion produces a boolean array. I can't wire boolean arrays to case structures or to the BooleanCrossing function. I want to execute some actions on a falling edge and I'm assuming the easiest way to do so would be with either a case structure or event structure. The user events was just something I had come across when I was searching for a solution and honestly I have no idea if that'll help.

0 Kudos
Message 3 of 9
(5,192 Views)

Hi light dark,

 

So the output of my analog to digital conversion produces a boolean array. I can't wire boolean arrays to case structures or to the BooleanCrossing function.

Well, what happens when you draw a FOR loop around the BooleanCrossing function and then draw a wire from your comparison to the BooleanCrossing input?

Best regards,
GerdW


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

I am able to wire it, but it doesn't seem to be actually detecting the changes. Checking with the probe, I am able to see that the values are indeed changing from true to false/false to true, but the return of the BooleanCrossing always remains false. Is there something else I'm missing?

0 Kudos
Message 5 of 9
(5,170 Views)

Hi light dark,

 

in the 3rd post the first time some code to look at…

 

You can get rid of the FirstCall? function. When you look inside BooleanCrossing you will know why…

 

How many elements/samples do you read per call? How often does the loop iterate?

Best regards,
GerdW


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

Yeah sorry about that. I had thought that the situation was generic enough where I didn't really need to give specific code.

I see that the firstcall function is already part of the BooleanCrossing function.

 

I'm not quite sure what you mean by per call, but I'm acquiring continuous samples at 1kHz. I believe Labview is storing 100 samples at a time.

0 Kudos
Message 7 of 9
(5,138 Views)

Hi light dark,

 

I believe Labview is storing 100 samples at a time.

Believing is not the same as knowing…

 

Can you check this?

Can you show some example data where you expect falling edges, but BooleanCrossing doesn't detect them?

Best regards,
GerdW


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

The loop for data acquistion is set to 100 samples. The iteration count of the for loop around the booleancrossing also says 100. I also checked the array size and that's 100 as well.

I'm taking the boolean array and converting it to 1s and 0s so I can display it as a waveform on the front panel. I added an indicator to the return of the booleancrossing and placed a conditional boolean probe on it to pause if true, but it never pauses. However, when I essentially replicate the boolean logic in the booleancrossing function, the conditional boolean probe at least pauses at the right time.

0 Kudos
Message 9 of 9
(5,106 Views)