Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

AT-DIO-32HS: How to output 32 data bits with NO handshaking

I can see in the examples how to OUTPUT 8 bits to a single port with no handshaking. But how do I output 32 bits to ports 0-3 in one coding statement, WITHOUT setting up any handshaking ?? It seems if I assign 4 ports to a group, then handshaking is automatically assumed.
 
Any help is appreciated !
Thank You !
0 Kudos
Message 1 of 4
(3,409 Views)
Hello,

If you give me a little more information I believe I can help you.  You mention you are looking at the examples, can you say which examples those are, so that I can see what your seeing.  Also you said that handshaking is automatically assumed, are you saying that because you are seeing a change in speed? or does the code actually have you input parameters that only make sense if there is handshaking involved.  It seems that you could just right 8 bits to each port individually and get the implementation you are looking for.  It seems like you could also just not set up the handshaking.  Please let me know which examples you are looking at and what programming language you would like to implement this in and I will stay on top of this issue.

Have a great day,

Michael D
0 Kudos
Message 2 of 4
(3,381 Views)
Hello !
 
I am writing a program in C++ using the TRADITIONAL NI-DAQ library. I want to be able to control the lines of PORT 4 individually  and programmatically, so my understanding, based on the documentation, is that I can NOT use GROUPS  in order to output 32 bits of data (and I don;t want to use BLOCK output because it is asynchronous). So yes, my solution for now will be to place the 32 bits if data on each of the 4 ports (ports 0-3) individually, and then raise the appropriate line in PORT 4. So in my code, I will have to have something like this:
 
Dig_Prt_Out(DEV_NUMBER, PORT0, BYTE0);             // place byte 0 of 32-bit work onto port 0
Dig_Prt_Out(DEV_NUMBER, PORT1, BYTE1);             // place byte 1 of 32-bit work onto port 1
Dig_Prt_Out(DEV_NUMBER, PORT2, BYTE2);             // place byte 2 of 32-bit work onto port 2
Dig_Prt_Out(DEV_NUMBER, PORT3, BYTE3);             // place byte 3 of 32-bit work onto port 3
Dig_Line_Out(DEV_NUMBER, PORT4, 1 /*line#*/, 1);   // let device know data is ready
 
What I would like to do is REPLACE the first 4 lines of the example above with a single statement, such as:
 
Dig_???(DEV_NUMBER, PORTS0123, BYTES0123);   // place entire 32-bits of data on all ports in a single programming statement
Dig_Line_Out(DEV_NUMBER, PORT4, 1 /*line#*/, 1);   // let device know data is ready
 
 
 
I am still learning how to use the NI-DAQ library, so I hope my question is not too basic. If this is still not clear, please let me know. I appreciate your help !
 
 
 
0 Kudos
Message 3 of 4
(3,373 Views)
Hi,

I think the best way to proceed would be to make that code you showed into a function that will assign each 8 bit piece to the correct port.  I also think if you called DIO CONFIG and listed all the handshaking parameters as no change, then you would be getting the same performance.  Since you have the code doing what you want I would recommend you make a function out of it and go with that process.  The traditional NI DAQ function reference help is a great tool for finding the correct function call for a situation.

Have a great weekend,

Michael D
0 Kudos
Message 4 of 4
(3,357 Views)