General Discussions
Tag Expression containing 400 IfElse shows error even though within Max limit of Tag Expression

Hello,
this is my poorly written chain of IfElse conditions(I also tried in ternary operator)

https://smalldev.tools/share-bin/IjBFXr6C
screnshot:
667cfd4ce90a3

My text editor says: 402 lines 26802 characters, which is below the max limit mentioned here in the docs

The maximum length of an expression is 65535 characters.
If your expression approaches this limit, you should consider whether there might be a shorter way to write it.

But it is throwing error "Failed to compile expression"
But as i was cutting down some lines, to test max limits, I found a different error: Failed to compile expression. 16: Compiler recursion too deep

Hello, this is my poorly written chain of IfElse conditions(I also tried in ternary operator) https://smalldev.tools/share-bin/IjBFXr6C screnshot: ![667cfd4ce90a3](serve/attachment&path=667cfd4ce90a3) My text editor says: **402** lines **26802** characters, which is below the max limit mentioned [here in the docs](https://www.vtscada.com/help/Content/Scripting/Expressions/ExpressionIntro.htm) > The maximum length of an expression is **65535** characters. If your expression approaches this limit, you should consider whether there might be a shorter way to write it. But it is throwing error "Failed to compile expression" But as i was cutting down some lines, to test max limits, I found a different error: **Failed to compile expression. 16: Compiler recursion too deep**
edited Jun 28 at 12:22 am

Can you not just scale this in a calculation tag - it looks like a linear scale?
You could then use another simple expression that limits the output to between 256 and 768, if desired.

Can you not just scale this in a calculation tag - it looks like a linear scale? You could then use another simple expression that limits the output to between 256 and 768, if desired.

@TomE
Thanks for replying. You're right, I really should break down the problem and look at it simply

a tag's value is 10 at time=25sec. It linearly increases and becomes 15 at time=35sec.

Can you kindly suggest a tag expression ?
Much appreciated...

@TomE Thanks for replying. You're right, I really should break down the problem and look at it simply a tag's value is 10 at time=25sec. It linearly increases and becomes 15 at time=35sec. Can you kindly suggest a tag expression ? Much appreciated...

You can solve this one by using the correlations you have noted in the scaling tab when setting up the tag properties. If you do come accross non-linear tag scaling, you should use the following: https://www.vtscada.com/help/Content/Pro_Functions/TableInterpolation.htm

You can solve this one by using the correlations you have noted in the scaling tab when setting up the tag properties. If you do come accross non-linear tag scaling, you should use the following: https://www.vtscada.com/help/Content/Pro_Functions/TableInterpolation.htm

Trihedral Engineering Ltd.

73
3
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft