文件名称:VB与OMRON PLC通讯源码
介绍说明--下载内容均来自于网络,请自行研究使用
这是VB和欧姆龙通讯源码经典的例子, Lettura_Dm = False
ricez_ok = -1: timeout = False
trasm = "@00RD"
trasm = trasm + Right$(Str$(10000 + dm!), 4)
trasm = trasm + "0001"
trasm = trasm + bcc(trasm) + Chr$(42) + Chr$(13)
Omron!Comm1.Output = trasm
conta = 0
Do
conta = conta + 1
If conta > 1200 Then timeout = True: Exit Do
Loop Until Omron!Comm1.InBufferCount >= 15
a = Omron!Comm1.Input
If Not timeout Then
fcs = Mid$(a, (Len(a) - 3), 2)
trasm = Left$(a, (Len(a) - 4))
If fcs <> bcc(trasm) Then
timeout = -1
Exit Function
End If
valore = Mid$(a, 8, 4)
V = Val("&H" + valore)
Lettura_Dm = True
End If
ricez_ok = 0
Omron!Comm1.InBufferCount = 0
End Function(This is a VB to omron Lettura_Dm = False
ricez_ok = -1: timeout = False
trasm = "@00RD"
trasm = trasm + Right$(Str$(10000 + dm!), 4)
trasm = trasm + "0001"
trasm = trasm + bcc(trasm) + Chr$(42) + Chr$(13)
Omron!Comm1.Output = trasm
conta = 0
Do
conta = conta + 1
If conta > 1200 Then timeout = True: Exit Do
Loop Until Omron!Comm1.InBufferCount >= 15
a = Omron!Comm1.Input
If Not timeout Then
fcs = Mid$(a, (Len(a) - 3), 2)
trasm = Left$(a, (Len(a) - 4))
If fcs <> bcc(trasm) Then
timeout = -1
Exit Function
End If
valore = Mid$(a, 8, 4)
V = Val("&H" + valore)
Lettura_Dm = True
End If
ricez_ok = 0
Omron!Comm1.InBufferCount = 0
End Function)
ricez_ok = -1: timeout = False
trasm = "@00RD"
trasm = trasm + Right$(Str$(10000 + dm!), 4)
trasm = trasm + "0001"
trasm = trasm + bcc(trasm) + Chr$(42) + Chr$(13)
Omron!Comm1.Output = trasm
conta = 0
Do
conta = conta + 1
If conta > 1200 Then timeout = True: Exit Do
Loop Until Omron!Comm1.InBufferCount >= 15
a = Omron!Comm1.Input
If Not timeout Then
fcs = Mid$(a, (Len(a) - 3), 2)
trasm = Left$(a, (Len(a) - 4))
If fcs <> bcc(trasm) Then
timeout = -1
Exit Function
End If
valore = Mid$(a, 8, 4)
V = Val("&H" + valore)
Lettura_Dm = True
End If
ricez_ok = 0
Omron!Comm1.InBufferCount = 0
End Function(This is a VB to omron Lettura_Dm = False
ricez_ok = -1: timeout = False
trasm = "@00RD"
trasm = trasm + Right$(Str$(10000 + dm!), 4)
trasm = trasm + "0001"
trasm = trasm + bcc(trasm) + Chr$(42) + Chr$(13)
Omron!Comm1.Output = trasm
conta = 0
Do
conta = conta + 1
If conta > 1200 Then timeout = True: Exit Do
Loop Until Omron!Comm1.InBufferCount >= 15
a = Omron!Comm1.Input
If Not timeout Then
fcs = Mid$(a, (Len(a) - 3), 2)
trasm = Left$(a, (Len(a) - 4))
If fcs <> bcc(trasm) Then
timeout = -1
Exit Function
End If
valore = Mid$(a, 8, 4)
V = Val("&H" + valore)
Lettura_Dm = True
End If
ricez_ok = 0
Omron!Comm1.InBufferCount = 0
End Function)
相关搜索: VB与欧姆龙PLC通讯源码
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
OMRON PLC通讯源码\MSSCCPRJ.SCC | 190 | 2007-05-09 |
OMRON PLC通讯源码\Omron.bas | 2446 | 1999-04-08 |
OMRON PLC通讯源码\Omron.frm | 6071 | 1999-04-08 |
OMRON PLC通讯源码\Omron.vbp | 592 | 1999-04-08 |
OMRON PLC通讯源码\Omron.vbw | 86 | 2007-05-09 |
OMRON PLC通讯源码 | 0 | 2007-05-09 |