产品介绍
3500/50
价 格:¥999
型 号:3500/50
产品完善度:
生产地:其他访问量:5次
发布日期:2017/8/17 11:59:19
更新日期:2017/8/17 11:59:19
详细内容
3500/50
3500/50
根据PC与FX系列PLC的传输应答过程,利用VB的MSComm控件可以编写如下通信程序实现PC与FX系列PLC之间的串行通信,以完成数据的读取。MSComm控件可以采用轮询或事件驱动的方法从端口获取数据。在这个例子中使用了轮询方法。
1)通信口初始化
Private Sub Initialize()
MSComm1.CommPort =1
MSComm1.Settings = “9600,E,7,1”
MSComm1.InBufferSize = 1024
MSComml.OutBuffersize = 1024
MSComm1.InputLen = 0
MSComml.InputMode = comInputText
MSComm1.Handshaking = comNone
MSComm1.PortOpen = True
End Sub
2)请求通信与确认
Private Function MakeHandshaking()As Boolean
Dim InPackage As String
MSComml.OutBufferCount = 0
MSComml.InBufferCount = 0
MSComml.OutPut = Chr(&H5)
Do
DoEvents
Loop Until MSComml.InBufferCount = 1
InPackage = MSComml.Input
If InPackage = Chr(&H6) Then
MakeHandShaking = True
Else
MakeHandshaking = False
End If
End Function
3)发送命令报文
Private Sub SendFrame ()
Dim Outstring As String
MSComml.OutBufferCount = 0
MSComml.InBufferCount = 0
Outstrin = Chr(&H2)+″on″+″10F604″+Chr(&H3)+″74″
MSComml.Output = Outstring
End Sub
4)读取应答报文
Private Sub ReceiveFrame()
Dim Instring As String
Do
DoEvents
Loop Until MSComml.InBufferCount = 12
InString = MSComml.Inpult
End Sub
ACCU-SORT BAR CODE SCANNER CONTROLLER 4800 *NEW*
T80119-1 CHASSIS MODULE TPC-5236
UTICOR PROGRAMMABLE MESSAGE DISPLAY 200 76536-3
MODICON TELEMECANIQUE SCHNEIDER LCD OPERATOR PANEL TCCX1730LW *METAL CASE*
ALLEN BRADLEY PanelView 600 OPERATOR INTERFACE PANEL 2711-K6C1 SER. A FRN 3.01
EPSON PANEL DISPLAY SCREEN EG4404S-FR
CINCINNATI MILACRON T10 OPERATOR PANEL 900 REV.A 3 531 4022A
ELSA TNT 2 VANTA BOARD 16ASP 111-630-300
ALLEN BRADLEY SER. F REV. J 4.2FRN PANELVIEW 550 2711-K5A5
UNKNOWN MFG * CIRCUIT BOARD * 400-032 REV 3A
JANCD * SVO2B CIRCUIT BOARD * DF9200414-A0
USON SET POINT LOGIC BOARD 20086 REV C
ABB CIRCUIT BOARD MODULE DSQC 237 1H YB560103-CF/1 2668 402-165
SIEMENS 24V, 2A POWER MODULE 148-1CA00-0XB0
T80037-3 PCB MODULE TPC-5239
BAILEY CONTROLS NETWORK 90 USER CONTROL KEYBOARD 6634967C1
MARPOSS E9066 INDUSTRIAL COMPUTER OPERATOR INTERFACE 866AQGAAGL *SCREEN #1*
YASKAWA ELECTRIC * ESCV-2 WPPC0037 BOARD * Y27A07131-1
FIBER OPTIONS FIBER OPTIC BOARD 3350A1-T-R/1BAP
FANUC ROBOTICS MD1/CRT UNIT OPERATOR INTERFACE A02B-0051-C012
HONEYWELL UDC5000 ULTRA-PRO TEMP CONTROLLER DC5064-0-1A00-2?00-00-011 *TABS8
ALLEN BRADLEY PanelView 600 OPERATOR PANEL 2711-K6C1 SER. A FRN 3.01 *PLASTIC 1*