# BASEstartm Classic DAS
for OMNItm Software
Installation and User's Guide

Previous | Contents | Index

## 3.2.3 Read and Write Data Functions

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.

Table 3-1 Supported Data Addressing
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.

1"YYY" must be a decimal number.
2"Messages are supported in addresses for SINEC-AP only.

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.

Note 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.

Table 3-2 Supported Data Types
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

1The maximum number of fields that can be specified in a structure is limited. The exact number of fields allowed is determined by the size of the fields, so is not an exact number. The DAS will return ILAN$_PEINVFMT if the maximum number of fields has been exceeded.

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.

Table 3-3 Supported Address Postfix Values
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

1This form allows a boolean array to be used rather than a bit string.
2BASEstar Classic word and longword values are byte swapped before the values are returned to the user.
3The BASEstar Classic data type must be STRING:xx. Visible Strings cannot be used as array elements.
4Normally a variable defined as a structure in BASEstar Classic must be matched by a variable defined as a structure in the remote VMD. If this qualifier is used, the BASEstar Classic structure is simplified as much as possible. If the structure can be simplified to an array, then an array data type is used when defining the variable to OMNI software.

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