Data type MC_CAM_REF

TYPE MC_CAM_REF :
STRUCT
   pArray               : UDINT;
   ArraySize            : UDINT;
   TableType            : MC_TableType;
   NoOfRows             : UDINT;
   NoOfColumns          : UDINT;
END_STRUCT
END_TYPE

The data structure MC_CAM_REF describes the data memory of a cam plate in a further PLC variable (array).

The first parameter pArray is a pointer to a data structure containing the cam plate data. The data structure depends on the table type nTableType. The number of rows is entered in the component nNoOfRows, the number of columns in nNoOfCols (usually 1 or 2).

Example 1: Position table structure description

pArray

Address of a two-dimensional array. The first column contains an ascending list of master positions. The second column contains the associated slave positions. The address can be assigned with the ADR function.
Example:
Table1 : ARRAY[0..360, 0..1] OF LREAL;
pArray := ADR( Table1 );

ArraySize

Storage capacity of the two-dimensional array, which can be determined with the SIZEOF function.
Example:
ArraySize := SIZEOF( Table1 );

TableType

The table type is MC_TABLETYPE_EQUIDISTANT, if the master positions have the same distance, or MC_TABLETYPE_NONEQUIDISTANT it the distance is variable.

NoOfRows

The number or rows corresponds to the number of table points.

NoOfColumns

The number of columns is 2.

Example 2: Structure description of a motion function

pArray

Address of a one-dimensional array of type MC_MotionFunctionPoint. Each array element contains a description of a cam plate interpolation point.

Example:
MotionFunction : ARRAY[1..10] OF MC_MotionFunctionPoint;
pArray := ADR( MotionFunction );

ArraySize

Storage capacity of the one-dimensional array, which can be determined with the SIZEOF function.
Example:
ArraySize := SIZEOF( MotionFunction );

TableType

The table type is MC_TABLETYPE_MOTIONFUNCTION.

NoOfRows

The number or rows corresponds to the number of table points.

NoOfColumns

The number of columns is 1.