Command: Display Generated Code
Function: The command opens the Generated Code dialog where the IEC initialization code of the represented cam is displayed.
Call: menu
Requirement: The cam editor is open and displays a cam.
Tip
No generated code is displayed for the Segments compile format. The generated code is no longer necessary because the CamBuilder API can be used to programmatically generate cams in a better way.
Dialog: Generated Code
Example 11. Example: IEC initialization code
{attribute 'linkalways'}
VAR_GLOBAL
Cam_A: ARRAY[0..3] OF SMC_CAMXYVA := [
(dX := 0, dY := 0, dV := 0, dA := 0),
(dX := 120, dY := 120, dV := 1, dA := 0),
(dX := 240, dY := 240, dV := 1, dA := 0),
(dX := 360, dY := 360, dV := 0, dA := 0)];
Cam: MC_CAM_REF := (nElements := 4, byType := 3, xStart := 0, xEnd := 360, nTappets := 0, strCAMName := 'Cam', pce := ADR(Cam_A), xPartofLM := TRUE);
END_VAR