Fuji Electric PXG-9 Communication Instruction Manual page 75

Digtal controller micro controller x communication function (rs-485 modbus)
Hide thumbs Also See for PXG-9:
Table of Contents

Advertisement

■ Example of data writing
• Operation: Writes 2 word data of the set address.
• Function code to be used: 10H
• Number of write words: 2
-----------------------------------
'Write 2 words sample program
'Function code : 10H
'Number of words : 2
'-----------------------------------
Private Sub Write_command_Click()
Write_command.Enabled = False
' Communication Port Settings ****************************************************************
If Com5.Value = True Then
Comm_port = 5
ElseIf Com4.Value = True Then
Comm_port = 4
ElseIf Com3.Value = True Then
Comm_port = 3
ElseIf Com2.Value = True Then
Comm_port = 2
Else
Comm_port = 1
End If
If SPD192.Value = True Then
Comm_speed = "19200,"
ElseIf SPD96.Value = True Then
Comm_speed = "9600,"
Else
Comm_speed = "38400,"
End If
If Even1.Value = True Then
Comm_parity = "E,"
ElseIf Odd1.Value = True Then
Comm_parity = "O,"
Else
Comm_parity = "N,"
End If
PauseTime = 0.2
idx = 1
' Opening the Communication Port *************************************************************
MSComm1.CommPort = Comm_port
MSComm1.Settings = Comm_speed & Comm_parity & "8,1"
MSComm1.PortOpen = True
' COM5
' COM4
' COM3
' COM2
' COM1
' 19200bps
' 9600bps
' 38400bps
' Even parity
' Odd parity
' Parity none
' Sets the wait time. (0.2 sec)
' Com port
' Speed / Party / 8bit_Data / Stop_1bit
' Open com port
– 73 –
Chapter
8

Hide quick links:

Advertisement

Chapters

Table of Contents
loading

This manual is also suitable for:

Pxg-5Pxg-4

Table of Contents