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

Controller module
Table of Contents

Advertisement

CCPU_X_In_WordEx
This function reads an input signal (X) in word (16-point) units.
Format
short CCPU_X_In_WordEx (short sFlg, unsigned short usXNo, unsigned short usSize, unsigned short* pusDataBuf,
unsigned short usBufSize)
Argument
Argument
Name
sFlg
Access flag
usXNo
Start input signal
usSize
Read data size
pusDataBuf
Data storage destination
usBufSize
Data storage destination size
Description
• This function reads an input signal (X) for the size specified to the read data size (usSize) from the start input signal (X)
specified to the start input signal (usXNo), and stores it in the data storage destination (pusDataBuf).
• Specify an area size of the data storage destination (pusDataBuf) to the data storage destination size (usBufSize).
• This function operates to the mounted module corresponding to the specified input signal (usXNo) regardless of the type of
the parameter setting (I/O assignment). When the specified area is "empty", this function ends normally without processing
(read data: 0). When it is "output module", the I/O assignment error occurs.
• Read data is stored in the data storage destination (pusDataBuf) in ascending order from the lower bit as shown below.
pusDataBuf
pusDataBuf[0]
pusDataBuf[1]
pusDataBuf[usSize-1]
Precautions
Note that the size of data storage destination (usBufSize) should be equal to or bigger than the read data size (usSize).
Return value
Return value
0 (0000H)
Other than 0
Relevant functions
• Page 159 CCPU_X_In_BitEx
• Page 163 CCPU_Y_Out_BitEx
• Page 164 CCPU_Y_Out_WordEx
• Page 161 CCPU_Y_In_BitEx
• Page 162 CCPU_Y_In_WordEx
3 DETAILS OF FUNCTION
160
3.1 C Controller Module Dedicated Functions
Description
Specify an access flag.
• 0: Normal access
• Others: Reserved
Specify a start input signal (X).
(Specify a multiple of 16.)
Specify the read data size in word units.
Specify the storage destination of read data.
Specify the data storage destination size in word units.
Description
Data of usXNo+FH to usXNo
Data of usXNo+1FH to usXNo+10H
Data of usXNo+(usSize-1)16+FH to usXNo+(usSize-1)16
Description
Normal
Error
For details on the error, refer to the following:
Page 225 ERROR CODE LIST
IN/OUT
IN
IN
IN
OUT
IN

Advertisement

Table of Contents
loading

Table of Contents