Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous multi channel i/o problems. Corrupt o/p

I have a 6224 and a 6713 and using daqmxbase 3.2.

 

I'm using Red hat linux 5. 

 

In a 1ms loop I need to acquire 32 channels analogue, output 8 channels DAC, maintain 2 channels DIO as heartbeats, and read an 8 bit port once every 20 loops or so.

 

All the tasks work fine on their own. But together in a loop the output is corrupt!

 

I create an analog task and  use the onboard clock of the 6224 to drive the analogue input at 1Khz.

I create a digital i/o task and configure port 0 as o/p.

I create an analogue o/p task on the 6713 device and create the 8 channels. 

 

I read the analogue channels at beginning of loop.

 

I create a square wave for the analogue o/p data and write it. (each loop alternating high/low)

 

I toggle the  2 digital i/o bits and write the word to port 0.

 

Observing the analogue output shows strange waveform. The o/p is not a regular square wave, but a mixture of what i expect plus very narrow pulses grouped into bursts separated at ~4.5 Khz. The output is not stable in time.

 

The same is true for the digital lines.

 

I can get them to look ok if I reduce the output frequency by outputting every 100 loops or so (ie 10Hz)

 

I notice several threads are created when a task is created.

 

Is the o/p screwed up because there is too much thread start/stopping activity when data xfer is requested.

 

Is there a more fundemental/efficient way of issuing an IOCTL to initiate a xfer?

 

Has anyone tried this type of control loop programming?

 

regards

 

 

0 Kudos
Message 1 of 3
(3,017 Views)

Hi Ivorystag,

 

I have looked at a similar issue before with a customer. I strongly suspect the issue you are seeing relates to the transfer of information between the two cards. I would recommend pulling in larger numbers of Samples to try and rectify this issue. If you acquire 1000 samples and process the whole lot at once, this may help your output corruptions. I would aim to make the loop longer but with more samples acquired.

 

I hope this helps,

Andrew McLennan
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(2,894 Views)

Hi,

 

Thanks for the reponse.

 

I'm running a servo control system, so I need to get 1 sample in (on several channels) and create a new o/p sample at the same time. It's not possible to wait for 1000 samples (ie 1 sec) before doing something about it.

 

I've had to reduce the dac o/p speed to 250 Hz (which of course means an effective input adc speed of 250 Hz!). I'm hobbling along at this rate for present.

 

I'm not too worried about the digital i/o speed as this is only looking for switches etc.

 

I could, i believe, run my app at 500 Hz. This may let me up the DAC speed without corruption. I'll try this soon.

 

One thing you may be able to point me too is the use of the counter timer clock examples. If I can get an o/p from the card by simply starting a clock, that would help me a lot.

 

I would have to start and stop them occasionally however, so is there much internal delay involved in this?

 

 

 many thanks

 

 

 

0 Kudos
Message 3 of 3
(2,889 Views)