OMRON
APPENDIX B – CX-Server Communications Control
Revision 2.0
Page 143
Each ‘Value’ function above will access data in the PLC called ‘MyPLC’.
Note:
If there is only 1 PLC in the project then it is not necessary to call the ‘SetDefaultPLC’
function. The first PLC in a project will automatically be set as the default PLC.
OpenPLC
Opens a PLC for communications. If no PLC is specified then the default PLC is opened.
Example 1:
CXServer.SetDefaultPLC(“MyPLC”)
CXServer.OpenPLC()
CXServer.DM(100) = 10
CXServer.DM(50) = 10
Example 2:
CXServer.OpenPLC(“MyPLC”)
CXServer.DM(100) = 10
ClosePLC
Closes a previously opened PLC. If no PLC is specified then the default PLC is closed.
Example:
CXServer.ClosePLC(“MyPLC”)
Read
Function to read the value of a PLC point.
Example of synchronous Read
intVal = CXServer.Read(“MyPLC”, “MyPoint”, 0)
In this example, the Point ‘MyPoint’ will be read from the PLC ‘MyPLC’ and stored in ‘intVal’. The
script will wait for the read operation to complete before continuing to execute the next line due to
the ‘0’ parameter. This is identical to the operation of the ‘Value’ method.
Note:
If the PLC is not open, then this command will cause it to be opened, and then closed after the
read is complete. If more than one read or write operation is to be performed, it is
considerably
faster and more efficient to use the OpenPLC command first, do all the reading and writing, and then
(if required) use the ClosePLC command to close the PLC.
Write
Function to write the value of a PLC point.
Example of synchronous write:
CXServer.Write(“MyPLC”, “MyPoint”, NewValue, 0)
Содержание 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...