=================== Installation ================== To use this dlm, place the following files in the C:\rsi\idl56\bin\bin.x86 folder. serial.dll serial.dlm =================== Documentation ================ FUNCTION COMM_OPEN SYNTAX h=COMM_OPEN(port [, BAUD=value][, BUFFERSIZE=value] [, DATA=value][, MODE=value][, PARITY=value] [, STOP=value]) RETURN VALUE Returns a handle. This handle is passed to the other functions. ARGUMENTS port - Specify the serial port, for example: 'COM1', 'COM2', ... KEYWORDS BAUD - An integer baud rate, for example 9600, 19200, ... BUFFERSIZE - Request an internal buffersize (number of bytes). If this is not present an OS default buffersize is used. DATA - The number of data bits. Normally 8 or 7. MODE - Open the port for: 0 = Query mode only 1 = READ only (Default) 2 = WRITE only 3 = READ/WRITE PARITY - Use one of the following: 'N' = No parity 'O' = Odd parity 'E' = Even parity 'M' = Mark parity 'S' = Space parity STOP - Number of stop bits, 1 or 2. FUNCTION COMM_CLOSE SYNTAX result=COMM_CLOSE( [handle] [, /ALL]) RETURN VALUE Returns the number of successfully closed handles. Non-zero indicate success. ARGUMENTS handle - Handle returned by COMM_OPEN. If handle is not specified /ALL must be. KEYWORDS ALL - Close all handles. The handle argument is not required when /ALL is used. FUNCTION COMM_READ SYNTAX result=COMM_READ(handle [, BUFFER=variable][, NMAX=value][, NOUT=variable] [, OFFSET=value][, TRANSFER_COUNT=variable]) RETURN VALUE Returns the data that is available on the port as an array of bytes. If no data is available integer -1 is returned. To check if no data was read use "IF (result[0] eq -1) THEN ..." If the BUFFER keyword is present, then the return value is an integer indicating how many bytes were read. The actual data read is then stored in the variable specified with the BUFFER keyword. ARGUMENTS handle - Returned by COMM_OPEN. KEYWORDS BUFFER - Use this keyword to read data from the port into an existing IDL variable instead of allocating new memory. NMAX - Imposes an upper limit on the number of bytes to read from the port. Note that the actual uppper limit may be lower than this due to other constraints. NOUT - A variable that will contain the actual upper limit specifying how many bytes were actually attempted read. OFFSET - Specifies a byte offset into the variable specified by the BUFFER keyword. This allows for reading into the same variable repeatedly without overwriting the data that has already been read. TRANSFER COUNT - A variable that will contain the number of bytes read. FUNCTION COMM_WRITE SYNTAX result=COMM_WRITE(handle, data) RETURN VALUE Returns the number of bytes successfully written to the port. ARGUMENTS handle - Returned from COMM_OPEN data - A scalar or array of a basic datatype that will be written (binary write) to the port.