Skip to main content
3-Newcomer
Solved

Derived Tag based on Boolean Values

I have multiple alarm tags in PLC.  I need to set an integer (long) value based on those tags such as 
If tag1 = true then 1000 or if tag2 = true then 1005 or if tag3 = true then 1010 

I can’t seem to figure out a formula that will let me do something like that.

MKhatriAnswer
Support

Hello

If you're looking to map multiple alarm tags to a single integer value, one option is to use an Advanced Tags Plug-in Calculation Tag in KEPServerEX. Create an expression that evaluates the alarm conditions in priority order and returns the corresponding value.

Example:-
IF(Tag1,1000,

IF(Tag2,1005,

IF(Tag3,1010,0)))

 

This would return:

  • Tag1 = TRUE → 1000
  • Tag2 = TRUE → 1005
  • Tag3 = TRUE → 1010
  • No alarms active → 0

Please try the above logic, It might works as expected.

Regards,
Mohit

1 reply

MKhatriCommunity ManagerAnswer
Support

Hello

If you're looking to map multiple alarm tags to a single integer value, one option is to use an Advanced Tags Plug-in Calculation Tag in KEPServerEX. Create an expression that evaluates the alarm conditions in priority order and returns the corresponding value.

Example:-
IF(Tag1,1000,

IF(Tag2,1005,

IF(Tag3,1010,0)))

 

This would return:

  • Tag1 = TRUE → 1000
  • Tag2 = TRUE → 1005
  • Tag3 = TRUE → 1010
  • No alarms active → 0

Please try the above logic, It might works as expected.

Regards,
Mohit

Translate