beautypg.com

Send_str, Send_receive_cmd – Measurement Computing CB-NAP-7000P User Manual

Page 14

background image

10

4.5 Send_Str


z Description:

This DLL will create a th read to send a command and receive the response-result from a g eneral purpose RS-232

device. The Send_Str is a multi-task, multi-thread DLL. This DLL is very similar to Send_Cmd except that this DLL will

not

add any char to the input string.

z Syntax:

WORD Send_Str(char cPort, char szCmd[], WORD wTimeOut, WORD wSendLen, WORD wReceiveLen)

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

wSendLen: string length of send-string

wReceiveLen: string length of receive-string

z Return Value:

NoError : OK

others = Error code, refer to I7000.H

4.6 Send_Receive_Cmd

Description:

This DLL will send a command t o CB-7000 and receive the response-result from CB-7000. If the wCheckSum=1,

this DLL will automatically add the two checksum bytes to the input string a nd check the checksum status of the receive
string. This DLL will add the [0x0D] to the end of the i nput string, szCmd. The Send_Receive_Cmd is not a multi-task
DLL.
z Syntax:

WORD Send_Receive_Cmd(char cPort, char szCmd[], char szResult[], WORD wTimeOut, WORD wCheckSum,

WORD *wT)

z Input Parameter:

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

z Return Value:

NoError : OK

others = Error code, refer to I7000.H