Skip to main content

Why does onchange in init section doesn't work?

Comments

9 comments

  • jseanor

    @Massimo_Borroni

    You simply have a syntax error in your onchange. Inside of the onchange you are passing a reference to the tag value (specified by the @ symbol) but not the actual tag address. When using an onchange you would format it as:

    
    ONCHANGE "Tag0", "GOTO MyLabel"
    

    Note, the only difference is I dropped the @ in the tag name and wrapped it in " marks.

     

    0
  • Xaloo

    We have a similar simple script but for ONTIMER which update tag values to a remote ewon. Under the init section it is

    TSET 1, 10
    ONTIMER 1, "GOTO UpdateRemote"

    it has worked before but now we keep getting the error:

    label/function not found(27): Goto ewon init_section.

    0
  • Tim Beaulieu

    Can you send me a backup.tar file of this device with the support files checkbox enabled in eBuddy?

    0
  • Xaloo

    The problem has been solved. We deleted the whole program and imported the previous one. The error has since disappeared.

    Thank you

    0
  • Tim Beaulieu

    Ok thanks for the update

    0
  • nickTriPhase1

    I'm having an issue where the ONCHANGE does not work for some reason when changing the tag value. Any ideas for what I'm doing wrong?

    Thank you!

    image

    This code is in a separate section.
    image

    0
  • Kevin Annis

    Can you remove the CLS from the from the command. It could be that the CLS is clearing the screen before the print command is shown.

    Is the Tag a boolean value?

    0
  • nickTriPhase1

    @Kevin_hms,

    Found my issue: I was forcing the tag value to change in the command screen, but was using "TPLC_testDataLoggTriggerIN" instead of "TPLC_testDataLoggTriggerIN@"

     

    0
  • Kevin Annis

    Hello Nick,

    Excellent! I am glad it was a simple resolution.

    0

Please sign in to leave a comment.