# Synthetic variable does not work

#1

Hi everybody!

I’m trying to create an synthetic variable for my oil sensor, it calculate Viscosity from temperature using some costants, see figure:

As you can see from green tick, it is syntactically correct but does not produce any value in my dashboard, instead if I try to output only logTx value (ignoring code after), it works.

What I’m doing wrong?

#2

Greetings, may you please copy and paste your synthetic expression to verify?

All the best

#3

Of course!

e = 2.71828182845904523536
k = 0.7
T1 = 40
visc1 =321
l1 = log(visc1 + k, e)
T2 = 100
visc2 =52.7
l2 = log(visc2 + k, e)
l10e = log(e, 10)
logT1 = log(T1 + 273.16, e) * l10e
logT2 = log(T2 + 273.16, e) * l10e
logTx = log( + 273.16, e) * l10e
W1 = log(l1 * l10e, e) * l10e
W2 = log(l2 * l10e,e) * l10e
Wx = (W1 - W2) / (logT2 - logT1) * (logT1 - logTx) + W1
WxPow = 10 ** Wx
10 ** WxPow - k

#4

Hi, I tried to solve the problem by my own (I have just returned from vacation).

I changed the code above with a “light” version:

e = 2.71828182845904523536
k = 0.7
l10e = log(e, 10)
W1 = 0.3992324654461409
W2 = 0.23742842796281222
logT1 = 2.495766284392676
logT2 = 2.57189508440376
logTx = log( + 273.16, e) * l10e
Wx = (W1 - W2) / (logT2 - logT1) * (logT1 - logTx) + W1
WxPow = 10 ** Wx
10 ** WxPow - k

In this new version there is less computation, it works but I noticed that every new value is calculated with a certain delay (some minutes).

I found very difficult to let this code running, isn’t there a simple way to debug?

#5

Greetings, I am glad that you could solve the issue, my apologies for the tardy response but this ticket got somehow lost in my to-check activities.

Synthetic variables do not work in real time, this means, that based on its complexity sometimes it may take several minutes to be computed, that is the reason of the delay that you experience.

Actually not, but I will add this use-case to our backlog list to improve your user experience in the future.

All the best