Start a new topic

Error code 2?

Hello,  I am working on a user interface which is going well.  However, I get an Error code 2 returned but this is not documented in the interaction set documents.  


Does anyone know what this error code means?


What command is given before this code returns?

Not totally sure. I was hoping the explanation of the error code would help to isolate the command. I have a timer running which when it reaches 0, loads a new page - this all works fine. On the new page, I have a timer which counts down and each timer event, dims the display brightness slightly. I believe my issue is in the page preinitialise event where I am using the command DimmerTimer.en=1 possibly because the timer does not exist at this point. Not sure as have not had chance to test yet. Are you aware of the error code 2?

To be honest Keith, I am not sure.  I cant quite recall if it was posted about once before (hassle checking every thread).  In many windows development, Error code 2 is a "file not found".  Is this error code showing just in the Nextion Editor, or is it showing on your Nextion display.


Second, I would wonder if your dim is hitting an invalid value (or do you prevent have that possibility)

Can you post the HMI?


I have been able to locate an error code 2 -- and it is a call to an Invalid Component ID.


My case involved code that branched.

if sys2<>1234 then

  click t11,1

  click t11,0


but if sys2=1234

  click t11,1  --> redirected to page1

  click t11,0 <-- IS NO LONGER VALID as T11 DOES NOT EXIST on page1


had it not redirected to page1, the call to click t11,0 is necessary

- but this condition has to be checked in your code, that your code is not calling to adjust components that are no longer there.  I do not believe that making the component global will get around this as the component is simply - not in memory at that time.  Global is only the value .val or .txt is stored global.


Hope this helps


Login or Signup to post a comment