Omron CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 Reference Manual page 161

Script language
Table of Contents

Advertisement

APPENDIX B – CX-Server Communications Control
Example
Dim NewDate
NewDate = CXServer.ClockRead("PLC1")
' dates can be manipulated via standard VBScript methods (FormatDateTime, DatePart etc.)
TextBox1 = NewDate
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)
Page 148
' this uses a Microsoft Forms Text Box to convert date to string
OMRON
Revision 2.0

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CX-SUPERVISOR - SCRIPT REFERENCE REV2.0 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Cx-supervisor 2.0

Table of Contents