beautypg.com

Burkert Type 8056 User Manual

Page 91

background image

- 91 -

RS232_485_ETP_MODBUS_BU_REV02.doc

"RS 232-485 converter and the PC command the RTS signal of the serial port for"

& vbCrLf

& _

"the trasmission of the data"

lblProcessData.Text =

""

SerialPort1.PortName =

"COM1"

SerialPort1.BaudRate = 9600


SerialPort1.DataBits = 8
SerialPort1.Parity = IO.Ports.Parity.None

SerialPort1.StopBits = IO.Ports.StopBits.One

SerialPort1.ReadBufferSize = 512
SerialPort1.WriteBufferSize = 512

SerialPort1.Encoding = System.Text.Encoding.Default


SerialPort1.Open()


SerialPort1.RtsEnable =

False

Application.DoEvents()


Threading.Thread.Sleep(500)


SerialPort1.DiscardInBuffer()
SerialPort1.DiscardOutBuffer()


'Command 3: Read process data

vfStrCommand = Chr(1) & Chr(3) & Chr(0) & Chr(0) & Chr(0) & Chr(38)

If

False

= fBolCalcCRC(vfStrCommand, vfStrCrc)

Then

Return

End

If

vfStrCommand = vfStrCommand & vfStrCrc

Me

.Show()

Application.DoEvents()



Do

TextBox2.Text =

""

SerialPort1.RtsEnable =

False

SerialPort1.Write(vfStrCommand)

Threading.Thread.Sleep(10)

SerialPort1.RtsEnable =

True

Application.DoEvents()

This manual is related to the following products: