Obj_SetFlag

SUMMARY

Obj_SetFlag - Set flag in status or value

SYNTAX

Obj_SetFlag(<PointId>,<Attribut>,<Bitmask>,<Value>)

ARGUMENTS

PointId
- DataObject
Attribut
- Status or Value
Bitmask
- Bitmask for the bits that may be modified
Value
- Value to set (lowest bit of the bitmask becomes bit 0 for the value to set)

DESCRIPTION

Status or value of a DataObject can be modified in the bit-area defined by the mask.
Note:
Bit 31 represents the leading sign of the Data-Object value and must not used for masking.

EXAMPLES

Obj_SetFlag("TEST_1", Status,26,6)

The status of the DataObject "TEST_1" is masked by 26(Bits 1, 3, 4); Only those bits may be modified !
The status-value to be set(6) is shifted to the left until its bit 0 is congruent with the lowest bit of the mask that is set (Bit 1).
Any bit congruent with the mask(Bits 1, 3, 4) is taken over; any other stays unchanged.

Actual status               11110000 (240)       11110100 (244)
Value to set                00000110 (6)         00000110 (6)
Mask                        00011010 (26)        00011010 (26)          
moved Value                00000110             00000110 
after taking over the bits  11101000 (232)       11101100 (236)             


Syntax Notation
[aaa]
aaa is optional (zero or one occurences)
(aaa|bbb)
aaa exclusive or bbb
(aaa)*
aaa may occur indefinitely often or may be omitted
(aaa)+
aaa may occur indefinitely often but at least once
(aaa)m..n
aaa may occur from m to n times