beautypg.com

Send_cmd, Receive_cmd – Measurement Computing CB-NAP-7000P User Manual

Page 29

background image

25

6.3 Send_Cmd

Description:

This DLL will send a command string to CB-7000. If the wCheckSum=1, this DLL will automatically add the two

checksum bytes

to the input string. This DLL will add the [0x0D] to the end of the input command string, szCmd.

z Syntax:

WORD Send_Cmd(char cPort, char szCmd[], WORD wTimeOut, WORD wCheckSum)

z Input Parameter:

cPort: 1=COM1, 2=COM2, 3=COM3, 4=COM4, others = invalidate
szCmd: the starting address of the original command string (terminated with 0)
wTimeOut: constant for time-out control, unit = 1ms
wCheckSum: 0=DISABLE, 1=ENABLE

z Return Value:

NoError : OK

others = Error code, refer to 7000W31.H

6.4 Receive_Cmd

Description:

This DLL will receive a result string from CB-7000. If the wCheckSum=1, this DLL will automatically check the

two checksum bytes

of the result string. This DLL will check the result string terminator, 0x0D.

z Syntax:

WORD Receive_Cmd(char cPort, char szResult[], WORD wTimeOut, WORD wCheckSum)

z Input Parameter:

cPort: 1=COM1, 2=COM2, 3=COM3, 4=COM4, others = invalidate
szResult: the starting address of the result string (terminated with 0)
wTimeOut: constant for time-out control, unit = 1ms
wCheckSum: 0=DISABLE, 1=ENABLE

z Return Value:

NoError : OK

others = Error code, refer to 7000W31.H