-
Re: A circular reference was detected in attribute
Rick DavinMay 19, 2017 2:50 PM (in response to VijayaBhaskar)
1 of 1 people found this helpfulHi Vijaya,
The problem is in the expressions to define Loss your final else clause uses TotalLoss. That's the circular reference. You don't need the expression for Unused at all. You should just map the output attribute for Loss to TotalLoss, and change the else 'TotalLoss' to be else NoOutput().
-
Re: A circular reference was detected in attribute
VijayaBhaskar May 19, 2017 3:35 PM (in response to Rick Davin)Hi Rick,
Thanks for your response but I think we cannot use the NoOutput() as it is not supported if we do not map to a Tag. I am receiving the below error when I tried your approach:
Functions such as NoOutput are not supported unless all mapped outputs are configured to save output history.
The TotalLoss is not a tag and we are not planning to implement for it.
Note : typo by mistake in the first post I mentioned that we are planning to implement tag for TotalLoss attribute.
-
Re: A circular reference was detected in attribute
Rick DavinMay 19, 2017 3:47 PM (in response to VijayaBhaskar)
You could introduce another expression before your Loss.
Name: CurrentTotalLoss
Expression: 'TotalLoss'
and then use CurrentTotalLoss in the expression for Loss. If it still gives you a circular reference, try the making the expression for CurrentTotalLoss to be 'TotalLoss' + 0.
-
Re: A circular reference was detected in attribute
VijayaBhaskar May 19, 2017 4:26 PM (in response to Rick Davin)-
Re: A circular reference was detected in attribute
John MessingerMay 19, 2017 10:48 PM (in response to VijayaBhaskar)
2 of 2 people found this helpfulYou've still got some initial referencing issues here, by calling the value of 'TotalLoss' in your CurrentTotalLoss variable before you've written an output value to TotalLoss. I understand that your logic is to create an incrementing value here. What is the current value of 'TotalLoss'? At this stage I'm guessing it will be an error state ("No Data" or similar I expect), and thus the Invalid Operation error you are seeing.You could deal with this by using logic in CurrentTotalLoss such as:
If Not BadVal('TotalLoss') Then 'TotalLoss' + 0 Else 0
Or simply set an initial numeric value for 'TotalLoss'.
-
Re: A circular reference was detected in attribute
VijayaBhaskar May 24, 2017 9:47 AM (in response to John Messinger)Hi John,
Thanks for your inputs , Yes I implemented the calculation as per the suggestion.
Here my requirement is not to create a increment value but to assign a new value (PI Read) when certain condition is met and do not assign any value when another condition is met.
Regards
Vijay
-
Re: A circular reference was detected in attribute
Rick DavinMay 24, 2017 12:49 PM (in response to VijayaBhaskar)
2 of 2 people found this helpfulHi Vijaya,
The problem is you have one attribute 'TotalLoss' that you want for both input and output. Hence the circular reference. Since that attribute is not a PIPoint, you can't use NoOutput() to not assign any value. Therefore, you MUST assign something. It's working for good numeric input but fails when its a digital state. You can try to see if you can echo the same digital state:
// Else clause probably going to create a circular reference later
If Not BadVal('TotalLoss') Then 'TotalLoss' + 0 Else 'TotalLoss'
You could get around this by issuing a standard digital state of your own:
If Not BadVal('TotalLoss') Then 'TotalLoss' + 0 Else DigState("Calc Failed")
-
Re: A circular reference was detected in attribute
VijayaBhaskar Jun 5, 2017 8:04 AM (in response to Rick Davin)Hi Rick,
Thanks for your inputs , I considered your suggestions while implementing the solution.
Thanks again.
Regards
Vijay
-
-
-
-
-
-
-