aci.Obj_SetFlag

SUMMARY

Set single bits in the value or status of a data object.

SYNTAX

aci.Obj_SetFlag((<object number>|<point id>), <attr>, <bitmask>, <flag>)

ARGUMENTS

object number (type:number)
A data object number
point id (type:string)
The name of a data object
attr (type:integer)
An identifier for the required attribute. Use the global table DOATTR. The names elements of DOATTR have the same names as the attributes in the display editor.
For a list of attributes see aci.Obj_QueryAttr.
bitmask (type:integer)
Specifies the bits that shall be affected.
flag (type:integer)
Specifies the bits that shall be set to 1.

ERROR HANDLING

The function will fail and terminate script execution if strict error checking is enabled (see aci.SetStrictMode()) and one of the following conditions is met:

EXAMPLES

aci.Obj_SetSts("TEST_1", 0xf0)
aci.Wait(1000)
aci.Obj_SetFlag("TEST_1", DOATTR.Status, 0x0a, 0x03)
aci.Wait(1000)
assert(aci.Obj_Sts("TEST_1") == 0xf2)
-- 0xf0 = 11110000 original status
-- 0x0a = 00001010 bitmask
-- 0x03 = 00000011 flags
--        00000110 after shifting
-- 0xf2 = 11110010 result
		


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