From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1.7 second digital output delay on 6008 DAQ?

I have attached a simplified vi of the CD&sim loop producing this lag.  It has about 1.5 to 1.8 second delay from the time the "i" value in the control is changed until the DAQ actually outputs the signal.  This seems excessive, and I need to reduce this to under .5 seconds.

Is this a problem with the software configuration or the DAQ hardware?

0 Kudos
Message 1 of 4
(2,561 Views)

Is there a reason you are using a control simulation loop?

 

You might be having problems with your abuse of local variables such as  Relay 1 2 3 and 4.  Why didn't you wire the results of the array manipulation directly to the DAQ assistants?  It is probably taking an extra iteration of the loop before a change in relay 1 through 4 makes its way to getting to the DAQ card.  I don't know how the simulation loop is supposed to work to know what its timing rate is.

 

Why the crazy array manipulations?  You are indexing an array to get a boolean.  Building it back into a 1 element 1-D array, then replacing that element with itself.

0 Kudos
Message 2 of 4
(2,549 Views)
The sim loop is necessary for other components of an open-loop dynamic motion simulator and the delay changes very little (or not noticeably) with changes in the time step (nominally .1 sec) and/or variable wiring.  
The arrays are providing values and index position feedback to some switching logic.  In this gutted version, the logic output is represented by the I_output Control.
Could this be a software problem?
0 Kudos
Message 3 of 4
(2,531 Views)

I'm waaaay late on this but it was not a software problem. You configured the sim loop to run with a 1 kHz clock and you set the period in the loop attributes to 1000. This will cause the simulation loop to execute once every 1000 clock ticks, which means once every second on a 1 kHz clock.

 

I'm also suspicious about you using a variable-step solver like RK23 with hardware timing. You should use a fixed step solver like RK1-4 with hardware timing if you want to achieve any semblance of real-time.

0 Kudos
Message 4 of 4
(2,327 Views)