top01.jpg (17169 bytes)
mleft.jpg (4986 bytes) m01a.jpg (6169 bytes)     m02a.jpg (6905 bytes)     m03a.jpg (7743 bytes)    m04a.jpg (7456 bytes)     m05a.jpg (7878 bytes)     m06a.jpg (6862 bytes)     m07a.jpg (6076 bytes) mright01.jpg (5078 bytes)

ADU  Series - USB Data Acquisition Interface SDK

ADU RS232 Pipe

The AduHid DLL provides a pipe to transmit data between an application program and the RS232 port on the ADU device.

Data sent to the ADU device via the RS232 pipe is forwarded out on the DB9-RS232 connector. Data coming in from the DB9-RS232 connector is forwarded back to the host PC via the RS232 pipe.

An application opens an ADU RS232 Pipe with the OpenAdu232 function.

Outbound data is written to the RS232 pipe with WriteAdu232.

Inbound data is read from the RS232 pipe with ReadAdu232.

When finished close the RS232 pipe with CloseAdu232.


Note: all RS232 pipe functions include "Adu232" in their name

Command-Response Behavior

The RS232 pipe is a half-duplex connection that can handle one message in one direction at a time.

Thus an application that issues a responsive command must read the response before issuing another command. If two responsive commands are written to the RS232 pipe without an intervening read, then the two responses may corrupt one another.

For example the RD command sent to an ADR2010 board responds with the ASCII values of the 8 analog converters on the board. Every write of an RD command must be followed by a read of the response.

        WriteAdu232(handle, "RD", 2, 0, 0);
        memset(sResponse, 0, sizeof(sResponse));
        ReadAdu232(handle, sResponse, 40, 0, 0);
        // sResponse contains valid data

If two commands are sent sequentially, then a subsequent read of the RS232 pipe may return corrupted data.

        WriteAdu232(handle, "RD", 2, 0, 0);
        WriteAdu232(handle, "RD", 2, 0, 0);
        memset(sResponse, 0, sizeof(sResponse));
        ReadAdu232(handle, sResponse, 40, 0, 0);
        // sResponse may contain corrupted data

The recommended approach for an application program is to create a single thread that controls communication with the ADU device. Thus the sequence of writing commands and reading responses can be enforced.

 

 

NEWS         PRODUCTS         PROGRAMMING          APPLICATIONS          CUSTOM DESIGN          ORDERING          HOME


TestPoint is a trademark of Capital Equipment Corp.   
LabVIEW is a trademark of National Instruments.
Visual BASIC is a trademark of Microsoft Corporation


Copyright © 2002 ONTRAK CONTROL SYSTEMS 764 Notre Dame Ave, Unit #1 , Sudbury, Ontario, CANADA P3A 2T2  
"Quality serial Data Acquisition Interfaces"           PH. (705) 671-2652 FAX (705) 671-6127