How to set up the I/O tags for event transfer rather then timed

How to set up the I/O tags for event transfer rather then timed.

@lesadams

Are you trying to log tag data on an event?

Yes about 60 of them.

I have some code to write the event trigger, but want to make sure the tags are set to do the correct thing. I do not want to do this more than once. Jordan has been working with me but I haven been able to reach him this afternoon.

1 Like

@lesadams

As we discussed on the phone the script below is a direct extension of the code HERE. Now I have updated the code slightly to make it less system dependent.


Essentially the way this script works is on the change of your trigger it calls the EnableLogging section. Once inside of the EnableLogging section, if your trigger is a 1 it will loop through all tags in your eWON and do two things:

  1. It enables historical logging but sets the intervals and deadbands to disabled.
  2. It uses the LOGIO command to log a single entry for that tag name.

The nice thing about this script is it can be used to update more than just logging for all tags, say you wanted to set the email to user for alarms on all tags, you could simply update the script to the desired parameters and save it.


Script:

INIT: 
ONCHANGE "Trigger", "GOTO EnableLogging"

Then…


EnableLogging:
IF(TRIGGER@ = 1) THEN
   FOR i% = 0 TO 300
      SETSYS Tag, "load", -i%
      SETSYS Tag, "LogEnabled", 1  //This line can be updated to do anything from updating emails to updating tag addresses.
      SETSYS Tag, "LogDb", -1
      SETSYS Tag, "LogTimer", 0
      p$ = GETSYS Tag, "Name"
      LOGIO p$
   NEXT i%
ENDIF

A post was split to a new topic: Event driven historical logging