Refer to the sample project PLCopenMultiCAM.project in the installation directory of CODESYS.
This sample demonstrates how a cam movement can be created with two alternating cams. The program is programmed in ST and executes the same actions as the sample "Cam Drive Control using a Virtual Time Axis". At the end of the first cam, the MC_CamIn function block sets the EndOfProfile output. In this way, the other curve table is assigned to MC_CamTableSelect and MC_CamIn is restarted.