Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DIO function of NI 9401

Hello Markie,
 
 When you mean "sync" in DI & DO, will the rising and falling edges of the clock occur at the same time?  Please refer to DI_DO_pulse train.jpg.  Second, does is it refer to DO generation and DI capture will occur at the same time?  Please refer to generation_capture.jpg.
 
Thanks for your patience.
 
A
Download All
0 Kudos
Message 11 of 21
(2,646 Views)
Hi A,

Since the same exact sample clock will be used for the digital input and output, they will share the same rising and falling edges. This will also mean that the each acquisition and generation will occur at the same time.

Regards,
Kent
Applications Engineer
Message 12 of 21
(2,613 Views)
Hello Smiley Happy
 
My understanding of what you have mentioned is illustrated in the page 1 of the attachment.  At every active edge ( rising edge ) of the clock, the generation and acquisition occurs.
Specifically for my application as shown in page 2 of the attachment, the moment I generated the 1st desired setpoint,  the 1st sample readback will occur at the same time.  Is there an API or a code setup to achieve this?
 
Thanks again,
0 Kudos
Message 13 of 21
(2,605 Views)
Hi A,

I am not quite sure what the difference between the two pictures that you have posted. It seems that it is the same signal but shifted in time. But regardless, both digital tasks will act at the same clock edge. As for the code, I believe that you are working on this on another post. As was discussed before on this thread, the only thing needed is to create a counter output task for the sample clock, and use this clock as the sample clock for both digital tasks.

Regards,
Kent
Applications Engineer
Message 14 of 21
(2,587 Views)
Hello Smiley Happy
 
I have completed the code for that without using a counter module.
 
Sorry for the confusion again.
Well anyway, both pictures are quite similar except that the 2nd picture, wherein I put emphasis on the 1st generation & 1st capture.
The moment I write the 1st sample, I want to acquire the 1st sample immedietely.  I am going to use this on a speed application that is < 10 ms, with a tolerance of +/- 1%.
 
Is there an API or something to achieve the immediete 1st sample acquisition?
Thanks for your patience.
 
Best regards,
A
 
 
0 Kudos
Message 15 of 21
(2,583 Views)
Hi A,

If the sample clock begins after the digital tasks are started then both the first generation and first acquisition will occur at the first rising edge of the sample clock. If the sample clock is already running when the tasks are started, you can use a trigger to align the two. See this article for more information on triggering in DAQmx. There is also very good information about sample clocks and triggers in the DAQmx Help file.

Regards,
Kent
Applications Engineer
Message 16 of 21
(2,577 Views)
Dear tnek,
 
you mean like this:
 
DOTask->Start();
DITask->Start();
....
....
....
 
DOTask->Timing...
DITask->Timing...
 
Best regards,
A
0 Kudos
Message 17 of 21
(2,566 Views)
Hi A,

Here is an LabVIEW example which accomplishes this task. I have attached it as a screenshot so you can use it to structure your program. Note that the timing is set before the tasks are started.

Regards,
Kent
Applications Engineer


Message Edited by tnek on 06-26-2008 11:16 AM
0 Kudos
Message 18 of 21
(2,552 Views)

Dear K,

errrr..ooopss sorry I cannot open the attachment because I am using Visual C++.

Thanks,

Smiley Wink

 

0 Kudos
Message 19 of 21
(2,541 Views)
Hi A,

The attachment is just a picture and should be viewable in your web browser. I just posted it so you can see how your task should be structured.

Regards,
Kent
Applications Engineer
0 Kudos
Message 20 of 21
(2,514 Views)