Advanced Configuration¶
In a standard configuration the global variables for I/O Mapping are set automatically. As this is not possible for hardware variants with complex channel/address settings, global variables must be defined in CODESYS to map the channels in the applications. Advanced configuration allows to operate independent hardware configurations.
Create a Automation Builder project with a PLC device. This PLC contains your primary hardware configuration (in the example: TargetPLC).
Create as many PLC hardware variants as required. Note: The main program that includes the hardware configuration of all your variants is defined in the TargetApplication object of your TargetPLC (not in the application objects of your variants (NotUsed_x)).
- ⇒
Double-click TargetApplication to define I/O Mapping for the IEC addresses in CODESYS. Due to a different module configuration this cannot be done in the I/O Mapping tab of Automation Builder.
Under Resources define a global variable that can be used to identify the active hardware variant (in the example G_byActiveHWVariant).
- ⇒
For a better readability we recommend you to create I/O Mapping objects for your variants which lists the address mapping for the inputs and outputs of a I/O bus module.
- ⇒
Under POUs create a new program (in the example IOMultiplex) which describes the addresses for inputs and outputs to be used for each hardware variant.
- ⇒
Under POUs create a new program (in the example IdentifyHWVariant).
- ⇒
Under POUs create a new program (in the example PLC_PRG) which refers to the previously defined program (IOMultiplex) and your global variable (G_byActiveHWVariant).
- ⇒
Under POUs create a new program (in the example MainProgram).
- ⇒
Save and close your CODESYS configuration. Proceed with exporting the PLC configuration as described under Step: Exporting the PLC.