Mitsubishi Electric MELSEC iQ-R C Series Programming Manual page 157

Controller module
Table of Contents

Advertisement

Specification method for a module label
• For the module label (ulUnitLabel), specify a module label other than bit type. Specifying a bit type module label may cause
an unpredictable operation.
• To specify an array label for the module label (ulUnitLabel) and write data to each array element, specify an offset for the
offset (ulOffset) in word units. For an offset value to be specified, calculate from a label data type and an array element
number that are specified for the module label (ulUnitLabel).
Offset value = the number of words corresponded to a label data type × an array element number
The number of words varies depending on the label data type. For each label size, refer to the 'Specification method for
data size.' (Page 156 Specification method for data size)
• For the module label (ulUnitLabel), specify a module label which is set in CW Configurator in the structure format.
The following shows an example for specifying a module label.
User program
/* Sample */
#include "CCPUFunc.h "
#include "M+RD78_0000.h"
short Test(void){
short sRet = 0;
unsigned short usDataBuf = 2;
sRet = CCPU_WriteMCUnitLabel(
RD78_0000.System.prConst.Addon_AbsSystem.RamSizeMax,
0,
2,
&usDataBuf,
0,
RD78_0000_Unit LabelID
);
return sRet;
}
3 DETAILS OF FUNCTION
3.1 C Controller Module Dedicated Functions
3
155

Advertisement

Table of Contents
loading

Table of Contents