Tag bit fields (Bozza)

Tags of [JSup Tag type|type] Byte, Short, Int, Long can be defined (via [JSup Tag classes|Tag class]) to have many [http://en.wikipedia.org/wiki/Bit_field|bit fields].

For example the state of an item can pack in a PLC word with the state of its alarms.
In this way only one tag can be defined (and read from the PLC) to read all the information about an item.

If a tag named dummy belongs to a [JSup Tag classes|tag class] that define some bit fields (for example state and alarm) than the state information of the item can be accessed with the dummy.state notation from the application [JSup Code|code].

Bit field dialog

/img/JSup/TagClassBitFields.png
The Integral tag bit field definition dialog shows a table with full information about the defined bit fields. On the bottom of the dialog a graphical table of the integral tag bits show how bit fields will be packed.

  • The first row shows the bit of the tag with their index (0 for the less significant bit, 15 for the most significant bit of a 16 bit integer).
  • The second row shows the index of the bit field that uses every bit of the tag.
  • The third row shows the names of the bit field within the bit of the tag value.

Definition of a bit field

/img/JSup/TagClassBitFieldProperties.png
To define a bit field the following properties must be specified:

  • Name: the name that will be used to access the bit field.
  • Description: a reference description.
  • Start bit: defines the first bit of the tag used by this bit field (the bit 0 is the less significant bit of the tag).
  • Bit length: the number of bits used by the bit field. For a boolean bit field enter 1. The bits used by the bit field of n bit length will start from the bit given in the Start bit parameter and ends at the n-1th more significant bit (see the field stato of the example). In other word bit fields span from the right (the start bit) to the left.
  • Tag class: a [JSup Tag classes|Tag Class] can be assigned to a bit field, a way to assign properties and to categorize it to explain its meaning.
  • Alarm definition: a bit field can be defined to be a [JSup Defining alarms|boolean alarm]. To make a bit field a [JSup Defining alarms|boolean alarm] check the Boolean alarm checkbox, choose a priority and click on the Description button to define the alarm text as a property of the bit field. The alarm will be placed in the same [JSup alarm groups|group] of tag (specified in the [JSup Tag dialog|Tag Dialog]). [JSup Alarm mask and filter|Alarm mask and filter] can be defined for the bit field alarm. The alarm description can be (in part or all) programmatically calculated: see [JSup Defining alarms].
  • Properties: a bit field can have its own properties (even localized) to translate its value, to define alarm description or other [JSup Code|code] related purposes.


The Description of the bit field boolean alarm (defined by the @B property) can include the following placeholders:

  • %1: will be replaced with the tag name;
  • %2: will be replaced with the tag description;
  • %3: will be replaced with the tag class name.