
Chapter 5
Additional and Advanced
Programming Techniques
5-9
If you do not specify the data type, the default data type for the remote
address that you have entered is assumed. For example, the following
shows how to define the variable painter_6 for the BCD (binary coded
decimal) address type D11:7,2:
DEFVAR :C1’painter_6’ to ”D11:7,2”
The MMS named variable painter_6 will be associated with the BCD
address D11:7,2. Because we did not specify a data type here, the default
data type associated with the remote address D11:7,2 is assumed. In our
example we used a BCD address, which has a BCD default data type.
When information is written to or read from that address in the future, the
information will be in the BCD data type. We could have, however,
defined a different data type for that information.
If we had wanted the information at the remote BCD address D11:7,2 to be
in integer, we could use the DTYPE parameter to define it as such. For
example:
DEFVAR :C1’painter_6’ to ”D11:7,2” dt ”N7:0,2”
Notice that in the command line, we used the DTYPE parameter
(abbreviated as dt), directly followed by an integer address. The MMS
protocol knows that we are requesting the data type for information going
into and out of the address D11:7,2 be in integer form.
It is the type of data at the address you enter directly after the DTYPE
parameter that designates the data type. This address can be any valid
PLC–5 address string, but need not exist.
Why would you specify a data type?
If the remote address for which you are defining an MMS named variable
is of a type that is acceptable to your applications, you do not need to
worry about specifying a data type. However, if you know that you want
the information that goes to and from the remote address to be of a certain
data type that is different than that of the remote address, you can specify
that data type at the time you define the variable.
Another reason you may want to use the data type parameter is if you are
defining a variable in another vendor’s machine and you want to make sure
it will accept the data type you want to use. You specify the data type in
the DEFVAR command line and verify that the machine accepts that data
type (figure 5.1).
Содержание 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...