B&B Electronics manual B232OPSDASetDigitalOutput, Returns, DeinitComPort Purpose, See Also

Page 22

B232OPSDA_SetDigitalOutput

Purpose: This function sets the states of the digital output lines.

Syntax:

C:

BOOL B232OPSDA_SetDigitalOutput (WORD

 

 

 

 

hComDev, BYTE modAddr, WORD lines, WORD

 

 

states);

 

Pascal:

function B232OPSDA_ReadDigitalOutput

 

 

(hComDev : word; modAddr : byte; lines :

 

 

word; states : word);

 

BASIC:

FUNCTION B232OPSDAReadDigitalOutput

 

 

(BYVAL hComDev AS INTEGER, BYVAL modAddr

 

 

AS INTEGER, BYVAL lines AS INTEGER, BYVAL

 

 

states 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 232OPSDA module.

 

lines is a bit mask of the digital outputs to change. This

 

will always be 01H (1 decimal) of the 232OPSDA,

 

because it only has one digital output line. states is the

 

new state of the digital outputs specified in lines. This

 

can be either zero for OFF or non-zero for ON.

Returns:

FALSE (zero) if the function fails, otherwise it returns

 

TRUE (non-zero).

deinitComPort

Purpose:

Removes the serial communications port driver.

Syntax:

C:

void deinitComPort (WORD hComDev);

 

 

 

Pascal:

procedure deinitComPort (hComDev : word);

 

BASIC:

sub deinitComPort (BYVAL hComDev AS

 

 

INTEGER);

Remarks:

This function must be called after a serial

 

communications port is installed with initComPort to

 

remove the interrupt service routine that it installs.

Returns:

Nothing.

 

See Also:

initComPort

initComPort

Purpose: Installs a serial communications port driver.

Documentation Number 232OPSDA1397 Manual

21

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

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

Image 22
Contents Designed and Manufactured Ottawa, Illinois Electronics Mfg. Co. IncInternet Table of Contents Page 232OPSDA Features IntroductionGeneral Block Diagram Packing List232OPSDA Specifications Software InstallationAnalog to Digital Converter Digital Output Power SupplyDigital Input CommunicationsConnections Terminal Function Description Block232OPSDA Digital I/O Connections Serial Port Connections232OPSDA Power Supply Connections Commands Syntax Reading A/D Channels Command 0RD Reading Digital I/O CommandSet Digital Output Command StatesNon-buffered 0 to 5VDC A/D Inputs Sampling RateConverter Range Buffered 0 to 5V A/D InputsTo 10VDC A/D Input 20mA Current Loop A/D InputGain = Application Program Interface B232OPSDAReadDigital Syntax CDeinitComPort Purpose B232OPSDASetDigitalOutputReturns See AlsoReturns See Also Low-Level CommunicationsPort Address DeinitComPortPrint #1, Command$ Read A/D CommandCommand$ = !0RA + CHR$channel MSB$ = INPUT$1, #1 LSB$ = INPUT$1, #1Read Digital I/O Command States = ASCReply$ Command$ = !0RDReply$ = INPUT$ 1, #1 Status = states and mask‘ Set Output High states = states or mask Command$ = !0SO + CHR$statesSet Digital Output State States = states and NOTmaskAppendix a Decimal to Hex to Ascii Conversion Decimal to HEX to Ascii Conversion Table