APPENDIX B – CX-Server Communications Control
OMRON
Page 148
Revision 2.0
Example
Dim NewDate
NewDate = CXServer.ClockRead("PLC1")
‘ dates can be manipulated via standard VBScript methods (FormatDateTime, DatePart etc.)
TextBox1 = NewDate ‘ this uses a Microsoft Forms Text Box to convert date to string
TextPoint1 = TextBox1 ‘this writes the date string to a CX-Supervisor text point
ClockWrite
Function that sets the PLC clock. The expected format for the date is “dd/mm/yyyy hh:mm:ss”.
Example
Dim NewDate
'set time/date value here using standard VBScript methods (Date, Time, Now, CDate etc.)
NewDate = Now ‘ This example sets the time to the current PC time
CXServer.ClockWrite "PLC1", NewDate
RawFINS
This function enables raw FINS commands to be sent to a specified PLC.
This function is for
advanced users familiar with the Omron FINS protocol only
.
VBScript Example
Dim sFINS
Dim sResponse
sFINS = "0501"
sResponse = CXServer.RawFINS(sFins, sPLC)
txtFINSResponse = sResponse ‘txtFINSResponse is a CX-Supervisor point.
Active
Returns the connection status of a specified PLC.
VBScript Example
bActive = CXServer.Active(“MyPLC”) ‘ bActive is a CX-Supervisor point
In this example, the connected status would be read from ‘MyPLC’ and stored in CX-Supervisor
point ‘bActive’. If ‘MyPLC’ is connected ‘bActive’ would be set to True.
TCGetStatus
Return status data for the specified temperature controller.
Example
Dim bTCStatusResponse
bTCStatusResponse = CXServer.TCGetStatus("E5AK")
‘Heating output is bTCStatusResponse(21)
Содержание CX-SUPERVISOR - SCRIPT REFERENCE REV2.0
Страница 2: ...CX Supervisor Script Language Software Revision 2 0...
Страница 3: ......
Страница 5: ...CX Supervisor Script Language OMRON Page ii Revision 2 0...
Страница 7: ...CX Supervisor Script Language OMRON Page iv Revision 2 0...
Страница 9: ...CX Supervisor Script Language OMRON Page vi Revision 2 0...
Страница 13: ......
Страница 15: ...CHAPTER 1 Introduction OMRON Page 2 Revision 2 0...
Страница 19: ...CHAPTER 2 Expressions OMRON Page 6 Revision 2 0...
Страница 21: ...CHAPTER 3 Scripts OMRON Page 8 Revision 2 0...
Страница 151: ...CHAPTER 8 Colour Palette OMRON Page 138 Revision 2 0...