Compiler Errors
These errors may be seen when compiling a project.
"EtherCAT: ERROR: Failed to retrieve EtherCAT device…"
These errors indicate either:
- The ESI file for the EtherCAT ***EtherCAT is an open, high-performance Ethernet-based fieldbus system. The development goal of EtherCAT was to apply Ethernet to automation applications which require short data update times (also called cycle times) with low communication jitter (for synchronization purposes) and low hardware costs device is missing.
- Information is missing from the ESI file for a device and/or module.
Examples
EtherCAT: ------------- Generating EtherCAT Network Information (ENI) file ---------------
EtherCAT: ERROR: Failed to retrieve Vendor for vendorID=0x21 in ESI cache
Project compile failed
EtherCAT: ------------- Generating EtherCAT Network Information (ENI) file ---------------
EtherCAT: ERROR: Failed to retrieve EtherCAT device (vendorID=0x2, productCode=0x44c2c52, revision=0x120000) in ESI cache
Project compile failed
Error Correction
- Identify which EtherCAT devices or modules are listed as Unknown in the Project View.
- Import an appropriate ESI file.
See Unknown – Missing ESI File for more information.
"Failed to export ENI file, check the logs for more details." or
"EtherCAT: Warning : In AKD_1, PDO object index 0x3470, subIndex 4 is redundant."
These errors indicate redundant PDO PDO is a type of protocol frame used in some fieldbuses. A PDO contains one or more object dictionary entries, which define the application data transferred between devices. entries.
Error Correction
See Redundant PDO Entries for more information.
These compiler outputs indicate a failure to compile the optimized C code:
Controller:PLC "Programmable Logic Controller" A Programmable Logic Controller, PLC, or Programmable Controller is a digital computer used for automation of industrial processes, such as control of machinery on factory assembly lines. Used to synchronize the flow of inputs from (physical) sensors and events with the flow of outputs to actuators and events:> ------------- Compile Optimized Code ------------- Controller:PLC:> Compiling "C" code. Controller:PLC:> ERROR: Failed to compile PLC "C" code. Controller:PLC:> Compilation log: ... Controller:PLC:> End of Compilation log Controller:PLC:> Compile Time Elapsed:1.37 seconds Controller:PLC:> ------------- Compile Optimized Code FAILED -------------
Error Correction
Locate and send these items to Kollmorgen technical support:
- The compilation log (copied from the compiler output).
- All the files in this directory:
%LOCALAPPDATA%\Kollmorgen\KAS\Project\Controller\PLC\CC\
- The path can be copied and pasted into the Windows Explorer address bar.
To help us resolve the error with you, Kollmorgen technical support contact information can be found here:
Call or e-mail the appropriate support for your region.
A possible cause for optimized PLC code to fail compilation is if the user does not have permission to write to an output file or folder.
Example 1: The file cclog.txt is not writeable.
Controller:PLC:> ------------- Compile Optimized Code -------------
Controller:PLC:> ERROR: cannot remove old output file "C:\Users\my.name\AppData\Local\Kollmorgen\KAS\Project\Controller\PLC\CC\cclog.txt"
Controller:PLC: > To resolve the issue, set the permissions on the file so that it is writeable.
Controller:PLC:> Compile Time Elapsed:0.02 seconds
Controller:PLC:> ------------- Compile Optimized Code FAILED -------------
Example 2: The file main.c is not writeable.
Controller:------------- Compile PLC ---------------
...
Controller:PLC:main
Controller:PLC:c:\users\my.name\appdata\local\kollmorgen\kas\project\controller\plc\cc\main.c:
Cant write output file
Controller:PLC:appli
Controller:PLC:Error(s) detected
Controller:------------- PLC failed ---------------
Error Correction
Change the file permissions to allow writing to the file.
"Boolean expression expected after IF."
These errors indicate that the IF THEN ELSE ELSIF END_IF condition used in the application code does not evaluate to a BOOL expression.
Controller:------------- Compile PLC ---------------
…
Controller:PLC:MCFB_Jog
Controller:PLC:MCFB_Jog: (16): Unexpected complex data in expression
Controller:PLC:MCFB_Jog: (16): Boolean expression expected after IF
Controller:PLC:MCFB_Jog: (19): END_IF: New statement expected
Controller:PLC:Error(s) detected
Controller:------------- PLC failed ---------------
Controller:------------- Device compile failed ---------------
...
Project compile failed
This compile error can happen when a non-compliant syntax is used for verifying the function block outputs.
- In the KAS v4.0 and earlier releases, it was possible to use the function block return statement in the same way as function return values.
- This could result in undefined behavior.
- In KAS v4.0 and later releases, the compiler generates a an Unexpected complex data in expression error for non-compliant syntax.
IEC "International Electrotechnical Commission" IEC is a not-for-profit, non-governmental international standards organization that prepares and publishes International Standards for all electrical, electronic and related technologies 61131-3 Non-Compliant Syntax:
If inst_functionBlock(myVar1) Then
// ...
End_If;IEC 61131-3 Compliant Syntax:
inst_functionBlock(myVar1);
If inst_functionBlock.Q Then
// ...
End_If;
Error Correction
- Identify the code that caused compile error.
- If the error is due to non-compliant syntax, replace this code using compliant syntax for the corresponding function block.
Example: Non-compliant Syntax
IF Inst_r_trig(Inst_TON.Q) THEN
Inst_DriveParamRead( TRUE, any_to_int(Inst_MC_ReadParam.Value), 'DRV.FAULT1' );
END_IF;
Example: Compliant Syntax
Inst_r_trig(Inst_TON.Q);
IF Inst_r_trig.Q THEN
Inst_DriveParamRead( TRUE, any_to_int(Inst_MC_ReadParam.Value), 'DRV.FAULT1' );
END_IF;
-
- UDFBs and libraries can have improper syntax.
These Kollmorgen UDFBs have been corrected and can be re-imported into the application code.
See Re-import Kollmorgen UDFBs for more information.