Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

catch codesys exception

adv
2018-06-06
2018-06-07
  • adv - 2018-06-06

    Hello,

    i want to catch the following exception:

    Error: AusfΓΌhren des Skripts '.\test.py' erzeugt Ausnahmefehler _3S.CoDeSys.Core.Online.InvalidVarRefException: Traceback (most recent call last):
    Β  File "C:\Tmp\test.py", line 87, in <module>
    Exception: UngΓΌltiger Ausdruck
    

    this code dont work:

    try:
    Β  Β  testInt = onlineapp.read_value("PLC_PRG.testInt") # testInt dont exists!
    except _3S.CoDeSys.Core.Online.InvalidVarRefException: 
    Β  Β  print("Variable not found")
    

    Error:

    Error: AusfΓΌhren des Skripts '.\test.py' erzeugt Ausnahmefehler IronPython.Runtime.UnboundNameException: Traceback (most recent call last):
    Β  File "Tmp\test.py", line 87, in <module>
    NameError: name '_3S' is not defined
    

    Regards,
    adv

     
  • adv - 2018-06-07

    nobody?!?

    3S user should know this

     

Log in to post a comment.