Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DIO Read Works For A While, Then Returns No Data

I'm looping across the buffered data from the DIO cards, and the read works for a while, and after a while of collecting data the cards begin returning that there is no data in the buffer. The data is, at the moment, being generated at a constant rate, I have verified that the data is still coming in. It appears to be related to the total number of points that have been read, because as I increse the clock speed of the data the time in which it takes for this event to occurr is shorter. The event is very reproducable.

The cards I am using are the pxi-6533 cards, and are installed in a pxi-815xb chassis.


Is there some sort of buffer clearing that is necessary for me to continuously run this setup at high data rates? The reads themselves are not returning errors, simply just not returning any data.
0 Kudos
Message 1 of 6
(3,632 Views)
Hi Marshall,

You mentioned that everything seems to be very reproduceable and that it occurs after a certain number of points are counted. Is that count always the same? What is the count? Perhaps there is something else stopping the operation?

Some more details might clear up what is happening.

Regards,
0 Kudos
Message 2 of 6
(3,609 Views)
I am not positive, but it seems to me that it must be related to the buffer size that i have set on the cards (which i believe is set to 256k data points). I haven't actually counted this up yet, but it seems to make the most sense, since it is directly related the clock speed at which the data is coming in.


I have temporarily fixed the problem, by closing and reinitializing the cards after each read. I can not say that i throughly have warmed up to this as being a good solution to the problem, but it works for now.


I will try and see if I can count up the points from our recorded data, but maybe the way i have rigged it to work will provide some insight for the moment.
0 Kudos
Message 3 of 6
(3,601 Views)
Hi Marshall,

It sounds like you are right about having some suspicions about the buffer being the cause of the problems.  Could you maybe tell me what errors you are getting?  Is it the same error all the time?  Have you tried running some simple examples such as Cont Read Dig Chan-Ext Clk.vi (Help > Find Examples > Browse > Hardware Input and Output > DAQmx > Digital Measurements)?  It could be something specific to the code that you are using.  An example could help figure out if the problem is due to how the software is set up or something going on in the hardware.

Let me know how the testing goes,
0 Kudos
Message 4 of 6
(3,584 Views)
I have created two VI's which mimic the type of operations that I'm doing.  I think it is because once it reaches the "number of scans/backlog" number of points, it stops reading.  Esentially what is happening with the signal is there is an external device putting a word on the lines, and then pulsing the strobe on the dio card.  The signal is asynchronus, so we must rely on the strobe.  (in actuality my test signal is synchronus, but the signal from the equipment will not be and this is why it is structured the way it is).  I think what's happening in the one that works is that I am "resetting" the number of scans/backlog parameter, and therefore allowing the continued reading.  The reason that I am doubling up on the reads in order to get the backlog, is that the loop we are running is timed, and it is important to know how many counts we have received per second, etc etc, so i only want to read exactly how many points are in the buffer for that iteration.
0 Kudos
Message 5 of 6
(3,570 Views)
Marshall,

I'm glad to see that you found a method that works for you.  Another option would be to set up a measurement to where you use the Tick Count (ms).vi (All Functions > Time & Dialog) to determine the time elapsed between scans.  I've included an VI that is modified from the example I told you to look at before.  The example should show you how to read with an external clock (aka pulse/strobe) and should still be able to tell you the frequency of the strobe.

Essentially you will continue to have the operation stop if the number of backlogged scans is greater than your buffer size.  The way to work around that is to read larger chunks of data.

Regards,

Message Edited by Otis on 07-06-2005 03:35 PM

0 Kudos
Message 6 of 6
(3,550 Views)