Ewon TechForum
Providing technical solutions to technical requests


LOGIO on tag group
Cst Offline
Junior Member
#1
Dear,

As we can associate a tag to a tag group and activated the historic log for each, instead of declare one ONCHANGE ligne for each tag we want to log:

ONCHANGE "Tag_name" ,"LOGIO 'Tag_name'"

Is there a way to activate the ONCHANGE not for a tag but for a tag group ?
Like 
ONCHANGE "Tag_group",  "LOGIO 'Tag_group'"

Thanks,
Reply

simon Offline
eWON Support
#2
Hi,

First the LOGIO function for a group of Tags exist. It is called LOGGROUPIO. See https://developer.ewon.biz/system/files_...download=1

If you want to make a ONCHANGE on multiple Tags, you have to loop :
n% = GETSYS PRG,"NBTAGS"

For i%=0 To n%-1
SETSYS TAG, "LOAD", -i%
GroupA% = VAL GETSYS TAG, "IVGroupA"
IF GroupA% = 1 THEN //in Group A
name$= GETSYS TAG, "NAME"
PRINT name$
ONCHANGE -i%, 'PRINT "TAG '+name$+' has changed"'
ENDIF
Next i%

Simon
Simon
Reply

Cst Offline
Junior Member
#3
(04-12-2019, 05:07 PM)simon Wrote: Hi,

First the LOGIO function for a group of Tags exist.  It is called LOGGROUPIO. See https://developer.ewon.biz/system/files_...download=1

If you want to make a ONCHANGE on multiple Tags, you have to loop :
n% = GETSYS PRG,"NBTAGS"

For i%=0 To n%-1
  SETSYS TAG, "LOAD", -i%
  GroupA% = VAL GETSYS TAG, "IVGroupA"
  IF GroupA% = 1 THEN //in Group A
    name$= GETSYS TAG, "NAME"
    PRINT name$
    ONCHANGE -i%, 'PRINT "TAG '+name$+' has changed"'
  ENDIF
Next i%

Simon
Simon

Thanks Simon,

But with this loop  program , no reason to use the LOGGROUPIO with the ONCHANGE, we have to complete your program with:

n% = GETSYS PRG,"NBTAGS"

For i%=0 To n%-1
  SETSYS TAG, "LOAD", -i%
  GroupA% = VAL GETSYS TAG, "IVGroupA"
  IF GroupA% = 1 THEN //in Group A
    name$= GETSYS TAG, "NAME"
    PRINT name$
    ONCHANGE -i%, "LOGIO 'i%'" 
  ENDIF
Next i%

no ?
Other question,  what does it means to add a '-' in front of i%, on the ONCHANGE Line ?
Reply

AngelaT Offline
Ewon Distributor
#4
Using a number less than or equal to 0 lets you access the tag by its index (first tag, second tag, etc). If i is a number greater than 0, then the number is assumed to be the tag id which might not be sequential.
Reply

Cst Offline
Junior Member
#5
(06-12-2019, 04:31 PM)AngelaT Wrote: Using a number less than or equal to 0 lets you access the tag by its index (first tag, second tag, etc).  If i is a number greater than 0, then the number is assumed to be the tag id which might not be sequential.
The following line is not correct:
ONCHANGE -i%, "LOGIO 'i%'" 

How do I need to write it in order to launch the LOGIO of the tag when this tag change ?
I've try a lot of combinaison without success....

ONCHANGE name$, "LOGIO 'name$'" 
[b]ONCHANGE name$, 'LOGIO "name$"'
...
.
 
[/b]
Reply

simon Offline
eWON Support
#6
Hi,

Can you try
ONCHANGE -i%, "LOGIO -" + STR$ i%
?

Simon
Reply

Cst Offline
Junior Member
#7
(09-12-2019, 02:44 PM)simon Wrote: Hi,

Can you try
    ONCHANGE -i%, "LOGIO -" + STR$ i%
?

Simon

Simon,
Works fine :-)
thanks
Reply



Possibly Related Threads…
31-10-2018, 12:36 PM
Last Post: trygve@triple-s.o



Users browsing this thread:
1 Guest(s)



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