
Chapter 4
Basic Programming Techniques
4-16
Within MMS, you must define a variable so that application programs can
access it. The DEFVAR command defines MMS named variables in a
VMD. Refer to the section titled What You Should Know Before You
Program, earlier in this chapter, for guidelines on using MMS named
variables.
The DEFVAR command has the following syntax:
DEFVAR <connection><remote_symbol> TO <remote_address>
The following table defines each part of the DEFVAR command line.
This:
Is:
DEFVAR
the command that defines MMS named variables in a VMD. You can
abbreviate to three characters, upper or lower case. Leave at least one space
between each field in the command line.
<connection>
the communication link established between two points. You label
connections using the connection symbol :C followed by an integer from 1 to
9999).
<remote_symbol>
the name you are assigning to the remote address. This must be in single
quotes and directly follow the connection identifier with no spaces between
them.
TO
the qualifier that specifies the location of the address for which you are
defining a variable. You can abbreviate as T and use upper or lower case
letters.
<remote_address>
the address you are assigning to the name. This must be in double quotes.
For example:
DEFVAR :C21’PAINT_STATION_1’ TO ”T4:15”
the command
the connection identifier
followed by the number 21
the remote symbol
in single quotes
a qualifier
the remote address in
double quotes
Here are more examples of using the DEFVAR command:
def :c66’remote_robot_13’ t ”T4:22”
DEFV :C5’MACHINE_7’ TO ”T4:9”
You can also define an MMS named variable in your OSI coprocessor that
represents and address in your PLC–5 processor. You use the DEFVAR
command with connection zero.
For example:
DEFVAR :C0’MY_VARIABLE’ TO ”T4:4,10”
Defining MMS Named
Variables (The DEFVAR
Command)
Содержание 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...