Can not generate code

2018-10-22
2018-10-23
  • JeffreyThijssen - 2018-10-22

    When trying to generate code it gives me some Internal errors. See .txt file for further explanation. is this a CODESYS bug or is it my code?

    crashed.txt [18.77 KiB]

     
  • RolandWagner

    RolandWagner - 2018-10-23

    To be honest it is quite hard to read that txt file.

    Nevertheless, the last line "Build complete -- 10 errors, 2 warnings : no download possible!" indicates that there should be errors within the code. Press the F4 button in the message window in order to jump step by step to the locations the compiler indicates. Fix them in this order and the number of errors should decrease.
    In some cases errors may occur due to missing Drivers. This can be found out by pressing F11 for complete build. If there is no error after F11 but when you try to login this indicates a driver Problem.

     
  • JeffreyThijssen - 2018-10-23

    Hello,

    Thank you for the reply. I manage to find the solution: _). Sorry for the lack of information in the first place!

    The problem was that my Function call references were not done in the right order. The code below is an example of the wrong order. Unfortunately, the compiler(or me ) was not smart enough.

       VAR_IN_OUT 
          io_C : UDT_Constants;   // Constants
          io_Plt : ARRAY[*] OF UDT_Plt;   // Position Leading Trailing Edge
          io_Events : ARRAY[*] OF UDT_Events;   // Data Structure: store events
       END_VAR
    
                   FC_PltClearPosition(i_Record := i_Record,
                                         i_Position := s_PositionWriteRead,
                                         i_Info := io_C.PLT.Head,
                                         o_ReturnValue => t_Integer,                   
                                         io_Plt := PLT,
                                         io_C := io_C,, 
                                         io_Events := Events,
                                         );
    
     

Log in to post a comment.