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

Controller module
Table of Contents

Advertisement

CCPU_ReadMCUnitLabel
This function reads data from module labels of a C Controller module in word units.
Format
short CCPU_ReadMCUnitLabel (unsigned long ulUnitLabel, unsigned long ulOffset, unsigned long ulSize, unsigned short*
pusDataBuf, unsigned long ulBufSize, unsigned long ulUnitLabelID)
Argument
Argument
Name
ulUnitLabel
Module label
ulOffset
Offset
ulSize
Data size
pusDataBuf
Data storage destination
ulBufSize
Data storage destination size
ulUnitLabelID
Module label ID
Description
• This function reads data from the module label of C Controller module, which is specified for the module label (ulUnitLabel),
to the specified data storage destination (pusDataBuf) for data size specified in the data size (ulSize).
• To use the CCPU_ReadMCUnitLabel function, include a header file that has the information of module labels output by CW
Configurator, and specify a module label.
Specifying a module label
• For the module label (ulUnitLabel), specify a module label other than bit type. Otherwise, unintended data is read.
• For the module label (ulUnitLabel), specify a module label which is set in CW Configurator in the structure format. For the
example of specifying a module label, refer to 'Specification method for a module label' in the 'CCPU_WriteMCUnitLabel
function' section. (Page 155 Specification method for a module label)
• To specify an array label for the module label (ulUnitLabel) and read data from each array element, specify an offset for the
offset (ulOffset) in word units. For an offset value to be specified, calculate from a 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' in the 'CCPU_WriteMCUnitLabel function' section. (Page 156 Specification method for data size)
Specifying a module label ID
• For the module label ID (ulUnitLabelID), specify a macro defined in the header file, which includes the information of
module labels output by CW Configurator. For an example of specifying a module label ID, refer to 'Specification method for
a module label ID' in the 'CCPU_WriteMCUnitLabel function' section. (Page 156 Specification method for a module
label ID)
• When specifying '0' for the module label ID (ulUnitLabelID), data will be read from the module label without checking the
module label ID.
Specifying data size
• For an example of specifying the data size (ulSize), refer to the 'Specification method for data size' in the
'CCPU_WriteMCUnitLabel function' section. (Page 156 Specification method for data size)
3 DETAILS OF FUNCTION
122
3.1 C Controller Module Dedicated Functions
Description
Specify a module label.
Specify the offset from the specified module label in word units.
Specify the read data size in word units.
Specify the storage destination of read data.
Specify the data storage destination size in word units.
Specify a module label ID.
IN/OUT
IN
IN
IN
OUT
IN
IN

Advertisement

Table of Contents
loading

Table of Contents