![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/userdefault.png)
12/09/2019
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Hello,
I need to define my own condition states on my OPC UA Server, is it possible? If so, is there any example on this??
In the UA Quickstart Applications solution and inside the AlarmCondition Server, there are predefined states with special codes,
for example: Undefined = 0x0, Enabled = 0x1, Acknowledged = 0x2, Active = 0x8, High = 0x80 and Low = 0x100 etc,
are these states apart of the UA standard or are they just examples?
And what the codes (0x0, 0x1, 0x2, 0x8, 0x80, 0x100) stands for? Are they something that the client knows? Can I change them?
regards/
Noora
![Avatar](https://opcfoundation.org/wp-content/uploads/sp-resources/forum-avatars/defaults/admindefault.png)
05/30/2017
![sp_UserOfflineSmall](https://opcfoundation.org/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Those numbers are a mask created for use within the sample client application and have no meaning outside of the application. There is logic to map event notification fields to the bit mask.
If you want to add states to a alarm you need to create a subtype of alarm in the address space of the server that defines the new substate.
You should follow the design pattern that the existing alarm model follows.
If there are only 2 possible states you can use the simplified representation TwoStateVariableType:
https://reference.opcfoundatio.....Part9/5.2/
Otherwise you will need to define a complete State Machine:
https://reference.opcfoundatio.....rt5/B.4.2/
1 Guest(s)