Delphi cctalk protocol to implement a coin acceptor
I want to integrate a coin acceptor into my Delphi 7 Application. This specific coin acceptor uses the ccTalk protocol.
I've been looking for a ccTalk library which I can use from delphi.
Any of you guys know of any ccTalk libraries out there? Thanks
I think I must use a comport component, here some code
procedure TForm1.Button_OpenClick(Sender: TObject);
begin
try
if ComPort.Connected then
ComPort.Close
else
ComPort.Open;
except
ShowMessage('Connection error !');
exit;
end;
end;
procedure TForm1.Button_SettingsClick(Sender: TObject);
begin
ComPort.ShowSetupDialog;
end;
procedure TForm1.Button_SendClick(Sender: TObject);
var
Str: String;
begin
Str := Edit_Data.Text;
if NewLine_CB.Checked then
Str := Str + #13#10;
try
ComPort.WriteStr(Str);
except
ShowMessage('Comunication error !');
exit;
end;
end;
procedure TForm1.ComPortRxChar(Sender: TObject; Count: Integer);
var
Str: String;
begin
ComPort.ReadStr(Str, Count);
Memo.Text := Memo.Text + Str;
end;
If I call Button_SendClick with 开发者_开发知识库string "000 000 001 245 010" nothing happens ....
Here's the device protocol manual.
精彩评论