Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Using 6534 and want to simutaneously use input and output.

I am using the 6534 card with LAbview and am having problems when using I/O. I am trying to output a buffered pattern using an internal clock. Using the same clock I need to read in new values/patterns on the input. However while DIO read is waiting for the external clock all other functions appear to freeze and the data and clock from DIO WRITE/START will not output data. If anybody can help I'd be very grateful.
0 Kudos
Message 1 of 2
(3,130 Views)
The DIO read function is a synchronous function call, which means that the rest of your code will wait for that call to complete before continuing. There are a few ways to program your input and output operations to take this into account.

The easiest way is to program using two DIO reads as follows:
1st DIO Read will be setup to read 0 scans. From this call we can find out how many reading are in the buffer through the scans backlog output.
The 2nd DIO read can be in a case statement and will execute with the desired number of scans to read (X) is available. We can compare the scans backlog to X and if true execute the 2nd DIO read.

Both of these operations will execute in a loop if you are doing continuous operations. If you are simply reading on
e buffer then the first DIO read will be in a loop which will execute until X number of points are available, the the second DIO read will execute after the loop is completed.

This programming technique effectively allows you to make your DIO read an asynchronous call. Which means it will only read the data when the data is available, and not hold up the rest of the program in the mean time.

Good Luck with your project.
0 Kudos
Message 2 of 2
(3,130 Views)