LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

returning an array of 0s and 1s according to the waveform detected

I hope someone can help with this issue. I'm still new to Labview and hope someone can help create this code. 

I have a device (single photon detector) that generates a pulse (5V) if it detects a photon, and no pulse if there is no photon. The rate of these pulses would be 5kHz max.

The code should work as follow: if a 5V pulse is detected, it should return 1, if no pulse is detected, should return zero. Then an array of zeros and ones will be created. 

I'm reading from the single-photon detector using a DAC device (PCI-5122), which is also triggered. So the code should work only when it receives a trigger, which is at a frequency of 5kHz. The code should not miss any of these pulses.

Any help?

Thanks in advance.

0 Kudos
Message 1 of 6
(1,378 Views)

What do you have so far? 

0 Kudos
Message 2 of 6
(1,376 Views)

Hi MK,

 


@MK_17 wrote:

The code should work as follow: if a 5V pulse is detected, it should return 1, if no pulse is detected, should return zero. Then an array of zeros and ones will be created. 


Suggestion:

IF voltage >= 4.0     % whatever limit is suitable to you
THEN
  output "1"
ELSE
  output "0"
ENDIF

Hint: never compare for "==5" when you deal with real-world analog measurements…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(1,371 Views)

Hi,

so far i'm using the vi example code in order to display the waveform, it can be found under  Hardware Input and Output»Modular Instruments»NISCOPE (High-Speed Digitizers)»Demos»niScope EX Quick Start.vi 

 

I believe since the waveform can be shown, then i can do some analysis on it. But i'm not sure how to do it. The waveform displayed is of the format cluster waveform. 

 

 

 

0 Kudos
Message 4 of 6
(1,331 Views)

Hi Gerd,

thanks for the suggestion. That's what i'm planning to do, but how to do this is what i'm struggling with, especially since the code i'm using (Hardware Input and Output»Modular Instruments»NISCOPE (High-Speed Digitizers)»Demos»niScope EX Quick Start.vi.) gives the waveform as a cluster format.

How to return an array after analyzing each waveform one by one and that can be displayed and saved later?

0 Kudos
Message 5 of 6
(1,327 Views)

Hi MK,

 


@MK_17 wrote:

How to return an array after analyzing each waveform one by one and that can be displayed and saved later?


Quite easily:

GerdW_0-1677074621125.png

 

Best regards,
GerdW


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