关于数据采集器 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
...全文
78 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
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

5,928

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧