横河500接口函数
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
3.3 Available Functions (1)
int TmcInitialize( int wire, char* adr, int* id ); (1)
int TmcDeviceClear( int id ); (4)
int TmcSend( int id, char* msg ); (5)
int TmcSendByLength( int id, char* msg, int len ); (5)
int TmcSendSetup( int id ); (6)
int TmcSendOnly( int id, char* msg, int len, int end ); (7)
int TmcReceive( int id, char* buff, int blen, int* rlen ); (7)
int TmcReceiveSetup( int id ); (8)
int TmcReceiveOnly( int id, char* buff, int blen, int* rlen ); (9)
int TmcReceiveBlockHeader( int id, int* length ); (10)
int TmcReceiveBlockData( int id, char* buff, int blen, int* rlen, int* end ); (11)
int TmcCheckEnd( int id ); (12)
int TmcSetRen( int id, int flag ); (13)
int TmcGetLastError( int id ); (13)
int TmcSetTerm( int id, int eos, int eot ); (14)
int TmcSetTimeout( int id, int tmo ); (15)
int TmcFinish( int id ); (16)
int TmcSearchDevices( int wire, DEVICELIST* list, int max, int* num, char* option); (16)
int TmcEncodeSerialNumber(char* encode, size_t len, char* src); (17)
int TmcDecodeSerialNumber(char* decode, size_t len, char* src); (18)
int TmcWaitSRQ( int id, char* stsbyte, int tout); (19)
int TmcAbortWaitSRQ( int id); (19)
int TmcSetCallback(int id, Hndlr func, ULONG p1,ULONG p2); (20)
int TmcResetCallback(int id); (21)
typedef void SRQCALLBACK(int id, UCHAR stb, ULONG p1,ULONG p2); (21)
3.3 Available Functions
---------------------------------------------------------------------------------------------------------------
intTmcInitialize( int wire, char* adr, int* id );
Purpose: Initializes and opens a connection to the specified device
Parameters: intwire connection types
char* adr the address of the connection
int* id special device ID used by other functions
Return value: 0 = OK, 1 = ERROR
Details:
Description of Parameters
int wire
Set this parameter to the type of connection through which the device will be
controlled.
The settings for each type of interface are shown below.
GPIB: wire = TM_CTL_GPIB(1)
RS232: wire = TM_CTL_RS232(2)
USB: wire = TM_CTL_USB(3)
Ethernet: wire = TM_CTL_ETHER(4)
USBTMC(DL9000): wire = TM_CTL_USBTMC(5)
EthernetUDP: wire = TM_CTL_ETHERUDP(6)
USBTMC(excluding DL9000): wire = TM_CTL_ETHERUDP(7)
VXI-11: wire = TM_CTL_VXI11(8)
char* adr
Use a character string to set this parameter to the GPIB address or RS-232
settings of the device to be controlled.
The following shows how the settings for each interface.
GPIB: adr = "1"-"30" (the GPIB address value of the device)
RS232: adr = "port number, baud rate number, bit specification, handshaking number"
port number 1 = COM1
2 = COM2
3 = COM3
baud rate number 0 = 1200
1 = 2400
2 = 4800
3 = 9600
4 = 19200
5 = 38400
6 = 57600
bit specifications 0 = 8 bits, no parity, 1 stop bit
1 = 7 bits, even parity, 1 stop bit
2 = 7 bits, odd parity, 1 stop bit
handshaking number 0 = NO-NO
1 = XON-XON
2= CTS-RTS
USB: adr = "1"-"127" (the unique USB ID for the device)
Ethernet: adr = "server name, user name, password"
sever name The server name or IP address of the DL
user name The user name
password The password
When the user name is anonymous,
a password is not required.
(A delimiting comma "," is required.)
USBTMC(DL9000): adr = "serial number"