求 卡西欧 DT-930 数据接收Delphi例子 300分 ( 积分: 200 )

  • 主题发起人 主题发起人 KingSoft
  • 开始时间 开始时间
K

KingSoft

Unregistered / Unconfirmed
GUEST, unregistred user!
在为个连锁店写个管理系统, 客户买来了 卡西欧 DT-930数据采集器(盘点机),
符机只带了个简单的通讯软件, 里面有个'hostcm32.dll'是利用这个DLL里的函数进行通讯的,想在系统里直接调用切不知要怎么做.delphiBBS里找到些相关的函数..切无从下手.
那位高手帮帮忙...教一下..要是能提供个能用的 Delphi例子..更好!300分
 
我有,不过需要用钱购买!联系QQ263508014
 
几年前有做过,盘点机盘库存.不难的,它有文本格式,你读过来分析即可.
QQ:360316346
 
如果用符机自带软件读出文本文件再读到自己系统里是可以.但我是想写在自己系统里.直接读到自己系统里.然后再分析
 
QQ:88483816
楼主我想跟和你交流交流
 
unit DLLInterface;

interface


Type
INITTBL = record
speed :LongInt;
length:LongInt;
parity:LongInt;
sbit :LongInt;
ptout :longInt;
ctout :longInt;
cretry:LongInt;
stopkey1:LongInt;
stopkey2:LongInt;
End;

Type
CINFTBL = record
htid :String[6];
htdmy:String[2];
dav :LongInt;
fileno : LongInt;
filesize :LongInt;
jobcmd :LongInt;
datatype :LongInt;
End;

function hst_open(chno:LongInt; var _inittbl:INITTBL):Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_idtblclr:Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_idtbladd(iddata:string):Integer cdecl {$IFDEF WIN32} stdcall {$EndIF};
//function hst_open(chno : LongInt; var _initab : INITTBL) : Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_close: Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_polling (var recno : LongInt; ioboxno : LongInt) : Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_idtblgetidno : Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_getcinffirst(var inftab : CINFTBL): Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_getcinfnext(var inftab : CINFTBL) : Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_filerecv(pname : String; var inftab : CINFTBL) : Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_filesend(pname : String; var inftab : CINFTBL) : Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_disconnect(mode : LongInt; var inftab : CINFTBL) : Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_idtblgetid(recno : LongInt; iddata : String) : Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
function hst_sethwnd(chno:LongInt; var recno:LongInt):Integer cdecl {$IFDEF WIN32} stdcall {$ENDIF};
var
_INITTBL:INITTBL;
_CINFTBL:CINFTBL;


implementation
function hst_open; external 'hostcm32.dll';
function hst_idtblclr; external 'hostcm32.dll';
function hst_idtbladd; external 'hostcm32.dll';
// function hst_open;external 'hostcm32.dll';
function hst_close;external 'hostcm32.dll';
function hst_polling;external 'hostcm32.dll';
function hst_idtblgetidno;external 'hostcm32.dll';
function hst_getcinffirst;external 'hostcm32.dll';
function hst_getcinfnext;external 'hostcm32.dll';
function hst_filerecv;external 'hostcm32.dll';
function hst_filesend;external 'hostcm32.dll';
function hst_disconnect;external 'hostcm32.dll';
function hst_idtblgetid;external 'hostcm32.dll';
function hst_sethwnd;external 'hostcm32.dll';


end.

unit pasMain;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation
uses DLLInterface;
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
a, b:Integer;
recno:LongInt;
begin
_INITTBL.speed := 4;
_INITTBL.length := 0;
_INITTBL.parity := 0;
_INITTBL.sbit := 1;
_INITTBL.ptout := 100;
_INITTBL.ctout := 1000;
_INITTBL.cretry := 99;
_INITTBL.stopkey1 := 2;
_INITTBL.stopkey2 := 0;

_CINFTBL.jobcmd := 0;
_CINFTBL.htid:='&&&&&&';


If hst_open(2,_INITTBL)<>0 Then
Begin
MessageBox(Handle,'端口打开失败!','系统提示',64);
Abort;
End;

recno := 0;
a:=hst_polling(recno,3);
Showmessage(inttostr(a));

hst_close();
end;

end.
 
上面是这段代码到了 hst_polling 这时老出现 -15 的错误..
-15 Error. Parameter is not correct.

有没有那个高手可以指点一下
在 VB 里直接 hst_polling(1,1) 就可以通过..可在D里就是不行
 
自行解决了..分还是要发的
 
多人接受答案了。
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部