文件名称:mbus
介绍说明--下载内容均来自于网络,请自行研究使用
modbus
Public Sub Build_Request()
Dim CRCWord As Long
ReqLen = 0
With Main
Slave Address
.Request.Text = .Slave_Addr_Hex.Text + " "
RequestStr(ReqLen) = Val("&H" + .Slave_Addr_Hex.Text)
ReqLen = ReqLen + 1
Function Code
.Request.Text = .Request.Text + FC$ + " "
RequestStr(ReqLen) = Val("&H" + FC$)
ReqLen = ReqLen + 1
Data Address
Temp = Val("&H" + .Hex_Data_Address.Text)
If Temp < 0 Then Temp = Temp + 65536
RequestStr(ReqLen) = Int(Temp / 256) High Byte
.Request.Text = .Request.Text + Hex$(RequestStr(ReqLen)) + " "
ReqLen = ReqLen + 1
RequestStr(ReqLen) = ((Temp / 256) - Int(Temp / 256)) * 256 Low Byte
.Request.Text = .Request.Text + Hex$(RequestStr(ReqLen)) + " "
ReqLen = ReqLen + 1
-modbus
Public Sub Build_Request()
Dim CRCWord As Long
ReqLen = 0
With Main
Slave Address
.Request.Text = .Slave_Addr_Hex.Text + " "
RequestStr(ReqLen) = Val("&H" + .Slave_Addr_Hex.Text)
ReqLen = ReqLen + 1
Function Code
.Request.Text = .Request.Text + FC$ + " "
RequestStr(ReqLen) = Val("&H" + FC$)
ReqLen = ReqLen + 1
Data Address
Temp = Val("&H" + .Hex_Data_Address.Text)
If Temp < 0 Then Temp = Temp + 65536
RequestStr(ReqLen) = Int(Temp / 256) High Byte
.Request.Text = .Request.Text + Hex$(RequestStr(ReqLen)) + " "
ReqLen = ReqLen + 1
RequestStr(ReqLen) = ((Temp / 256) - Int(Temp / 256)) * 256 Low Byte
.Request.Text = .Request.Text + Hex$(RequestStr(ReqLen)) + " "
ReqLen = ReqLen + 1
Public Sub Build_Request()
Dim CRCWord As Long
ReqLen = 0
With Main
Slave Address
.Request.Text = .Slave_Addr_Hex.Text + " "
RequestStr(ReqLen) = Val("&H" + .Slave_Addr_Hex.Text)
ReqLen = ReqLen + 1
Function Code
.Request.Text = .Request.Text + FC$ + " "
RequestStr(ReqLen) = Val("&H" + FC$)
ReqLen = ReqLen + 1
Data Address
Temp = Val("&H" + .Hex_Data_Address.Text)
If Temp < 0 Then Temp = Temp + 65536
RequestStr(ReqLen) = Int(Temp / 256) High Byte
.Request.Text = .Request.Text + Hex$(RequestStr(ReqLen)) + " "
ReqLen = ReqLen + 1
RequestStr(ReqLen) = ((Temp / 256) - Int(Temp / 256)) * 256 Low Byte
.Request.Text = .Request.Text + Hex$(RequestStr(ReqLen)) + " "
ReqLen = ReqLen + 1
-modbus
Public Sub Build_Request()
Dim CRCWord As Long
ReqLen = 0
With Main
Slave Address
.Request.Text = .Slave_Addr_Hex.Text + " "
RequestStr(ReqLen) = Val("&H" + .Slave_Addr_Hex.Text)
ReqLen = ReqLen + 1
Function Code
.Request.Text = .Request.Text + FC$ + " "
RequestStr(ReqLen) = Val("&H" + FC$)
ReqLen = ReqLen + 1
Data Address
Temp = Val("&H" + .Hex_Data_Address.Text)
If Temp < 0 Then Temp = Temp + 65536
RequestStr(ReqLen) = Int(Temp / 256) High Byte
.Request.Text = .Request.Text + Hex$(RequestStr(ReqLen)) + " "
ReqLen = ReqLen + 1
RequestStr(ReqLen) = ((Temp / 256) - Int(Temp / 256)) * 256 Low Byte
.Request.Text = .Request.Text + Hex$(RequestStr(ReqLen)) + " "
ReqLen = ReqLen + 1
(系统自动生成,下载前可以参看下载内容)
下载文件列表
mbus.txt