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

Error IPR Buffer too small

2022-10-19
2024-03-11
  • captaincookie - 2022-10-19

    Hello,

    I'm using Codesys SP18 Patch 2 for a Control RTE Project on a Windows 10 system. I try to move a 3 axis system using G-Code. Therefore, I wrote a pretty simple script (.cnc file in the local file system).
    LET #lrXpos : LREAL := 2
    LET #lrYpos : LREAL := 2
    LET #lrZpos : LREAL := 2
    N0 G90
    N10 G1 X#lrXpos Y#lrYpos Z#lrZpos F100 E15

    In my code I implemented the SMC_ReadNCFile2 and the SMC_NCInterpreter of the SM3_CNC library. The ReadNCFile functionblock is working well. The file is read sucessfully and no error occured, but when the NCInterpreter try to handle the NC file the Error SMC_IPR_BUFFER_TOO_SMALL appears in the function block. There is no other function in between. The input parameter nSizeOutQueue is 1000. I also tried to increase it to 10 000, but it makes no difference. Can someone please help me to understand the error and how to fix it?

    Thanks in advance.

     
  • gseidel - 2022-12-09

    Hi there,

    you should set nSizeOutQueue to SIZEOF(aBufGeos) where aBufGeos is the array of SMC_GeoInfo objects.

    Best regards,

    Georg

     
  • ByCNC

    ByCNC - 2023-02-23

    Hello,

    I guess you have information about the subject. I'm getting a similar mistake. I get the error in the "SMC_INTERPOLATOR" block. The error is this; "SMC_CNC_INTERNAL_ERROR".

    I'm reading a file with a .cnc extension with 50 thousand lines. I use "SMC_Readncfile2" and "SMC_NCINTERPETER" blocks in the reading section. There is no problem with these blocks.

    Buffer I use the 80000 value as you. Buffer is defined in sufficient capacity for the file I am trying to open to you.

    Why can I get this "Internal" error? Thank you.

     

    Last edit: ByCNC 2023-02-23
  • gseidel - 2023-02-23

    Dear ByCNC,

    the error probably occurs because you have more than 2^15-1 (32767) elements in your CNC queue.

    It is not recommended to use such a huge queue size. Even with g-code files that are in the millions of lines, you do not need to keep the entire path in memory. In your case, a queue size of 100 SMC_GeoInfo elements should be more than enough.

    Best regards,

    Georg

     
    πŸ‘
    1
  • ByCNC

    ByCNC - 2023-02-23

    Hello dear Georg,

    Thank you very much for your quick response. I've been spending time for this problem for days. I understand the answer, but although it varies according to the work to be done in the project, multi -line G code files are requested to run.

    For example, I need to run a 50000 -line code and the size of this file corresponds to 1.5 million byte. Do you have the idea how to do this, how to read big files.

    Thank you.

     
  • gseidel - 2023-02-23

    As I said, the queue sizes can be much smaller than the g-code file sizes.

    I have attached an example were we have ~ 1000 lines of g-code and 50 elements in the queue.

     
    πŸ‘
    1
  • ByCNC

    ByCNC - 2023-02-24

    Hello dear George,

    I appreciate your help. This worked! It was very important to me. Thanks.
    Enjoy your work.

     

Log in to post a comment.