Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How to acquire serial data on a digital input line with good performance?

Hello,
 
we have a performance problem with our realtime controller. Our objective is, to read a 24-bit long digital waveform from a digital input line. To do this, we supply a clock signal (236 KHz)  to the PFI1 Line of our DAQ Board. On each rising edge of the clock, a new bit is set on the digital input DI0.
 
Our hardware which transmits the data, is triggered through a digital output from our realtime controller. On each edge on this output, the hardware starts a serial transmission of 24-Bits.
 
Everything works fine except the bad performance of our realtime controller. We want to acquire the 24-Bits in a 1ms timed loop. To measure performance we wrote a test program. In that, we only triggered the hardware and transfered the data to the realtime controller. The task which is doing this job, has a approx. CPU-Load of 30%, which is, in my humble opinion, very high. The task is not waiting for data or anything else! We have earlier implemented a control which is also using a 1ms timed loop. This control is sampling 2 analog input signals, 2 counters. Futhermore it's sending telegrams with CAN and doing many calculations. The strange thing is, this much huger program has a CPU-Load of 25%. Does anybody know where the problem is?
 
For the better understandig I attached our test-program to this text.
 
We're using:
 
PXI-8175 realtime controler
PXI-6221 Multifunction DAQ
 
Thanks!
 
Regards, 
   Crest!
 
 
 
 
 
 
 
0 Kudos
Message 1 of 2
(3,036 Views)
Hello,
 
First of all 30% CPU-Load is normal because the DAQmx-driver needs a lot of resources.
 
In your programm you should place a wait (for example with 1ms) into the while-loop which causes
lower CPU-Load.
If this is not enough you should build your vi like in the following example.
 
Regards,
Christian
0 Kudos
Message 2 of 2
(3,019 Views)