LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring the pulse width

I have an analog input that is being read using MyRio, and I want to measure the pulse width duration. However, I cannot connect the Pulse meas block to the analog read. Also, when I use Timing Trans it reads zero.

 

I am using Gravity Infrared CO2 Sensor as an input.

 

Please help

mdz11mm_0-1700257867143.png

 
 

Screenshot 2023-11-18 005711.png

0 Kudos
Message 1 of 3
(614 Views)

Hi mdz,

 


@mdz11mm wrote:

I have an analog input that is being read using MyRio, and I want to measure the pulse width duration. However, I cannot connect the Pulse meas block to the analog read. Also, when I use Timing Trans it reads zero. 


To determine a pulse width from an analog signal you need to do those steps:

  • convert the analog values into boolean ones, most often a simple comparison might work
  • determine edges in this boolean signal
  • determine the duration between the boolean edges

Please try to solve those steps without using ExpressVIs.

Use shift register(s) and maybe the PtByPt-BooleanCrossing function…

Best regards,
GerdW


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

It is very difficult to see and understand (much less edit and test) code submitted as "pictures".  This is especially true for LabVIEW Real-Time routines that can have three different "code bases", namely the Host (PC), the Target (myRIO), and an FPGA (inside the myRIO).

 

If your RT Project is contained inside a single Folder, right-click the folder, choose "Send to:", "Compressed (zipped) folder", and attach the resulting folder.  You should also mention how you connect the device(s) you are measuring to the myRIO (feel free to name the myRIO connector pins you use, but also provide their "signal names", such as "AI0" or "AI0+" (note these are two different inputs, and can appear on multiple myRIO connectors).

 

Bob Schor

0 Kudos
Message 3 of 3
(517 Views)