
Chapter 5
Additional and Advanced
Programming Techniques
5-7
For example:
MOVE FR :C0’MY_VARIABLE’ TO ”B7:6”
As noted in the previous section, the placement of :C0 determines weather
you are reading or writing, but on connection zero reading and writing
data are essentially the same. You are reading/writing to/from the local
OSI coprocessor. With that in mind, we could have used the example
above as:
MOVE FR ’MY_VARIABLE’ TO :C0”B7:6”
If you use the optional CSTAT parameter when you open a connection, you
can later determine the status of that connection. You do this by checking
the value of a bit in the database (1 = open, 0 = closed).
The syntax for using CSTAT is:
OPEN <connection> to <AE name> CSTAT ’local_bit_address’
the optional parameter that allows you to
determine if the connection is open (1) or
closed (0).
The local address; this can be an MMS named variable
(in single quotes) or an address (in double quotes).
MUST be a single bit (boolean), refer to
Appendix A for more information on data types.
See Chapter 4 for details on the OPEN command.
How does CSTAT work?
When you use CSTAT in an OPEN command line, the OSI coprocessor
uses the specified bit in the PLC data table to report status for that
connection. When the coprocessor sends the initiate request to the remote
node, it sets the specified bit to zero:
If the connection:
Then:
is successfully made
the OSI coprocessor sets the bit to 1
is not made or is unsuccessful
the bit remains 0
is broken (by either the local or remote device)
the OSI coprocessor sets the bit to 0
You can query this bit in your rung ladder logic to determine the current
state of the connection.
Important: The OSI coprocessor writes to this bit only when there is a
change in the state of the connection. You must determine that nothing
else in the system is modifying the bit.
Obtaining Status on a
Connection (using CSTAT)
Содержание PLC-5 MAP/OSI
Страница 1: ...PLC 5 MAP OSI Software User Manual Cat No 1785 OSI AB Parts...
Страница 4: ...Table of Contents iii OSI Layer Management E 1...
Страница 57: ...Chapter 4 Basic Programming Techniques 4 7 For example B7 6 10 AB Parts...
Страница 91: ...Mapping MMS Data Types onto PLC 5 40 5 60 File Types Appendix A A 2 T ACC D 16 AB Parts...