[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