EasyManua.ls Logo

Fuji Electric PXG-9 - Page 75

Fuji Electric PXG-9
84 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
– 73 –
8
Chapter
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 ' COM5
ElseIf Com4.Value = True Then
Comm_port = 4 ' COM4
ElseIf Com3.Value = True Then
Comm_port = 3 ' COM3
ElseIf Com2.Value = True Then
Comm_port = 2 ' COM2
Else
Comm_port = 1 ' COM1
End If
If SPD192.Value = True Then
Comm_speed = "19200," ' 19200bps
ElseIf SPD96.Value = True Then
Comm_speed = "9600," ' 9600bps
Else
Comm_speed = "38400," ' 38400bps
End If
If Even1.Value = True Then
Comm_parity = "E," ' Even parity
ElseIf Odd1.Value = True Then
Comm_parity = "O," ' Odd parity
Else
Comm_parity = "N," ' Parity none
End If
PauseTime = 0.2 ' Sets the wait time. (0.2 sec)
idx = 1
' Opening the Communication Port *************************************************************
MSComm1.CommPort = Comm_port ' Com port
MSComm1.Settings = Comm_speed & Comm_parity & "8,1" ' Speed / Party / 8bit_Data / Stop_1bit
MSComm1.PortOpen = True ' Open com port

Related product manuals