APPENDIX B – CX-Server Communications Control
OMRON
Page 146
Revision 2.0
Examples
bValid = CXServer.IsPointValid(“MyPoint”)
bValid = CXServer.IsPointValid(“MyPoint”, “MyPLC”)
In both examples, the boolean variable bValid is set True if the point “MyPoint” has been defined.
PLC Memory Functions
(A, AR, C, CIO, D, DM, DR, E, EM, -
G, GR, H, IR, LR, SR, ST, T, TC, TK, W)
All PLC memory functions (e.g. A, AR, D, DM etc.) work in exactly the same way. The following
examples use the DM function to get and set the value of a DM address in a PLC.
Example 1
intVal = CXServer.DM(100)
In this example, the contents of DM100 will be read from the PLC and stored in ‘intVal’.
Note:
These examples assume there is only 1 PLC in the CX-Server project file, or that the
‘SetDefaultPLC’ function has been used to select the required PLC. Refer to the
‘SetDefaultPLC’ function for details about using script with multiple PLCs in the
project.
Example 2
CXServer.DM(100) = 75
In this example, the value 75 will be written to DM100 in the PLC.
Bit addressing, that is accessing data from individual memory bits, is also supported by these memory
areas: IR, AR, HR and CIO.
Example 3
bVal = CXServer.IR(“100.2”)
In this example, the status of bit IR100.2 (i.e. bit 2 of IR100) will be read from the PLC and stored in
‘bVal’ (e.g. ‘bVal’ will be set to TRUE or FALSE).
Example 4
CXServer.IR(“100.2”) = True
In this example, bit IR100.2 (i.e. bit 2 of IR100) in the PLC will be set to True. Note that use of the
quotes is optional, but is required to differentiate between 100.1 and 100.10
ListPLCs
Holds a list of all PLC names configured in the project file. This property is read only.
Содержание 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...