CODESYS simulation exports
Create a PLCopen XML program or a matching Structured Text listing from the active engineering case. Both files are generated on this computer. Open and build the XML with your own local CODESYS Development System installation.
Generate a program
- Open a discipline solver, set its inputs and calculate a valid result.
- Choose CODESYS export. Expand Captured engineering quantities to check the case and units and set any absolute bands.
- Choose Download PLCopen XML for object import into CODESYS 3.5. Choose Download Structured Text for the complete readable declaration and implementation.
Import in CODESYS Development System 3.5
- Open a local simulation project and select its Application in the device tree.
- Choose Project → Import PLCopenXML. Select the downloaded XML and its
Datum_…_Simprogram. Review any object-name conflicts. - Build the project. To run the program, add its call to a simulation task and select Online → Simulation before starting that simulation.
The XML contains one Structured Text program with local variables. Device descriptions, task configuration, fieldbus bindings and hardware addresses are outside the transfer. The .st listing contains both the declaration and implementation for review or manual entry.
Interpret the simulation
Ref_ constants preserve captured study values. Test_ quantities start at those values. Enter independent trial values, set any Band_ absolute allowances in the corresponding engineering units, then set ReviewEnabled to TRUE. Err_ gives the signed difference. The comparison passes when every difference is within its absolute allowance plus the relative percentage of its reference magnitude. Both allowances default to zero.
Equation-based programs also calculate named M_ values from trial inputs. ModelValid indicates when their input conditions are met. Model Lab first- and second-order plant exports advance the virtual step response on each rising edge of SamplePulse. Enter the sample interval in the export dialog. Controls Commissioning also exports the selected trigger states, prerequisite signals, feedback conditions and time limits as a virtual sampled monitor. Pulse its synthetic clock after changing the trial digital inputs. Other numerical workspaces generate a comparison program using their exposed quantities. Run the originating solver again for a new finite-element, load-flow or similarly detailed solution.
Origin of the interchange format
The export uses PLCopen TC6 XML 2.01 and an IEC 61131-3 Structured Text program body. The desktop edition keeps these instructions offline.