LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HW trigger - Time delay between the switching of the relay and reading of data AI

Hello all,

I am preparing the tester for electrical performance of relay.

 

Function Counter Output „switching of relay“ is for the switching of the relay ON/OFF (/KUE/_ctr0) see attachment.

Function „red of data“ is for the reading of data AI with help HW trigger (/KUE/Ctr0InternalOutput) see attachment.

 

The application works correctly, but I still need some delay (±50 – 200 ms) between the switching of the relay (/KUE/_ctr0) and reading of data from AI (/KUE/Ctr0InternalOutput).

 

Is there a way to do it?

 

Thank you for your help.

Best regards

Radek

Download All
0 Kudos
Message 1 of 9
(3,538 Views)

What is the DAQ device?  Is it NI Hardware?  Please give the model number -- if it has multiple counter/timers, you might be able to add a delay easily ...

 

Bob Schor

0 Kudos
Message 2 of 9
(3,532 Views)

Hello Bob,

I use NI cDAQ-9189.

For switching of relay I use NI 9401 and counter (_ctr0) is from cDAQ-9189. In NI cDAQ-9189 are other 3 usable counters.
For reading of data I use NI 9205 and I am triggering the data with help /cDAQ9188/ctr0InternalOutput.

 

Radek

0 Kudos
Message 3 of 9
(3,520 Views)

Hello RadekMejznar!

 

I took a closer look to your application and my first suggestion would be to actually change the architecture itself. If you exactly know the frequency of switching the relay, I would rather try to synchronize all tasks and set delay by proper timing of measurements.

For example: Relay freq is 1 Hz, so you perform AI measurements also with the same frequency, but with 50-200 ms of offset delay.

0 Kudos
Message 4 of 9
(3,472 Views)

Don't forget that Relay have bouncing... depending of your relay, signal 5 to 100 ms and general relay... can go up to 200 ms.

Benoit

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

Hi Benoit

I guess that this is the direct reason for this delay. Still, if you increase the delay to ex. 250ms, it should not be a problem.

0 Kudos
Message 6 of 9
(3,466 Views)

Below is a snippet to show how to set that delay.  It's a DAQmx Timing property node, setting the Convert Clock's "Delay from Sample Clock".   You can find more info about the relationship of the Sample Clock and Convert Clock in DAQmx Help and your device manuals.

 

 

-Kevin P

 

convert clock delay.png

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 7 of 9
(3,458 Views)

Thanks Kevin P for the nice input. I think it could be very helpful.

 

However, @RadekMejznar please keep in mind, that you have to synchronize the tasks in order to use this piece of code.

0 Kudos
Message 8 of 9
(3,440 Views)

Hi again  @RadekMejznar!

Did you manage to solve the problem?

0 Kudos
Message 9 of 9
(3,424 Views)