Ewon Technical Forum

Full Version: Alias and OFFSET Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Good morning.
I come here again, because i have a issue and i dont have the solution now.

Actually i use a Analogue input switch to read by modbus the 8 current input. These part work perfectly.

But we need to read and log the actual current value and the scaled data of the current (pressure).




That's why I decided to use 2 tags.
The "CAPT_BRUT" and "CAPT_BAR" TAG to achieve this.
The CAPT_BRUT TAG works by MODBUS
The CAPT_BAR TAG works by BASIC IDE with the ONCHANGE function

EXAMPLE: 

ONCHANGE "CAPT_BRUT", "CAPT_BAR@=CAPT_BRUT@"

This part works.
Afterwards I thought to use the automatic scaling provided by Ewon. The one with the coefficient and the offset that I configure in CAPT_BAR.



However that doesn't work. Scaling is not done.

Have you ever seen this problem?
I think that basic script "ovverrides" tag automatic scaling.
You can easily solve adding scaling directly in basic script:


Code:
ONCHANGE "CAPT_BRUT", "GOTO CAPT"

CAPT:
CAPT_BAR@ = CAPT_BRUT@ * 10 - 273


PS: at the moment I don't have here a Flexy to make a test about tag scaling but I'm pretty sure this workaround will solve the emergency.
(07-03-2022, 04:45 PM)ziozetti Wrote: [ -> ]I think that basic script "ovverrides" tag automatic scaling.
You can easily solve adding scaling directly in basic script:


Code:
ONCHANGE "CAPT_BRUT", "GOTO CAPT"

CAPT:
CAPT_BAR@ = CAPT_BRUT@ * 10 - 273


PS: at the moment I don't have here a Flexy to make a test about tag scaling but I'm pretty sure this workaround will solve the emergency.

I think too. But it is possible to duplicate Tag or use the principe of alias ( same in programming PLC) ?
I want to avoid to use the basic script. Because some of my collegues need to use the Ewon and ddont know how to use basic.
It is not possible to duplicate tags in the same server BUT (another workaround incoming) you can duplicate servers!
You can poll CAPT_BRUT TAG via MODBUS server A (without scaling) and CAPT_BAR TAG via MODBUS server B that has the same IP (scaling the tag as you want).
It works with S73&400 server but I think it can work also with MODBUS server.

PS: HERE an example.
Hello.
Sorry for the late answer.

Finally, i use the solution from ziozetti. Its work perfectly