Ewon TechForum
Providing technical solutions to technical requests


Tags expressions
imbe88 Offline
Junior Member
#1
Hello everyone, I'm new in the forum.

is it possible in viewon or in the ewon tags page to build an expression with 2 or more tags?

For example:
TagZ=TagX-TagY

Thanks in advance for your answers
Reply

ziozetti Offline
Member
#2
Hi imbe88!
Yes, it is possible in Basic script but "result tag" should be a MEM tag.
Syntax is something like:

TagMEM@ = Tag1@ - Tag2@

All tags have to be number type, otherwise you have to convert them.

You can find a lot of answers here: https://developer.ewon.biz/system/files_...amming.pdf
Reply

Jean-Yves Offline
eWON Support
#3
Hi

Hi,

With eWON basic script yes it's ok, it will be like

TSET 1,1
ONTIMER 1,"GOTO Calcul"
END
Calcul:
TagMEM@ = Tag1@ - Tag2@

[Image: attachment.php?aid=687]

This script is running at any time.

But if you want to do it in viewon it will be effective only when you display the page and you must use "JavaScript Sections"
In viewon you have 4 specific JAVA instruction to manage eWON tags

setEwonTagVal('tagName', value)
getEwonTagVal('tagName')

or Viewon tags

setViewOnTagVal('tagName', value)
getViewOnTagVal('tagName')

In your case it could like:

setEwonTagVal('TagMEM',getEwonTagVal('Tag1')-getEwonTagVal('Tag2'));


So in viewon

[Image: attachment.php?aid=686]

I think the eWON Basic script is better as it's working all time, but it depend on what you need exactly


Attached Files
.png   2020-04-09_09h22_17.png (Size: 82,82 KB / Downloads: 46)
.png   2020-04-09_09h25_33.png (Size: 50,17 KB / Downloads: 41)
Reply

imbe88 Offline
Junior Member
#4
perfect, you have been very clear!

So in the basic script I can also do more complex operations;
I should do something like this:

Every 1 second I would like to add the values of a variable:
TagMem1= TagMem1+(Tag1/3600)

Every first of the month:
TagMem1 transfer value to TagMem2
TagMem1 reset

it's possible?
is there a limit to the number of scripts i can add?


Thanks!!
Reply

Jean-Yves Offline
eWON Support
#5
Yes it's possible.

See this:
https://developer.ewon.biz/system/files_...amming.pdf

especially ONxxxx instruction, for your request ONDATE

And here the different example:
https://developer.ewon.biz/content/basic-1


The limit the memory allowed for the script it's 256 Kbytes.

Remarque as you are newbies with the script, never uses the Cyclic section.
Reply



Possibly Related Threads…
01-04-2020, 08:32 PM
Last Post: mikeniemann
  String Tags in eWON? Started by HAL9000
2 Replies - 3.113 Views
04-08-2017, 10:27 AM
Last Post: HAL9000



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy