Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Concurrent Read/Write

Using a 6534 DIO.  I created a VI that sets up port 0:1 to read with a hardware trigger on PFI6, and then in the same vi I write to port 2:3, which I hardwired one of the bits on that port to PFI6, in effect creating a self-triggering sequence.  This works most of the time but I'm guessing that since the two processes aren't synchronized, the "write trigger" may happen before the read becomes initialized and is waiting for the trigger.  I inserted a sequence with a time delay and that works, but it would be better if I could somehow synchronize these two processes.  During my experimentation I can't determine when the triggered read is really ready.  Common sense tells me it's ready after the DAQmx Start/Rising edge vi, but it only seems to work once the DAQmx Read/1D Wfm/1sample vi gets called.  Ideally there'd be some kind of "trigger ready" VI I could use to initiate the write trigger sequence instead of waiting some arbitrary amount of time.  I experimented a bit with the DAQmx Is Task Done but I still can't prove exactly when the read is configured *and ready* for a trigger.  The fact that it works at all tells me this should be possible, and more time efficient if I could properly sequence the trigger after the "read ready".  Can anyone tell me how I can synchronize this read/write timing?  Thanks. (Deficient Code Attached)
 
Mark B.
Albuquerque, NM
 
0 Kudos
Message 1 of 2
(3,106 Views)

Hi Mark,

First off I'd like to make sure we're on the same page here. It is my understanding that you are trying to set up a digital input to trigger off of a digital bit that you are outputting. After looking at your code, it seems as though you are trying to do this only one time. There are a few things that I am still unclear about such as what you were referring to when you mentioned the "DAQmx Start/Rising edge vi." In order to set up a task which is triggering off of a second task, you should make sure to set up and start the first task (using the DAQmx Start VI) before initiating the second task (which does the actual triggering.) Once you have started the first task, the trigger is in fact armed. I noticed that you were using a number of the advanced DAQmx VIs. Is there a specific reason for that? I will try to find/create a small piece of example code that demonstrates the proper structure for this application.

Best regards,

Jordan D
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(3,096 Views)