I have a expression tag running a switch function monitoring the state.value of a tag.
switch(
{[.]OEE_PackML_Condition/State.value},
"Held", "Holding", "Unholding", "Idle", "Resetting", "Complete", "Stopping", "Clearing", "Stopped",
1,1,1,1,1,1,1,1,1 ,0)
I have multiple states that im counting towards a single Time in another expression tag.
if({[.]idle},if(IsGood({[.]idle_time.value}),{[.]idle_time.value},0)+1,if(IsGood({[.]idle_time.value}),{[.]idle_time.value},0))
Pretty much if the state switch to any of the cases it will return a 1 else 0 . This works but seams laggy and i found that its possibly do to 10k errors being written to the log every 5 sec LMAO. If anyone has a solution
ERROR :
Error writing tags Error writing to tag '[default]SMARTPACs/SMARTPAC 1/idle': Bad_ReadOnly("Tag value source does not support writing.")