beautypg.com

7000w31.dll for windows 3.1, Open_com, Close_com – Measurement Computing CB-NAP-7000P User Manual

Page 28

background image

24

6 7000W31.DLL for Windows 3.1

6.1 Open_Com

Description:

This DLL will initialize the COM port. This DLL must be called once before the other DLLs are called to

send/receive command.
z Syntax:

WORD Open_Com(char cPort, DWORD dwBaudRate, char cData, char cParity, char cStop)

z Input Parameter:

cPort: 1=COM1, 2=COM2, 3=COM3, 4=COM4, others = invalidate
dwBaudRate: 1200/2400/4800/9600/19200/38400/57600/115200
cData: 5/6/7/8 data bit
cParity: 0=NonParity, 1=OddParity, 2=EvenParity
cStop: 0=1-stop, 1=1.5-stp, 2=2-stop

NOTE: cData=8, cParity=0, cStop=0 for CB-7000 modules

z Return Value:

NoError = OK
others = Error code, refer to 7000W31.H

6.2 Close_Com

Description:

This DLL will free all the resources used by Open_Com. This DLL must be called before the program exit. The

Open_Com will return error message if the program exit without calling Close_Com function.
z Syntax:

WORD Close_Com(char cPort)

z Input Parameter:

cPort : 1=COM1, 2=COM2, 3=COM3, 4=COM4, others = invalidate

z Return Value:

NoError = OK
others = Error code, refer to 7000W31.H
z Demo Program: