EasyManua.ls Logo

Fuji Electric PXG-9 - Page 72

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

Related product manuals