Fuji Electric PXG-9 Communication Instruction Manual page 72

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

Advertisement

' Creating the Send Command ******************************************************************
Select Case Area
Case 3
ReDim Txdat(7) As Byte
Txdat(0) = Stno
Txdat(1) = &H4
Txdat(2) = Adrsh
Txdat(3) = Adrsl
Txdat(4) = &H0
Txdat(5) = &H2
Txsu = 5
Case 4
ReDim Txdat(7) As Byte
Txdat(0) = Stno
Txdat(1) = &H3
Txdat(2) = Adrsh
Txdat(3) = Adrsl
Txdat(4) = &H0
Txdat(5) = &H2
Txsu = 5
Case Else
Chapter
MSComm1.PortOpen = False
8
TX1.Enabled = True
Exit Sub
End Select
' Sending the command.************************************************************************
' Creating CRC for Send Data
GoSub 10000
Txdat(Txsu + 1) = CRC1
Txdat(Txsu + 2) = CRC2
' Send the created command.
MSComm1.Output = Txdat' Send one byte
' Wait until all of the response data is sent.
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
If ((Start + PauseTime) - Timer) > PauseTime Then
Start = Timer
End If
Loop
' Secured 8-byte array
' Station No.
' Command
' High address
' Low address
' Read no. words (High)
' Read no. of words (Low)
' No. of sent data
' Secured 8-byte array
' Station No.
' Command
' High address
' Low address
' Read no. of words (High)
' Read no. of words (Low)
' No. of sent data
' For other values
' COM port close
' CRC computation
'
'
' Saves the waiting start time.
' Has the set time passed?
' Passes control to other processes.
– 70 –

Hide quick links:

Advertisement

Chapters

Table of Contents
loading

This manual is also suitable for:

Pxg-5Pxg-4

Table of Contents