关于数据采集器 casio dt900 串口通讯问题

l9j9j9 2004-05-05 01:16:22
有哪位高手 懂得调用hostcm32.dll里面函数的顺序问题,我的程序总接收不到信号
怎么办?



Private Type INITTBL
speed As Long
length As Long
parity As Long
sbit As Long
ptout As Long
ctout As Long
cretry As Long
stopkey1 As Long
stopkey2 As Long

End Type

Private Type cinftbl
htid(6) As String
htdmy(2) As String
adv As Long
fileno As Long
filesize As Long
jobcmd As Long
datatype As Long
End Type

Private Declare Function hst_idtblclr Lib "G:\test\hostcm\hostcm32999.dll" () As Integer
Private Declare Function hst_idtbladd Lib "G:\test\hostcm\hostcm32999.dll" (ByVal iddata As String) As Integer
Private Declare Function hst_open Lib "G:\test\hostcm\hostcm32999.dll" (ByVal chno As Long, initab As INITTBL) As Integer
Private Declare Function hst_close Lib "G:\test\hostcm\hostcm32999.dll" () As Integer
Private Declare Function hst_polling Lib "G:\test\hostcm\hostcm32999.dll" (recno As Long, ByVal ioboxno As Long) As Integer
Private Declare Function hst_idtblgetidno Lib "G:\test\hostcm\hostcm32999.dll" () As Integer
Private Declare Function hst_getcinffirst Lib "G:\test\hostcm\hostcm32999.dll" (inftab As cinftbl) As Integer
Private Declare Function hst_getcinfnext Lib "G:\test\hostcm\hostcm32999.dll" (inftab As cinftbl) As Integer
Private Declare Function hst_filerecv Lib "G:\test\hostcm\hostcm32999.dll" (ByVal pname As String, inftab As cinftbl) As Integer
Private Declare Function hst_filesend Lib "G:\test\hostcm\hostcm32999.dll" (ByVal pname As String, inftab As cinftbl) As Integer
Private Declare Function hst_disconnect Lib "G:\test\hostcm\hostcm32999.dll" (ByVal mode As Long, inftab As cinftbl) As Integer
Private Declare Function hst_idtblgetid Lib "G:\test\hostcm\hostcm32999.dll" (ByVal recno As Long, ByVal iddata As String) As Integer

Private Declare Function hst_sethwnd Lib "G:\test\hostcm\hostcm32999.dll" (a As Long, ByVal recno As Long) As Integer
Private Declare Function hst_getcomfname Lib "G:\test\hostcm\hostcm32999.dll" (a As Long) As String
Private Declare Function hst_geterrinf Lib "G:\test\hostcm\hostcm32999.dll" () As String
Private Declare Function hst_stopreq Lib "G:\test\hostcm\hostcm32999.dll" () As Integer


Private Sub Command1_Click()
Dim a As INITTBL
Dim aa As INITTBL

Dim b As cinftbl
Dim v As Long
Dim abc As String
a.cretry = 2
a.ctout = 1000
a.ptout = 100
a.length = 0
a.parity = 0

a.sbit = 1
a.stopkey1 = 0
a.stopkey2 = 0

a.speed = 7

'MsgBox hst_sethwnd(Form1.hWnd, 1)
'MsgBox hst_geterrinf()
' MsgBox hst_getcomfname(78)
'MsgBox hst_stopreq()

b.jobcmd = 0
b.datatype = 1
b.fileno = 1
b.filesize = 1024


b.adv = 2


v = hst_open(1, a)
'MsgBox hst_idtblclr()
'MsgBox hst_idtbladd("1")
'MsgBox hst_getcinffirst(b)
'MsgBox hst_getcinfnext(b)
v = hst_idtblclr
If hst_idtblgetidno <= 0 Then

v = hst_idtbladd("&&&&&&")

End If

v = 3
MsgBox v
MsgBox hst_polling(v, 3)
MsgBox v


v = hst_filerecv("dt900.txt", b)


v = hst_close()



End Sub
...全文
34 7 点赞 打赏 收藏 举报
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
l9j9j9 2004-05-06
怎么没人帮忙???急急!!!
  • 打赏
  • 举报
回复
l9j9j9 2004-05-06
有没有高手熟悉CASIO DT900 数据采集器的?
  • 打赏
  • 举报
回复
qizhanfeng 2004-05-06
up
学习
  • 打赏
  • 举报
回复
l9j9j9 2004-05-05
怎么没人帮忙???
  • 打赏
  • 举报
回复
l9j9j9 2004-05-05
没有demo 厂商每提供!!!!!
  • 打赏
  • 举报
回复
kaershaw 2004-05-05
看一下自带的demo呢!
  • 打赏
  • 举报
回复
l9j9j9 2004-05-05
up
  • 打赏
  • 举报
回复
相关推荐
发帖
Delphi
加入

4972

社区成员

Delphi 开发及应用
申请成为版主
帖子事件
创建了帖子
2004-05-05 01:16
社区公告
暂无公告