B&B Electronics B232OPSDAReadDigital, Syntax C, 20Documentation Number 232OPSDA1397 Manual

Models: 232OPSDA

1 28
Download 28 pages 11.94 Kb
Page 21
Image 21
B232OPSDA_ReadDigital

segment and offset addresses of the integer array where the results of the A/D conversion will be stored.

Returns: FALSE (zero) if the function fails, otherwise it returns TRUE (non-zero).

B232OPSDA_ReadDigital

Purpose: This function reads the states of all the digital I/O lines.

Syntax: C:

Pascal:

BASIC:

BOOL B232OPSDA_ReadDigital (WORD hComDev, BYTE modAddr, WORD* data);

function B232OPSDA_ReadDigital (hComDev : word; modAddr : byte; data : Pword);

FUNCTION B232OPSDAReadDigital (BYVAL hComDev AS INTEGER, BYVAL modAddr AS INTEGER, BYVAL wdataseg AS INTEGER, BYVAL wdataoff AS INTEGER)

Remarks: hComDev is the handle to a serial port where the module is connected. This is the value returned by initComPort. modAddr is the module address. This is always 30H (48 decimal) for the 232OSPSDA module. data is the address of the 16-bit value where the digital I/O values will be stored. If bit 0 (01H; 1 decimal) of data is set, then digital input 0 is on, otherwise it is off. If bit 4 (10H; 16 decimal) of data is set, then digital output 1 is on, otherwise it is off.

For QuickBASIC users: wdataseg and wdataoff are the segment and offset addresses of the integer the digital I/O values will be stored.

Returns: FALSE (zero) if the function fails, otherwise it returns TRUE (non-zero).

20Documentation Number 232OPSDA1397 Manual

B&B Electronics -- PO Box 1040 -- Ottawa, IL 61350

PH (815) 433-5100 -- FAX (815) 433-5105

Page 21
Image 21
B&B Electronics manual B232OPSDAReadDigital, Syntax C, 20Documentation Number 232OPSDA1397 Manual