Zum Hauptinhalt gehen

Triggering a data log on an event

Kommentare

16 Kommentare

  • jseanor

    @kevin

    To confirm, if say a bit changes you want a value to be logged in the historical log?

     

    0
  • kevin

    In my plc I am using one bit to move 5 different values. I want to log them with a time stamp so I can export then to an excel spreadsheet. We have a ton of ewon flexy's we will be doing this to.

    0
  • kevin

    Also we are using esync to see the data

    0
  • jseanor

    You can easily use deadband logging to log the values on any type of change or, in your case, use a script that will trigger it.

    For the script you would basically need the bit tag and the 5 tags you would log. Then the script would be:

        INIT Section
        ONCHANGE "mybit", "goto LogTags"
    

    Essentially what that little snippet does is it says, if my bit changes (at all +/-) to go to the LogTags section.

        LogTags Section:
        LOGIO "TagOne"
        LOGIO "TagTwo"
        etc, etc, etc
    

    This section will actually log a single point for each of those tags when this section runs.


    New Feature

    Now in a newly released firmware (12.2s1) we actually have a new feature called LogGroupIO. Essentially this does almost the exact same as the above in one single command. Additionally it can log all of the tags in that group with a single timestamp.

    The only requirement is that you put the tags into tag groups (done on the tag setup page).

    The new command would be:

        INIT Section
        ONCHANGE "mybit", LogGroupIO("A")
    

    This single command logs all tags in the A group for the same timestamp! So for example it will round the timestamps (10:30:00 instead of 10:30:02)

    0
  • kevin

    Do I need to create the log or where does it log it to?

    0
  • jseanor

    The log file is automatically created inside of the eWON.

    0
  • kevin

    thanks for the help

    0
  • kevin

    When I put the script in and hit run I get this error code:
    "="expected(3) 13:LogTags Section:

    0
  • jseanor

    @kevin

    Ah that isn't perfect syntax. That was more of me separating the sections for readability.

    Try this, you can copy and paste this directly into the init section.

    ONCHANGE "mybit", "goto LogTags"

    LogTags:
    LOGIO "TagOne"
    LOGIO "TagTwo"
    etc, etc, etc

     

     

    0
  • kevin

    In the "mybit" section do I use the tag name or address?

    0
  • jseanor

    @kevin

    That should be the name of the tag that you created in the eWON to reflect your PLC tag.

     

    0
  • kevin

    ONCHANGE "B2_SEND_DATA",Goto LogTag

    LogTags:
    LOGIO "B2_GLYCOL_PUMPED"

    Getting a syntax error

    0
  • jseanor

    You are missing your double quotes around Goto LogTag

    It should be: ONCHANGE "B2_SEND_DATA", "GOTO LogTag"

    0
  • SamLeedy

    Do you leave the real time logging and historical logging setup the same?

    0
  • hms_support

    @SamLeedy

    You can leave the setup the same as long as you have historical logging enabled.
    Your tag(s) must have historical logging enabled for the logio command to work.

     

     

    0
  • SamLeedy

    Thank you!

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.