Heretic
Resource contributor
- Messages
- 6,830
- Country

I know XML scripts operate by the "garbage in, garbage out" principle, but I just can't find the garbage in this one.
What one would expect is a value of 300 - 159 = 141 for (L:000 Total Bus Load, Amps) and 300 - 157 = 143 for (L:000 Total Bus Load2, Amps).
What the code produces is a value of 141 for (L:000 Total Bus Load, Amps), but -457 for (L:000 Total Bus Load2, Amps).
If I replace the "@GenAmpLimit" in the evaluation with its value, i.e.
I get the same result. 141 and -457.
If I only query the macros, i.e.
the variables display the correct values, i.e. 159 and 157.
What the heck is going on here?
- Edit:
Even this won't work properly!
Or this!
Time for one to fourhundred drinks.
Code:
<Macro Name="GenAmpLimit">300</Macro>
<Macro Name="LeftElecBusLoad">[bunch of code that is sound and results in 159]</Macro>
<Macro Name="RightElecBusLoad">[bunch of code that is sound and results in 157]</Macro>
<Element>
<Select>
<Value>
@GenAmpLimit @LeftElecBusLoad - (>L:000 Total Bus Load, Amps)
@GenAmpLimit @RightElecBusLoad - (>L:000 Total Bus Load2, Amps)
</Value>
</Select>
</Element>
What one would expect is a value of 300 - 159 = 141 for (L:000 Total Bus Load, Amps) and 300 - 157 = 143 for (L:000 Total Bus Load2, Amps).
What the code produces is a value of 141 for (L:000 Total Bus Load, Amps), but -457 for (L:000 Total Bus Load2, Amps).
If I replace the "@GenAmpLimit" in the evaluation with its value, i.e.
Code:
300 @LeftElecBusLoad - (>L:000 Total Bus Load, Amps)
300 @RightElecBusLoad - (>L:000 Total Bus Load2, Amps)
If I only query the macros, i.e.
Code:
@LeftElecBusLoad (>L:000 Total Bus Load, Amps)
@RightElecBusLoad (>L:000 Total Bus Load2, Amps)
What the heck is going on here?
- Edit:
Even this won't work properly!
Code:
@GenAmpLimit (>G:Var8)
(G:Var8) @LeftElecBusLoad - (>L:000 Total Bus Load, Amps)
(G:Var8) @RightElecBusLoad - (>L:000 Total Bus Load2, Amps)
Or this!
Code:
<Macro Name="GenAmpLimit">300</Macro>
<Macro Name="LeftElecBusLoad">[bunch of code that is sound and results in 159]</Macro>
<Macro Name="RightElecBusLoad">[bunch of code that is sound and results in 157]</Macro>
<Macro Name="LeftElecChrgBusLoad">@GenAmpLimit @LeftElecBusLoad -</Macro>
<Macro Name="RightElecChrgBusLoad">@GenAmpLimit @RightElecBusLoad -</Macro>
<Element>
<Select>
<Value>
@LeftElecChrgBusLoad (>L:000 Total Bus Load, Amps)
@RightElecChrgBusLoad (>L:000 Total Bus Load2, Amps)
</Value>
</Select>
</Element>
Time for one to fourhundred drinks.
Last edited:




