LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Frequency by cDAQ digital output for watchdog hardware on window application

Hello all,

I toggling digital output by every 50ms to set frequency of 10Hz for watchdog.
Used timed loop to calculate actual frequency deviation and observed frequency is deviating by more than 40% from set frequency (I set 10Hz and actually measuring in time loop in range of 6 to 14Hz).

I using NI9375 module to toggle digital output.

Watchdog Snippet.png

0 Kudos
Message 1 of 4
(560 Views)

Hi Prashant, and welcome to the forum!

 

Unless you're running on a real-time system, the timed loop approach is not recommended and almost certainly won't do what you want.  You can generate a 10 Hz watchdog by writing a digital waveform (for example, of 1 second length) using DAQmx Write (Digital Wfm 1Chan NSamp) and running in Continuous Samples mode.  By default, it will repeatedly output the waveform until the task is stopped (that is, regeneration is allowed by default).  This method uses the acquisition hardware clock and is likely to be much more accurate.

 

Andy

Message 2 of 4
(529 Views)

Hello Andy,

 

Thanks for the idea.

 

Do you have any sample example of creating digital waveform with some set frequency.

It could be really help us.

 

WR

Prashant

0 Kudos
Message 3 of 4
(486 Views)

Hi Prashant,

 

open the example finder and look for those example VIs for "DAQmx -> Digital Output"…

Best regards,
GerdW


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