Hi
This has been asked some time ago. But unfortunately the answer is that only a few specific values are supported, and "ON" isn't in the list. You can refer to the green table at the bottom of this documentation page. If I remember correctly, it's because of how Thingworx handles booleans (text and numbers will be translated into boolean).
You can look into getting calculated tags into Kepware to return the value as a 0/1 instead of ON/OFF. I think this would really be the easiest solution.
I tried 2 workarounds in AMU/Composer, but they both failed. I'll leave them here in case you want to use them for testing.
#1 :
- In the Configuration -> Equipment screen, create the status attribute normally (let's call it Status) and choose a tag.
- Set this attribute as the equipment's status tag.
- In Composer, remove the tag binding from property RunningStatus_MCC.
- Create a subscription. Set it to Enabled=True. The input is the DataChange event of the status property. And the code should look like this : if(me.Status == "ON"){me.RunningStatus_MCC = 1;} else {me.RunningStatus_MCC = 0;}
But this did not work because RunningStatus_MCC read only.
Also I expect this could break if you tried to change something in screen Configuration -> Equipment -> Asset Card because it would override the changes we did (tag binding on RunningStatus_MCC).
#2 :
- In the Configuration -> Equipment screen, create the status attribute normally (let's call it CalculatedStatus) and choose a tag.
- In Composer, go on the equipment's Thing.
- Create a new property (for example RawStatus) with setting Persistant=true and bind it to your tag that says "ON".
- Create a new Thing (like TempStatusThing), we can use ThingTemplate = GenericThing. This is because sadly Composer has a bug that when we try local binding a tag, the Thing can't find itself.
- Create a new property (for example TempStatus), type boolean, with setting Persistant=true. Note that if you have more equipments that require this workaround, you can put all their TempStatus properties here.
- Go back to the equipment Thing.
- Create a subscription. Set it to Enabled=True. The input is the DataChange of the tag's property (RawStatus). The code should look like this : if(me.RawStatus == "ON"){Things["TempStatusThing"].TempStatus = 1;} else {Things["TempStatusThing"].TempStatus = 0;}
- Change the tag binding on property CalculatedStatus, to be locally bound to TempStatus.
- Go back in the Configuration -> Equipment screen and set CalculatedStatus as the status tag. - This does not work because it doesn't accept locally bound properties.
- I also tried binding RunningStatus_MCC to TempStatus, but each time we push a value it throws an error saying it can't write in the property.