09-15-2011 02:39 AM
Hi gents.
I have a NI9159 chassis with 2 C-Modules on it: NI9425 (32xDI) and NI9477 (32xDO).
Use for this system is to acquire digital inputs from NI9425, process them using a response matrix (1 cycle timed loop) and set the outputs for the NI9477.
Delay (response time) between outputs and inputs is critical, so I want to optimize system to do the whole process as fast as possible.
To measure this delay, I've injected a pulse train (1s, 10v, 50% duty cycle) on the first input of the NI9425 and programmed system to set first output for the NI9477 as the same value as the first input of the NI9425.
Program is a continuous loop containing a DI read for the input connected to a shift register. this shift register is compared to its previous value, and, if it has changed, is sent to the DO. DO output is not updated if there's no changes.
To measure the delay between input and output, I've connected an oscilloscope with input signal in channel 1 and output signal in channel 2.
The results for the delay I'm getting vary between 16 and 25 us.
Here is the theoretical calculation I've made to explain this delay, according to NI specifications:
1 us Setup Time for the NI9425
7 us Update/Transfer Time for the NI9425
0 to 7 us synchronization delay for the NI9425, as it acquires data every 7us.
8 us Update Rate for the NI9477
1 uS Propagation delay for the NI9477
Suming all these values, I get 17 to 24 us.
Questions are:
Are my calculations ok?
Code is optimized to make response time as small as possible?
There's any way to get a faster response using this hardware, i.e. a different code?
Thanks in advance for your answers.
09-19-2011 12:10 PM
Hello Davidro,
If you are executing code in a While Loop, it takes 2 us per iteration so you must add one us to the Setup Time.
In addition, propagation time and update rates of 9477 are maximum values so you can expect a slightly smaller values during some iterations.