BASEstartm Open DAS
for Modicon®
on Tru64tm UNIX®
Installation and User's Guide


Previous Contents Index

3.2.2 Read and Write Variable Functions

Use the read variable and write variable functions to read data from and write data to a specific address in device memory.

Table 3-2 lists the variable types supported by this DAS.

Table 3-2 Read and Write Variable Types
Variable Type Address Type Supported
UNNAMED_VARIABLE NUMERIC Yes
  SYMBOLIC No
  UNCONSTRAINED Yes 1
NAMED_VARIABLE   Yes 2


1Unconstrained addresses must be used for Modicon 584 and 984 extended addresses. Unconstrained addresses must also be used for Modicon 984 coil addresses of 010000 or higher to distinguish them from discrete input addresses.
2Named variables are not supported by the DAS, but they are used by BASEstar Open when accessing variables using the Device Manager Server. The BASEstar Open Device Manager Server converts named variables with an address type of UNCONSTRAINED to unnamed variables.

An UNNAMED_VARIABLE type describes a specific physical address on a VMD. This address has a predefined type based on the address. Variables of this type are an inherent part of the VMD architecture and are uniquely identified by their physical address.

An unnamed variable can be one of the following types:

A NAMED_VARIABLE type describes a variable on a device. Variables of this type are uniquely identified by their name.

Table 3-3 lists the read and write functions available through the BASEstar Open (CLI) and OMNI (API) interfaces.

Table 3-3 Read and Write Variable Interface Access
Interface Function Name
CLI GET VALUE UNNAMED_VARIABLE
  GET VALUE NAMED_VARIABLE
  PUT VALUE UNNAMED_VARIABLE
  PUT VALUE NAMED_VARIABLE
API omni_get_value
  omni_get_value_a
  omni_put_value
  omni_put_value_a

Example 3-1 shows examples of creating unnamed variables using the CREATE UNNAMED_VARIABLE command.

Example 3-1 UNNAMED_VARIABLE CREATE Command

BSTR> CREATE UNNAMED_VARIABLE mod_184.p1 \
      -DATATYPE INTEGER_16 \
      -ADDRESS "4001" \
      -ADDRTYPE NUMERIC
BSTR> CREATE UNNAMED_VARIABLE mod_384.p1 \
      -DATATYPE INTEGER_16 \
      -ADDRESS "4001" \
      -ADDRTYPE NUMERIC
BSTR> CREATE UNNAMED_VARIABLE mod_584.p1 \
      -DATATYPE BIT \
      -ADDRESS "1" \
      -ADDRTYPE NUMERIC
BSTR> CREATE ARRAY_DATATYPE WORD_ARRAY_10 \
      -DATATYPE INTEGER_16 \
      -SIZE 10
BSTR> CREATE UNNAMED_VARIABLE mod_584.p2 \
      -DATATYPE WORD_ARRAY_10 \
      -ADDRESS "40001" \
      -ADDRTYPE NUMERIC
BSTR> CREATE UNNAMED_VARIABLE mod_884.p1 \
      -DATATYPE BIT \
      -ADDRESS "10001" \
      -ADDRTYPE NUMERIC
BSTR> CREATE UNNAMED_VARIABLE mod_984.p1 \
      -DATATYPE INTEGER_16 \
      -ADDRESS "60001:1" \
      -ADDRTYPE UNCONSTRAINED
BSTR> CREATE UNNAMED_VARIABLE mod_984.p2 \
      -DATATYPE INTEGER_16 \
      -ADDRESS "40001" \
      -ADDRTYPE NUMERIC

Example 3-2 shows the information displayed when you enter the GET VALUE UNNAMED_VARIABLE command.

Example 3-2 UNNAMED_VARIABLE GET VALUE Output

BSTR> GET VALUE UNNAMED_VARIABLE mod_184.p1
20
BSTR> GET VALUE UNNAMED_VARIABLE mod_384.p1
10
BSTR> GET VALUE UNNAMED_VARIABLE mod_584.p1
0
BSTR> GET VALUE UNNAMED_VARIABLE mod_584.p2
array[10] of INTEGER_16 
  [ 0]: 0 
  [ 1]: 0 
  [ 2]: 0 
  [ 3]: 0 
  [ 4]: 0 
  [ 5]: 0 
  [ 6]: 0 
  [ 7]: 0 
  [ 8]: 0 
  [ 9]: 0
BSTR> GET VALUE UNNAMED_VARIABLE mod_884.p1
1
BSTR> GET VALUE UNNAMED_VARIABLE mod_984.p1
30
BSTR> GET VALUE UNNAMED_VARIABLE mod_984.p2
40

Example 3-3 shows the information displayed when you enter the PUT VALUE UNNAMED_VARIABLE command.

Example 3-3 UNNAMED_VARIABLE PUT VALUE Output

BSTR> PUT VALUE UNNAMED_VARIABLE mod_584.p1
(Bit) : 1
BSTR> PUT VALUE UNNAMED_VARIABLE mod_584.p2
array[10] of INTEGER_16 
  [ 0]: (Integer 16) : 1
  [ 1]: (Integer 16) : 2
  [ 2]: (Integer 16) : 3
  [ 3]: (Integer 16) : 4
  [ 4]: (Integer 16) : 5
  [ 5]: (Integer 16) : 6
  [ 6]: (Integer 16) : 7
  [ 7]: (Integer 16) : 8
  [ 8]: (Integer 16) : 9
  [ 9]: (Integer 16) : 10

3.2.3 Read and Write Data Point Functions

Use the read data point and write data point functions to read data from and write data to a device in a device independent way.

Table 3-4 lists the read and write data point functions available through the BASEstar Open (CLI) interface and BASEstar Open (API) interface.

Table 3-4 Read and Write Data Point Interface Access
Interface Function Name
CLI GET VALUE DATA_POINT
  PUT VALUE DATA_POINT
API bstr_data_point_get_value
  bstr_data_point_put_value

Example 3-4 shows examples of creating a device data point using the CREATE DEVICE_DATA_POINT command.

Example 3-4 DEVICE_DATA_POINT CREATE Command

BSTR> CREATE DEVICE_DATA_POINT /mod_584/p1 \
                    -DATATYPE BIT \
                    -UPDATE_POLICY SOLICITED \
                    -ACCESS_POLICY ALWAYS \
                    -DEVICE_ACCESS READ \
                    -VMD_NAME mod_584 \
                    -VAR_NAME p1 \
                    -VAR_CLASS UNNAMED
BSTR> CREATE DEVICE_DATA_POINT /mod_584/p2 \
                    -DATATYPE WORD_ARRAY_10 \
                    -UPDATE_POLICY SOLICITED \
                    -ACCESS_POLICY ALWAYS \
                    -DEVICE_ACCESS RDWR \
                    -VMD_NAME mod_584 \
                    -VAR_NAME p2 \
                    -VAR_CLASS UNNAMED
BSTR> CREATE DEVICE_DATA_POINT /mod_984/p1 \
                    -DATATYPE INTEGER_16 \
                    -UPDATE_POLICY SOLICITED \
                    -ACCESS_POLICY ALWAYS \
                    -DEVICE_ACCESS RDWR \
                    -VMD_NAME mod_984 \
                    -VAR_NAME p1 \
                    -VAR_CLASS UNNAMED
BSTR> CREATE DEVICE_DATA_POINT /mod_984/p2 \
                    -DATATYPE INTEGER_16 \
                    -UPDATE_POLICY SOLICITED \
                    -ACCESS_POLICY ALWAYS \
                    -DEVICE_ACCESS RDWR \
                    -VMD_NAME mod_984 \
                    -VAR_NAME p2 \
                    -VAR_CLASS UNNAMED

Example 3-5 shows the information displayed when you enter the GET VALUE DATA_POINT command.

Example 3-5 DATA_POINT GET VALUE Output

BSTR> GET VALUE DATA_POINT /mod_584/p1
1
BSTR> GET VALUE DATA_POINT /mod_584/p2
array[10] of INTEGER_16 
  [ 0]: 0 
  [ 1]: 0 
  [ 2]: 0 
  [ 3]: 0 
  [ 4]: 0 
  [ 5]: 0 
  [ 6]: 0 
  [ 7]: 0 
  [ 8]: 0 
  [ 9]: 0

Example 3-6 shows the information displayed when you enter the PUT VALUE DATA_POINT command.

Example 3-6 DATA_POINT PUT VALUE Output

BSTR> PUT VALUE DATA_POINT /mod_584/p1
(Bit) : 1
BSTR> PUT VALUE DATA_POINT /mod_584/p2
array[10] of INTEGER_16 
  [ 0]: (Integer 16) : 1
  [ 1]: (Integer 16) : 2
  [ 2]: (Integer 16) : 3
  [ 3]: (Integer 16) : 4
  [ 4]: (Integer 16) : 5
  [ 5]: (Integer 16) : 6
  [ 6]: (Integer 16) : 7
  [ 7]: (Integer 16) : 8
  [ 8]: (Integer 16) : 9
  [ 9]: (Integer 16) : 10


Previous Next Contents Index