Previous | Contents | Index |
Use the BASEstar Classic read data and write data functions to read data from and write data to a specific address in device storage. Address syntax is common for all MMS compliant devices and allows access to both "Named" and "Unnamed" MMS variables. An MMS variable is a typed virtual object that represents an access path to a location on the device ("real" variable).
The Named Variable object describes access to the real variable using an application process determined name. It may be used to describe a computed variable or a real variable whose fixed address is not public.
The Unnamed Variable object describes access to the real variable using a device-specific address. It requires a known, fixed address for the real variable.
Table 3-1 shows the syntax for configuring named and unnamed variable objects.
BASEstar Classic Data Address | OMNI Address |
---|---|
"XXX" | Named variable "XXX" |
"N\XXX" | Named variable "XXX" |
"U\YYY" | Unnamed variable at unconstrained address "YYY" |
"S\YYY" | Unnamed variable at symbolic address "YYY" |
"X\YYY" | Unnamed variable at numeric address "YYY" 1 |
"M\YYY" | Message named "YYY" 2 |
"MX\YYY" | Message named "YYY" - message exchange is performed 2. |
"MW\YYY" | Message named "YYY" - message send is performed 2. |
It is possible to access a variable defined on a domain. To access the named variable "ZZZ" defined on the domain "DDD" the DCM address "DDD.ZZZ" (or "N\DDD.ZZZ") must be used.
When defining messages (M\ syntax) the "YYY" portion of the address must always be identical for a particular VMD since OMNI software only allows one message to be defined for a particular VMD. Note that the DAS always creates a remote VMD for each device and may also create a local VMD for that device. Message names for the local and remote VMD may be different. |
The address of a physical point defined in DCM is used by the DAS as the name of the variable when defining the variable to OMNI software. The variable is created in OMNI software when the associated device is enabled. Subsequent variable accesses use the existing variable that was created.
Variables created in OMNI software are not deleted, so a variable remains defined to OMNI software until BASEstar Classic is shut down and restarted. For this reason, deleting a phypoint and creating it using a different format, but the same address, will result in erroneous and unpredictable results because the variable will be read using the original format and data will be returned to DCM using the modified format.
Table 3-2 shows supported data type formats for the DAS for OMNI software.
DCM Data Type | OMNI Data Type | MMS Data Type |
---|---|---|
BIT | Boolean | Boolean |
[S_]BYTE | Signed Integer 8 | Signed Integer 8 |
[S_]WORD | Signed Integer 16 | Signed Integer 16 |
[S_]LONGWORD | Signed Integer 32 | Signed Integer 32 |
U_BYTE | Unsigned Integer 8 | Unsigned Integer 8 |
U_WORD | Unsigned Integer 16 | Unsigned Integer 16 |
U_LONGWORD | Unsigned Integer 32 | Unsigned Integer 32 |
F_FLOATING | F-float | Floating Point |
ARRAY[xx]:BIT | Bit String | Bit String |
STRING:xx | Word Counted String | Octet String |
ARRAY[xx]:format | Array | Array |
STRUCTURE | Structure 1 | Structure |
In addition to the above supported mappings, additional mappings are possible by specifying a postfix operator on the BASEstar Classic physical point address. The postfix operator and the conversion performed is described in Table 3-3.
Postfix Value | OMNI Data Type | MMS Data Type |
---|---|---|
\B | Boolean 1 | Boolean |
\O | Word Counted String 2 | Octet String |
\V | Null Terminated String 3 | Visible String |
\A | Array 4 | Array |
Postfix operators are not allowed for message physical points since for messages, no interpretation of the data is done by the DAS.
Example 3-3 shows an example of the information displayed after issuing the READ DATA command.
Example 3-3 Read Data Screen |
---|
DCM> read phy X/dev = TEST_PLC Point : X Device : TEST_PLC Address : n\X Format : S_LONGWORD Data: 0 : 2 DCM> |
Example 3-4 provides an example of the information displayed after issuing the READ DATA command when using data array.
Example 3-4 Read Data Screen with Data Array |
---|
DCM> read phy A/dev = TEST_PLC Point : A Device : TEST_PLC Address : n\A Format : ARRAY[3]:U_BYTE Data: 0 : 2 1 : 4 2 : 6 DCM> |
Example 3-5 shows an example of the information displayed after issuing the WRITE DATA command.
Example 3-5 Write Data Screen |
---|
DCM> write phy X/dev = TEST_PLC Point : X Device : TEST_PLC Address : n\X Format : S_LONGWORD Data value 0 : 2 DCM> |
Example 3-6 shows an example of the information displayed after issuing the WRITE DATA command using a data array.
Example 3-6 Write Data Screen with Data Array |
---|
DCM> write phy A/dev = TEST_PLC Point : A Device : TEST_PLC Address : n\A Format : ARRAY[3]:U_BYTE Data value 0 : 2 Data value 1 : 4 Data value 2 : 6 DCM> |
Previous | Next | Contents | Index |