[VBA ]请问visual basic 2010如何跟delta plc通训

楼主: gecer (gecer)   2013-12-01 14:01:45
小弟初学 要开启M0
M0 address 是0800所以根据plc的datasheet 传送讯息为: 01 05 08 00 FF 00 F6 CR LF
小弟程式码如下
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim Port As String
SerialPort1.PortName = "COM6"
SerialPort1.BaudRate = 9600
SerialPort1.DataBits = 7
SerialPort1.Parity = IO.Ports.Parity.Even
SerialPort1.StopBits = 1
SerialPort1.Open()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
SerialPort1.WriteLine(":01050800FF00F6CRLF")
End Sub
End Class
不过plc没有反应 请问要如何修改程式 谢谢
作者: johnpage (johnpage)   2013-02-01 17:12:00
bin <> string

Links booklink

Contact Us: admin [ a t ] ucptt.com