Empty box corrupts the whole program in CFC?

iika
2018-10-17
2018-11-08
  • iika - 2018-10-17

    Hey,

    I added an empty box on the CFC canvas of a program inside my project and for some reason this led to Codesys crashing. Now I can no longer open the program in question inside the project. If I try, I always get the following error message:

    As with other messages like this I've got before, none of the buttons does much good. Ignore removes the message, but doesn't open the program and instead creates another message which states "Object reference not set to an instance of an object". Abort and retry lead to Codesys crashing.

    In build messages there are errors pointing to the empty box ('???') as there should be when trying to build a program with an empty operator.

    I do have a backup of course, but I did lose a couple of hours worth of programming work, so it would be nice to know (for me and anyone else using this platform)
    what exactly caused this and is there any way to prevent it from happening or to recover the program.

    IMG: error_message1.PNG

     
  • r.evbatyrov - 2018-10-18

    Hi iika,
    try remove to *.opt files in the project directory. It should give you a chance to open project without crash. Does it chashes if you open this CFC POU?
    If yes: Which version you are using? Try to export this POU in native XML (not PLCopenXML) and post the XML file here here, if possible.
    Regards,
    Roman

     
  • iika - 2018-10-25

    r.evbatyrov hat geschrieben:
    Hi iika,
    try remove to *.opt files in the project directory. It should give you a chance to open project without crash. Does it chashes if you open this CFC POU?
    If yes: Which version you are using? Try to export this POU in native XML (not PLCopenXML) and post the XML file here here, if possible.
    Regards,
    Roman

    Hey Roman,

    I am able to open the project. The problem is that I can no longer open the POU. I am using Codesys 3.5.10.

    Sadly I cannot post the files here, but I am able to recreate the problem if I insert an empty box to a CFC program and connect the pins somewhere before declaring the box as an object (eg. a function). This will cause similar error messages to appear and if I close this POU I cannot open it again.

    BR,
    Iiro

     
  • r.evbatyrov - 2018-10-26

    Hi liro,

    I cannot reproduce your problem. Please provide detailed steps to repeat.
    Which version you are using? Is this normal or page-oriented CFC?
    Is the problem reproducible "from scratch" (with standard project using template)?
    How do you insert the box - with Copy/Paste, with Toolbox, with menu?

    Please note, that "function" has not to be declared, so your box is definetely not a function.

    Regards
    Roman

     
  • iika - 2018-11-07

    r.evbatyrov hat geschrieben:
    Hi liro,
    I cannot reproduce your problem. Please provide detailed steps to repeat.
    Which version you are using? Is this normal or page-oriented CFC?
    Is the problem reproducible "from scratch" (with standard project using template)?
    How do you insert the box - with Copy/Paste, with Toolbox, with menu?
    Please note, that "function" has not to be declared, so your box is definetely not a function.
    Regards
    Roman

    Hey,

    sorry for the late reply and a bad choise of words: what I meant by "declaration" was the process of setting the empty object (a new box in CFC) to a reference, i.e. naming it as a function or a fb.

    I'm using Codesys 3.5.10 and normal CFC (not page oriented). I inserted the box from the toolbox.

    So basically what I did was that I entered a new box to an existing program and connected the leads to other boxes before I gave the object a reference (it was still pointing to '???'). This recreated the same error and when I closed the PRG editor I could not open it again.

    The weird part is, that when I tried this on another program, I was able to connect the leads to other boxes before naming the box as anything without getting any error messages whatsoever. I'm going to try this out on an empty program next and see what happens.

    BR,
    Iiro

     
  • r.evbatyrov - 2018-11-07

    Hi liro,

    you are using pretty old (about two years old) version.
    This problem was fixed in 3.5.10.1; released February 2017.

    Regards,
    Roman

     
  • iika - 2018-11-08

    Hi,

    thanks for the information.

    I was using a version that was provided by a device manufacturer with their SDK. Luckily they have just issued an update which supports 3.5.13. I did some testing and it seems like the issue is now fixed.

    BR,
    Iiro

     

Log in to post a comment.