The following behavior i have in my PLC next Engineer (2021.1), I work with IEC/ST Maybe it is helpfull to share or has someone a solution. In a task (1sec/cyclic) i have three program’s who are processed sequentially after eachother. There is also a global structure defined (called ISF0) and all the programs have access tot this global structure without problems A FB that I made has also a reference to this global structure. If i use the FB in a program 1 then there is no problem If a use this FB again but now in program 2 then i get a CILG001 error If i change in de FB the ISF0 usage from external to local, than the error disappears (but ofcourse the FB wont work) If i put the code from de FB directly in the program (what i do now as a work -around) then there als no problem an the code can reach this global structure. So in this specific FB a external reference to a shared structure couses this error. I dont see what the problem is in my code. A reference to a shared structure in global memory is not illegal because several other FB work the same way. What is the problem? Is this a compiler bug because: CILG0001: Internal Error seems to me as a code for the PLCnext Engineer developers en not for PLC program developers?. (otherwise: give a beter description because it cost me hell of job to find the problem ?) Marco van Os, GeoComfort Netherlands
I have not experienced a CILG001 error due to an external variable reference within an FB. Have you tried passing the variable to the FB via in-out parameter type?
Hi Rob, PLCnext team, I struggled on ? and i discovered this strange situation As i told, in 1 cyclic task 3 programs are called after eachother. If i use the FB (with the external reference to a global structure) in Program 1 → then i got a CILG0001 error. If I use this FB in Program 2,3,than no problems occure and the FB works fine. I made a new program instance (Program4) and copied al code from Program 1 to Program 4 → and all worked fine. I can’t find the problem in Program 1 but i made a copy and will was it to the dutch PLCnext team. Maybe they can find something. I can now go on with my work. Greetz Marco van Os
Hello Marco van Os,
I can not reproduce this issue you are describing.
Seems to be a bug indeed.Is it possible to contact you via mail to get the project or a minimal Version that shows this issue?
I tried reproducing the error with the described procedure but all combinations are working fine.
So I guess it has to be something project specific that causes this.kind regards,
Oliver
Hello Oliver My email is: vanos@geocomfort.nl I can olso show this by Teamviewer if you want. ( i think i got you e-mail.. we have met eachother on your office when we had also an issue with our PLC software (oh noooo.. its him again ) :-)))) Greetings Marco van Os GeoComfort
Hello Marco
thank you one of my colleagues of the PLcnext Engineer Support Team will contact you in the coming days.
-–
Yes I remember
But i think I visited your office first?
It was 2016, during my first year of PLC Support I think.
It was about some sporadic occuring Index Out of Range Exception caused by some Event Tasks?
Realy tricky to deubg that one.
-–
I hope we can find the reason for this CIL Error soon and extend the Compiler to detect the issue with a better ErrorCode. kind regards,
Oliver
Yes indeed, it was that tricky one :-)) Thanks for reply and i will hear from your collegue soon. Kind regards Marco
I’m getting the same.
