L
LSS
Unregistered / Unconfirmed
GUEST, unregistred user!
厂家仪器DLL调用方法:<br>short data_comm( char command,<br> int in_len,<br> unsigned char *_in,<br> int out_len,<br> unsigned char *_out,<br> int retlen,<br> char *status);<br>用于向串口发送接收数据<br><br>厂家给的VB例子:<br> Dim yInData(100) As Byte<br> Dim yOutData(100) As Byte<br> k = data_comm(1, 1, yInData(0), 0, yOutData(0), RetLen, status)<br><br>我的程序delphi:<br>...<br>function data_comm(command:integer;in_len:integer;_inchar;out_len:integer; _outchar;retlen:integer;status:char):integer;stdcall;external 'getdata.dll';<br>...<br>function ...<br>var<br>ret,buf_len:integer;<br>status: char;<br>Buffer: string;<br>Buf: string;<br>begin<br> ...<br> ret := data_comm(1, 1, pchar(buffer), 0, pchar(buf), buf_len, status );<br> ...<br>为何一执行时就出异常<br>