0% found this document useful (0 votes)
34 views28 pages

MELSEC iQ-R Serial Communication Module Function Block Reference

Uploaded by

Jackam kam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views28 pages

MELSEC iQ-R Serial Communication Module Function Block Reference

Uploaded by

Jackam kam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

MELSEC iQ-R Serial Communication Module

Function Block Reference


CONTENTS
CHAPTER 1 FUNCTION BLOCK (FB) LIST 2

CHAPTER 2 SERIAL COMMUNICATION MODULE FB 4


2.1 M+RJ71C24_SendOndemand. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 M+RJ71C24_Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.3 M+RJ71C24_Input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

CONTENTS
2.4 M+RJ71C24_BidirectionalOutput. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5 M+RJ71C24_BidirectionalInput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.6 M+RJ71C24_ReadInstructionBusy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.7 M+RJ71C24_SendUserFrame. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.8 M+RJ71C24_PutUserFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.9 M+RJ71C24_GetUserFrame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.10 M+RJ71C24_ExeCommonProtocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
REVISIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24

1
1 FUNCTION BLOCK (FB) LIST
This chapter lists the FBs for the MELSEC iQ-R series serial communication module.
Name*1 Description
M+RJ71C24_SendOndemand Sends data using the on-demand function of SLMP (MC protocol).
M+RJ71C24_Output Sends data for a specified data points.
M+RJ71C24_Input Reads the received data.
M+RJ71C24_BidirectionalOutput Sends data for a specified data points.
M+RJ71C24_BidirectionalInput Reads the received data.
M+RJ71C24_ReadInstructionBusy Reads the transmission status of the data sent/received using the dedicated instructions or FBs.
M+RJ71C24_SendUserFrame Sends data using the nonprocedural protocol communication and the user frame according to the
setting of the user frame specification area for sending data.
M+RJ71C24_PutUserFrame Registers and deletes the user frame.
M+RJ71C24_GetUserFrame Reads the user frame.
M+RJ71C24_ExeCommonProtocol Executes the protocol registered with GX Works3.

*1 Note that this reference does not describe the FB version information which is displayed such as "_00A" at the end of FB name.

1 FUNCTION BLOCK (FB) LIST


2
MEMO
1

1 FUNCTION BLOCK (FB) LIST


3
2 SERIAL COMMUNICATION MODULE FB

2.1 M+RJ71C24_SendOndemand

Name
M+RJ71C24_SendOndemand

Overview
Item Description
Overview Sends data using the on-demand function of SLMP (MC protocol).
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻿㼑㼚㼐㻻㼚㼐㼑㼙㼍㼚㼐
(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋㼎㻱㻺㻻䠖㻮 (6)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑 㼛㼋㼎㻻㻷䠖㻮 (7)

(3) 㼁㼃䠖㼕㼋㼡㻯㼔 㼛㼋㼎㻱㼞㼞䠖㻮 (8)

(4) 㼁㼃䠖㼕㼋㼡㻿㼑㼚㼐㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔 㼛㼋㼡㻱㼞㼞㻵㼐䠖㼁㼃 (9)

(5) 㼃䠖㼕㼋㼡㻿㼑㼚㼐㻰㼍㼠㼍

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)
(3) Send channel i_uCh Word [Unsigned]/ 1, 2 Set the channel to which the data is sent.
Bit String [16-bit] • 1: Channel 1 (CH1 side)
• 2: Channel 2 (CH2 side)
(4) Number of send i_uSendDataLength Word [Unsigned]/ 1 or more Set the number of send data points in the units (word/
data points Bit String [16-bit] byte) specified to the following area of the buffer
memory.
• Channel 1 (CH1 side): 150 (96H)
• Channel 2 (CH2 side): 310 (136H)
(5) Send data storage i_uSendData Word [Unsigned]/  Set the start address of the device where the send data
device Bit String [16-bit] is stored.

■Output label
No. Name Variable name Data type Default value Description
(6) Execution status o_bENO Bit OFF ON: The execution command is ON.
OFF: The execution command is OFF.
(7) Normal completion o_bOK Bit OFF This label turns ON for one scan when the operation is
completed normally.
(8) Error completion o_bErr Bit OFF This label turns ON for one scan when the operation is
completed with an error.
(9) Error code o_uErrId Word [Unsigned]/ 0 Stores the error code that has occurred in the FB.
Bit String [16-bit]

2 SERIAL COMMUNICATION MODULE FB


4 2.1 M+RJ71C24_SendOndemand
FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
2
Language Ladder diagram
Number of basic steps 46 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), data is sent using the on-demand function of SLMP (MC protocol).
FB compilation method Macro type
FB operation Pulse type (multiple scan execution type)
Timing chart of I/O signals ■In normal completion

i_bEN

o_bENO

o_bOK

o_bErr

o_uErrId 0H

■In error completion (also the same for a module error)

i_bEN

o_bENO

o_bOK

o_bErr

o_uErrId 0H Error code 0H

Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction GP.ONDEMAND.
• Turn OFF i_bEN (Execution command) after o_bOK (Normal completion) or o_bErr (Error completion) is turned ON. By
turning OFF i_bEN (Execution command), o_bOK (Normal completion) and o_bErr (Error completion) are turned OFF and
o_uErrId (Error code) is cleared to 0.

Error code
The error code is the same as the one that generates when the G(P).ONDEMAND instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.1 M+RJ71C24_SendOndemand 5
2.2 M+RJ71C24_Output

Name
M+RJ71C24_Output

Overview
Item Description
Overview Sends the specified data using the nonprocedural protocol.
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻻㼡㼠㼜㼡㼠
(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋㼎㻱㻺㻻䠖㻮 (6)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑 㼛㼋㼎㻻㻷䠖㻮 (7)

(3) 㼁㼃䠖㼕㼋㼡㻯㼔 㼛㼋㼎㻱㼞㼞䠖㻮 (8)

(4) 㼁㼃䠖㼕㼋㼡㻿㼑㼚㼐㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔 㻻㼋㼡㻱㼞㼞㻵㼐䠖㼁㼃 (9)

(5) 㼁㼃䠖㼕㼋㼡㻿㼑㼚㼐㻰㼍㼠㼍

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)
(3) Send channel i_uCh Word [Unsigned]/ 1, 2 Set the channel to which the data is sent.
Bit String [16-bit] • 1: Channel 1 (CH1 side)
• 2: Channel 2 (CH2 side)
(4) Number of send i_uSendDataLength Word [Unsigned]/ 1 or more Set the number of send data points in the units (word/
data points Bit String [16-bit] byte) specified to the following area of the buffer
memory.
• Channel 1 (CH1 side): 150 (96H)
• Channel 2 (CH2 side): 310 (136H)
(5) Send data storage i_uSendData Word [Unsigned]/  Set the start address of the device where the send data
device Bit String [16-bit] is stored.

■Output label
No. Name Variable name Data type Default value Description
(6) Execution status o_bENO Bit OFF ON: The execution command is ON.
OFF: The execution command is OFF.
(7) Normal completion o_bOK Bit OFF This label turns ON for one scan when the operation is
completed normally.
(8) Error completion o_bErr Bit OFF This label turns ON for one scan when the operation is
completed with an error.
(9) Error code o_uErrId Word [Unsigned]/ 0 Stores the error code that has occurred in the FB.
Bit String [16-bit]

2 SERIAL COMMUNICATION MODULE FB


6 2.2 M+RJ71C24_Output
FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
2
Language Ladder diagram
Number of basic steps 46 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), data is sent in any message format using the nonprocedural protocol.
FB compilation method Macro type
FB operation Pulse execution (multiple scan execution type)
Timing chart of I/O signals The operation of the I/O signals is the same as the one for the following FB.
Page 4 M+RJ71C24_SendOndemand
Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction GP.OUTPUT.
• Turn OFF i_bEN (Execution command) after o_bOK (Normal completion) or o_bErr (Error completion) is turned ON. By
turning OFF i_bEN (Execution command), o_bOK (Normal completion) and o_bErr (Error completion) are turned OFF and
o_uErrId (Error code) is cleared to 0.

Error code
The error code is the same as the one that generates when the G(P).OUTPUT instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.2 M+RJ71C24_Output 7
2.3 M+RJ71C24_Input

Name
M+RJ71C24_Input

Overview
Item Description
Overview Reads the data received using the nonprocedural protocol.
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻵㼚㼜㼡㼠
(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋㼎㻱㻺㻻䠖㻮 (5)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑 㼛㼋㼎㻻㻷䠖㻮 (6)

(3) 㼁㼃䠖㼕㼋㼡㻯㼔 㼛㼋㼎㻱㼞㼞䠖㻮 (7)

(4) 㼁㼃䠖㼕㼋㼡㻹㼍㼤㻾㼑㼏㼢㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔 㼛㼋㼡㻱㼞㼞㻵㼐䠖㼁㼃 (8)

㼛㼋㼡㻾㼑㼏㼢㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔䠖㼁㼃 (9)

㼛㼋㼡㻾㼑㼏㼢㻰㼍㼠㼍䠖㼁㼃 (10)

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)
(3) Receive channel i_uCh Word [Unsigned]/ 1, 2 Set the channel that receives the data.
Bit String [16-bit] • 1: Channel 1 (CH1 side)
• 2: Channel 2 (CH2 side)
(4) Allowable number i_uMaxRecvDataLen Word [Unsigned]/ 0 or more Set the allowable number of words of the receive data
of receive data gth Bit String [16-bit] that can be stored in the receive data storage device.
points

■Output label
No. Name Variable name Data type Default value Description
(5) Execution status o_bENO Bit OFF ON: The execution command is ON.
OFF: The execution command is OFF.
(6) Normal completion o_bOK Bit OFF This label turns ON for one scan when the operation is
completed normally.
(7) Error completion o_bErr Bit OFF This label turns ON for one scan when the operation is
completed with an error.
(8) Error code o_uErrId Word [Unsigned]/ 0 Stores the generated error code.
Bit String [16-bit]
(9) Number of receive o_uRecvDataLength Word [Unsigned]/ 0 Set the start address of the device to store the number of
data points Bit String [16-bit] receive data points.
• Channel 1 (CH1 side): 150 (96H)
• Channel 2 (CH2 side): 310 (136H)
(10) Receive data o_uRecvData Word [Unsigned]/ 0 Set the start address of the device to store the receive
storage device Bit String [16-bit] data.

2 SERIAL COMMUNICATION MODULE FB


8 2.3 M+RJ71C24_Input
FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
2
Language Ladder diagram
Number of basic steps 46 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), data is received in any message format using the nonprocedural protocol.
FB compilation method Macro type
FB operation Pulse execution (multiple scan execution type)
Timing chart of I/O signals The operation of the I/O signals is the same as the one for the following FB.
Page 4 M+RJ71C24_SendOndemand
Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction G.INPUT.
• Turn OFF i_bEN (Execution command) after o_bOK (Normal completion) or o_bErr (Error completion) is turned ON. By
turning OFF i_bEN (Execution command), o_bOK (Normal completion) and o_bErr (Error completion) are turned OFF and
o_uErrId (Error code) is cleared to 0.

Error code
The error code is the same as the one that generates when the G.INPUT instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.3 M+RJ71C24_Input 9
2.4 M+RJ71C24_BidirectionalOutput

Name
M+RJ71C24_BidirectionalOutput

Overview
Item Description
Overview Sends the specified data using the bidirectional protocol.
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻮㼕㼐㼕㼞㼑㼏㼠㼕㼛㼚㼍㼘㻻㼡㼠㼜㼡㼠
(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋㼎㻱㻺㻻䠖㻮 (6)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑 㼛㼋㼎㻻㻷䠖㻮 (7)

(3) 㼁㼃䠖㼕㼋㼡㻯㼔 㼛㼋㼎㻱㼞㼞䠖㻮 (8)

(4) 㼁㼃䠖㼕㼋㼡㻿㼑㼚㼐㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔 㼛㼋㼡㻱㼞㼞㻵㼐䠖㼁㼃 (9)

(5) 㼁㼃䠖㼕㼋㼡㻿㼑㼚㼐㻰㼍㼠㼍

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)
(3) Send channel i_uCh Word [Unsigned]/ 1, 2 Set the channel to which the data is sent.
Bit String [16-bit] • 1: Channel 1 (CH1 side)
• 2: Channel 2 (CH2 side)
(4) Number of send i_uSendDataLength Word [Unsigned]/ 1 or more Set the number of send data points in the units (word/
data points Bit String [16-bit] byte) specified to the following area of the buffer
memory.
• Channel 1 (CH1 side): 150 (96H)
• Channel 2 (CH2 side): 310 (136H)
(5) Send data storage i_uSendData Word [Unsigned]/  Set the start address of the device where the send data
device Bit String [16-bit] is stored.

■Output label
No. Name Variable name Data type Default value Description
(6) Execution status o_bENO Bit OFF ON: The execution command is ON.
OFF: The execution command is OFF.
(7) Normal completion o_bOK Bit OFF This label turns ON for one scan when the operation is
completed normally.
(8) Error completion o_bErr Bit OFF This label turns ON for one scan when the operation is
completed with an error.
(9) Error code o_uErrId Word [Unsigned]/ 0 Stores the generated error code.
Bit String [16-bit]

2 SERIAL COMMUNICATION MODULE FB


10 2.4 M+RJ71C24_BidirectionalOutput
FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
2
Language Ladder diagram
Number of basic steps 45 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), data is sent using the bidirectional protocol.
FB compilation method Macro type
FB operation Pulse execution (multiple scan execution type)
Timing chart of I/O signals The operation of the I/O signals is the same as the one for the following FB.
Page 4 M+RJ71C24_SendOndemand
Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction GP.BIDOUT.
• Turn OFF i_bEN (Execution command) after o_bOK (Normal completion) or o_bErr (Error completion) is turned ON. By
turning OFF i_bEN (Execution command), o_bOK (Normal completion) and o_bErr (Error completion) are turned OFF and
o_uErrId (Error code) is cleared to 0.

Error code
The error code is the same as the one that generates when the G(P).BIDOUT instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.4 M+RJ71C24_BidirectionalOutput 11
2.5 M+RJ71C24_BidirectionalInput

Name
M+RJ71C24_BidirectionalInput

Overview
Item Description
Overview Reads the data received using the bidirectional protocol.
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻮㼕㼐㼕㼞㼑㼏㼠㼕㼛㼚㼍㼘㻵㼚㼜㼡㼠

(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋㼎㻱㻺㻻䠖㻮 (5)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑 㼛㼋㼎㻻㻷䠖㻮 (6)

(3) 㼁㼃䠖㼕㼋㼡㻯㼔 㼛㼋㼎㻱㼞㼞䠖㻮 (7)

(4) 㼁㼃䠖㼕㼋㼡㻹㼍㼤㻾㼑㼏㼢㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔 㼛㼋㼡㻱㼞㼞㻵㼐 䠖㼁㼃 (8)

㼛㼋㼡㻾㼑㼏㼢㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔䠖㼁㼃 (9)

㼛㼋㼡㻾㼑㼏㼢㻰㼍㼠㼍䠖㼁㼃 (10)

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)
(3) Receive channel i_uCh Word [Unsigned]/ 1, 2 Set the channel that receives the data.
Bit String [16-bit] • 1: Channel 1 (CH1 side)
• 2: Channel 2 (CH2 side)
(4) Allowable number i_uMaxRecvDataLen Word [Unsigned]/ 0 or more Set the allowable number of words of the receive data
of receive data gth Bit String [16-bit] that can be stored in the receive data storage device.
points

■Output label
No. Name Variable name Data type Default value Description
(5) Execution status o_bENO Bit OFF ON: The execution command is ON.
OFF: The execution command is OFF.
(6) Normal completion o_bOK Bit OFF This label turns ON for one scan when the operation is
completed normally.
(7) Error completion o_bErr Bit OFF This label turns ON for one scan when the operation is
completed with an error.
(8) Error code o_uErrId Word [Unsigned]/ 0 Stores the generated error code.
Bit String [16-bit]
(9) Number of receive o_uRecvDataLength Word [Unsigned]/ 0 Set the start address of the device to store the number of
data points Bit String [16-bit] receive data points.
• Channel 1 (CH1 side): 150 (96H)
• Channel 2 (CH2 side): 310 (136H)
(10) Receive data o_uRecvData Word [Unsigned]/ 0 Set the start address of the device to store the receive
storage device Bit String [16-bit] data.

2 SERIAL COMMUNICATION MODULE FB


12 2.5 M+RJ71C24_BidirectionalInput
FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
2
Language Ladder diagram
Number of basic steps 46 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), data is received in any message format using the bidirectional protocol.
FB compilation method Macro type
FB operation Pulse execution (multiple scan execution type)
Timing chart of I/O signals The operation of the I/O signals is the same as the one for the following FB.
Page 4 M+RJ71C24_SendOndemand
Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction G.BIDIN.
• Turn OFF i_bEN (Execution command) after o_bOK (Normal completion) or o_bErr (Error completion) is turned ON. By
turning OFF i_bEN (Execution command), o_bOK (Normal completion) and o_bErr (Error completion) are turned OFF and
o_uErrId (Error code) is cleared to 0.

Error code
The error code is the same as the one that generates when the G(P).BIDIN instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.5 M+RJ71C24_BidirectionalInput 13
2.6 M+RJ71C24_ReadInstructionBusy

Name
M+RJ71C24_ReadInstructionBusy

Overview
Item Description
Overview Reads the transmission status of the data sent/received using the dedicated instructions or FBs.
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻾㼑㼍㼐㻵㼚㼟㼠㼞㼡㼏㼠㼕㼛㼚㻮㼡㼟㼥
(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋 㼡㻯㼛㼙㼙㼡㼚㼕㼏㼍㼠㼕㼛㼚㻿㼠㼍㼠㼡㼟䠖㼁㼃 (3)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)

■Output label
No. Name Variable name Data type Default value Description
(3) Transmission status o_uCommunicationSt Word [Unsigned]/ 0 When the processing using each instruction starts, '1' is
storage device atus Bit String [16-bit] stored in the corresponding bit. When the processing is
completed, '0' is stored.
The following shows the timing when the processing of
each instruction is completed.
• FB: The execution status is turned ON and OFF.
• Dedicated instruction: The completed flag is turned
ON and OFF.
■1st word
• b0: Stores the execution status of the ONDEMAND,
OUTPUT, PRR, and BIDOUT instructions directed at
channel 1.
• b1: Stores the execution status of the INPUT and
BIDIN instructions directed at channel 1.
• b2: Stores the execution status of the ONDEMAND,
OUTPUT, PRR, and BIDOUT instructions directed at
channel 2.
• b3: Stores the execution status of the INPUT and
BIDIN instructions directed at channel 2.
• b4: Stores the execution status of the GETE and
PUTE instructions.
• b5: Stores the execution status of the CPRTCL
instruction directed at channel 1.
• b6: Stores the execution status of the CPRTCL
instruction directed at channel 2.
• b7 to b15: Always stores '0'.
■2nd word
• b0 to b15: Always stores '0'.

2 SERIAL COMMUNICATION MODULE FB


14 2.6 M+RJ71C24_ReadInstructionBusy
FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
2
Language Ladder diagram
Number of basic steps 10 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), the execution status of the FB or the dedicated instruction for the target module is
read.
FB compilation method Macro type
FB operation • Pulse execution (multiple scan execution type)
• Always executed
Timing chart of I/O signals
i_bEN

o_uCommunicationStatus Result

Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction GP.SPBUSY.

Error code
The error code is the same as the one that generates when the G(P).SPBUSY instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.6 M+RJ71C24_ReadInstructionBusy 15
2.7 M+RJ71C24_SendUserFrame

Name
M+RJ71C24_SendUserFrame

Overview
Item Description
Overview Sends data using the nonprocedural protocol communication and the user frame according to the setting of the user frame
specification area for sending data.
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻿㼑㼚㼐㼁㼟㼑㼞㻲㼞㼍㼙㼑
(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋㼎㻱㻺㻻䠖㻮 (7)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑 㼛㼋㼎㻻㻷䠖㻮 (8)

(3) 㼁㼃䠖㼕㼋㼡㻯㼔 㼛㼋㼎㻱㼞㼞䠖㻮 (9)

(4) 㼁㼃䠖 㼕㼋㼡㻯㼞㻸㼒㻿㼑㼠㼠㼕㼚㼓 㼛㼋㼡㻱㼞㼞㻵㼐䠖㼁㼃 (10)

(5) 㼁㼃䠖 㼕㼋㼡㻿㼑㼚㼐㻲㼞㼍㼙㼑㻼㼛㼕㼚㼠㼑㼞

(6) 㼁㼃䠖 㼕㼋㼡㻿㼑㼚㼐㻲㼞㼍㼙㼑㻯㼛㼡㼚㼠

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)
(3) Send channel i_uCh Word [Unsigned]/ 1, 2 Set the channel to which the data is sent.
Bit String [16-bit] • 1: Channel 1 (CH1 side)
• 2: Channel 2 (CH2 side)
(4) Additional i_uCrLfSetting Word [Unsigned]/ 0, 1 Set whether or not to add CR/LF to the send data.
specification of CR/ Bit String [16-bit] • 0: CR/LF is not added.
LF • 1: CR/LF is added.
(5) Send pointer i_uSendFramePointer Word [Unsigned]/ 1 to 100 Set the position in the user frame specification area from
Bit String [16-bit] where the frame number data is sent.
(6) Number of outputs i_uSendFrameCount Word [Unsigned]/ 1 to 100 Set the number of user frames to send.
Bit String [16-bit]

■Output label
No. Name Variable name Data type Default value Description
(7) Execution status o_bENO Bit OFF ON: The execution command is ON.
OFF: The execution command is OFF.
(8) Normal completion o_bOK Bit OFF This label turns ON for one scan when the operation is
completed normally.
(9) Error completion o_bErr Bit OFF This label turns ON for one scan when the operation is
completed with an error.
(10) Error code o_uErrId Word [Unsigned]/ 0 Stores the generated error code.
Bit String [16-bit]

2 SERIAL COMMUNICATION MODULE FB


16 2.7 M+RJ71C24_SendUserFrame
FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
2
Language Ladder diagram
Number of basic steps 47 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), data is sent using the nonprocedural protocol and the user frame according to the
setting of the user frame specification area for sending data.
FB compilation method Macro type
FB operation Pulse execution (multiple scan execution type)
Timing chart of I/O signals The operation of the I/O signals is the same as the one for the following FB.
Page 4 M+RJ71C24_SendOndemand
Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction GP.PRR.
• Turn OFF i_bEN (Execution command) after o_bOK (Normal completion) or o_bErr (Error completion) is turned ON. By
turning OFF i_bEN (Execution command), o_bOK (Normal completion) and o_bErr (Error completion) are turned OFF and
o_uErrId (Error code) is cleared to 0.

Error code
The error code is the same as the one that generates when the G(P).PRR instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.7 M+RJ71C24_SendUserFrame 17
2.8 M+RJ71C24_PutUserFrame

Name
M+RJ71C24_PutUserFrame

Overview
Item Description
Overview Registers and deletes user frames according to the setting value of the request type.
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻼㼡㼠㼁㼟㼑㼞㻲㼞㼍㼙㼑
(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋㼎㻱㻺㻻䠖㻮 (7)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑 㼛㼋㼎㻻㻷䠖㻮 (8)

(3) 㼁㼃 㻦 㼕㼋㼡㻾㼑㼝㼡㼑㼟㼠㼀㼥㼜㼑 㼛㼋㼎㻱㼞㼞䠖㻮 (9)

(4) 㼁㼃 㻦 㼕㼋㼡㻲㼞㼍㼙㼑㻺㼛 㼛㼋㼡㻱㼞㼞㻵㼐䠖㼁㼃 (10)

(5) 㼁㼃 㻦 㼕㼋㼡㻲㼞㼍㼙㼑㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔

(6) 㼁㼃 㻦 㼕㼋㼡㻲㼞㼍㼙㼑㻰㼍㼠㼍

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)

• Request type = 1: When the user frame is registered


No. Name Variable name Data type Range Description
(3) Request type i_uRequestType Word [Unsigned]/ 1 When the initial setting is performed using this FB, set
Bit String [16-bit] Request type = 1.
(4) Registration frame i_uFramelNo Word [Unsigned]/ 1000 to 1199 Set the user frame number to be registered.
No. Bit String [16-bit]
(5) Number of i_uFrameDataLength Word [Unsigned]/ 1 to 80 Set the number of bytes for the user frame to be
registration bytes Bit String [16-bit] registered.
(6) Registration frame i_uFrameData Word [Unsigned]/ Shown on the right Set the data to be registered.
storage device Bit String [16-bit] When it is specified using the label, use "ARRAY" for the
(0..39) data type.

• Request type = 3: When the user frame is deleted


No. Name Variable name Data type Range Description
(3) Request type i_uRequestType Word [Unsigned]/ 3 When the initial setting is performed using this FB, set
Bit String [16-bit] Request type = 3.
(4) Registration frame i_uFramelNo Word [Unsigned]/ 1000 to 1199 Set the user frame number to be registered.
No. Bit String [16-bit]
(5) Number of i_uFrameDataLength Word [Unsigned]/ 1 to 80 Specify 1 to 80 as a dummy when the frame is deleted.
registration bytes Bit String [16-bit]
(6) Registration frame i_uFrameData Word [Unsigned]/ Shown on the right Specify the same value at the registration.
storage device Bit String [16-bit] When it is specified using the label, use "ARRAY" for the
(0..39) data type.

■Output label
No. Name Variable name Data type Default value Description
(7) Execution status o_bENO Bit OFF ON: The execution command is ON.
OFF: The execution command is OFF.

2 SERIAL COMMUNICATION MODULE FB


18 2.8 M+RJ71C24_PutUserFrame
No. Name Variable name Data type Default value Description
(8) Normal completion o_bOK Bit OFF This label turns ON for one scan when the operation is
completed normally.
(9) Error completion o_bErr Bit OFF This label turns ON for one scan when the operation is
completed with an error.
(10) Error code o_uErrId Word [Unsigned]/ 0 Stores the error code that has occurred in the FB.
Bit String [16-bit] 2
FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
Language Ladder diagram
Number of basic steps 50 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), the user frame is registered.
FB compilation method Macro type
FB operation Pulse execution (multiple scan execution type)
Timing chart of I/O signals The operation of the I/O signals is the same as the one for the following FB.
Page 4 M+RJ71C24_SendOndemand
Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction GP.PUTE.
• Turn OFF i_bEN (Execution command) after o_bOK (Normal completion) or o_bErr (Error completion) is turned ON. By
turning OFF i_bEN (Execution command), o_bOK (Normal completion) and o_bErr (Error completion) are turned OFF and
o_uErrId (Error code) is cleared to 0.

Error code
The error code is the same as the one that generates when the G(P).PUTE instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.8 M+RJ71C24_PutUserFrame 19
2.9 M+RJ71C24_GetUserFrame

Name
M+RJ71C24_GetUserFrame

Overview
Item Description
Overview Reads the user frame.
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻳㼑㼠㼁㼟㼑㼞㻲㼞㼍㼙㼑

(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋㼎㻱㻺㻻䠖㻮 (5)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑 㼛㼋㼎㻻㻷䠖㻮 (6)

(3) 㼁㼃 㻦 㼕㼋 㼡㻲㼞㼍㼙㼑㻺㼛 㼛㼋㼎㻱㼞㼞䠖㻮 (7)

(4) 㼁㼃 㻦 㼕㼋㼡㻹㼍㼤㻲㼞㼍㼙㼑㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔 㼛㼋㼡㻱㼞㼞㻵㼐䠖㼁㼃 (8)

㼛㼋㼡㻲㼞㼍㼙㼑㻰㼍㼠㼍㻸㼑㼚㼓㼠㼔䠖㼁㼃 (9)

㼛㼋㼡㻲㼞㼍㼙㼑㻰㼍㼠㼍䠖㼁㼃 (10)

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)
(3) Read frame No. i_FramelNo Word [Unsigned]/ 1000 to 1199 Set the user frame number to be read.
Bit String [16-bit]
(4) Read-allowable i_MaxFrameDataLen Word [Unsigned]/ 1 to 80 Set the number of bytes of the read registration data to
number of bytes gth Bit String [16-bit] be stored in the registration data storage device
(o_uFrameData).

■Output label
No. Name Variable name Data type Default value Description
(5) Execution status o_bENO Bit OFF ON: The execution command is ON.
OFF: The execution command is OFF.
(6) Normal completion o_bOK Bit OFF This label turns ON for one scan when the operation is
completed normally.
(7) Error completion o_bErr Bit OFF This label turns ON for one scan when the operation is
completed with an error.
(8) Error code o_uErrId Word [Unsigned]/ 0 Stores the error code that has occurred in the FB.
Bit String [16-bit]
(9) Number of o_uFrameDataLength Word [Unsigned]/ 0 Set the start address of the device to store the number of
registration bytes Bit String [16-bit] bytes of the read registration data.
(10) Registration data o_uFrameData Word [Unsigned]/ 0 Set the start address of the device to store the read
storage device Bit String [16-bit] registration data.

2 SERIAL COMMUNICATION MODULE FB


20 2.9 M+RJ71C24_GetUserFrame
FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
2
Language Ladder diagram
Number of basic steps 46 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), the user frame is read.
FB compilation method Macro type
FB operation Pulse execution (multiple scan execution type)
Timing chart of I/O signals The operation of the I/O signals is the same as the one for the following FB.
Page 4 M+RJ71C24_SendOndemand
Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction GP.GETE.
• Turn OFF i_bEN (Execution command) after o_bOK (Normal completion) or o_bErr (Error completion) is turned ON. By
turning OFF i_bEN (Execution command), o_bOK (Normal completion) and o_bErr (Error completion) are turned OFF and
o_uErrId (Error code) is cleared to 0.

Error code
The error code is the same as the one that generates when the G(P).GETE instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.9 M+RJ71C24_GetUserFrame 21
2.10 M+RJ71C24_ExeCommonProtocol

Name
M+RJ71C24_ExeCommonProtocol

Overview
Item Description
Overview Executes the protocol registered with GX Works3.
Symbol
㻹㻗㻾㻶㻣㻝㻯㻞㻠㼋㻱㼤㼑㻯㼛㼙㼙㼛㼚㻼㼞㼛㼠㼛㼏㼛㼘
(1) 㻮䠖㼕㼋㼎㻱㻺 㼛㼋㼎㻱㻺㻻䠖㻮 (6)

(2) 㻰㼁㼀䠖㼕㼋㼟㼠㻹㼛㼐㼡㼘㼑 㼛㼋㼎㻻㻷䠖㻮 (7)

(3) 㼁㼃䠖㼕㼋㼡㻯㼔 㼛㼋㼎㻱㼞㼞䠖㻮 (8)

(4) 㼁㼃䠖㼕㼋㼡㻺㼡㼙㼎㼑㼞㻻㼒㻱㼤㼑㼏㼡㼠㼕㼛㼚㼟 㼛㼋㼡㻱㼞㼞㻵㼐䠖㼁㼃 (9)

(5) 㼁㼃䠖㼕㼋㼡㻱㼤㼑㻼㼞㼛㼠㼛㼏㼛㼘㻺㼛 㼛㼋㼡㻺㼡㼙㼎㼑㼞㻻㼒㻱㼤㼑㼏㼡㼠㼕㼛㼚㼟䠖㼁㼃 (10)

㼛㼋㼡㻹㼍㼠㼏㼔㻼㼍㼏㼗㼑㼠㻺㼛䠖㼁㼃 (11)

Labels
■Input label
No. Name Variable name Data type Range Description
(1) Execution i_bEN Bit  ON: The FB is activated.
command OFF: The FB is not activated.
(2) Module label i_stModule Structures  Specify the module to execute this FB.
Specify the module label of relevant modules.
(example: C24_1)
(3) Communication i_uCh Word [Unsigned]/ 1, 2 Set the channel to communicate with the external
channel Bit String [16-bit] device.
• 1: Channel 1 (CH1 side)
• 2: Channel 2 (CH2 side)
(4) Number of i_uNumberOfExecutio Word [Unsigned]/ 1 to 8 Set the number of continuous executions of the protocol.
continuous protocol ns Bit String [16-bit]
executions
(5) Execution protocol i_uExeProtocolNo Word [Unsigned]/ 1 to 128, 201 to 207 Set the protocol number or the special protocol number
number Bit String [16-bit] to be executed. Protocols are executed in the specified
specification (0..7) order of the execution protocol numbers.

Execution protocol
+0
number specification 1

Execution protocol
+7
number specification 8

When it is specified using the label, use "ARRAY" for the


data type.

■Output label
No. Name Variable name Data type Default value Description
(6) Execution status o_bENO Bit OFF ON: The execution command is ON.
OFF: The execution command is OFF.
(7) Normal completion o_bOK Bit OFF This label turns ON for one scan when the operation is
completed normally.
(8) Error completion o_bErr Bit OFF This label turns ON for one scan when the operation is
completed with an error.
(9) Error code o_uErrId Word [Unsigned]/ 0 Stores the error code that has occurred in the FB.
Bit String [16-bit]

2 SERIAL COMMUNICATION MODULE FB


22 2.10 M+RJ71C24_ExeCommonProtocol
No. Name Variable name Data type Default value Description
(10) Number of protocol o_uNumberOfExecuti Word [Unsigned]/ 0 The number of protocol executions is stored. The
executions ons Bit String [16-bit] protocol in which an error has occurred is included in the
number of executions. If the setting data and the setting
details of the control data are incorrect, 0 is stored.
(11) Matched receive o_uMatchPacketNo Word [Unsigned]/ 0

2
packet No. Bit String [16-bit] Matched receive
+0
packet No.1
(0..7)

Matched receive
+7
packet No.8

A value is stored in the area corresponding to the


execution protocol number.
When the communication type of the executed protocol
is "Send only" or "Send and receive", the receive packet
number that matches with the executed protocol, is
stored.
In the following cases, 0 is stored.
• When the communication type is "Receive only"
• When an error occurs in the executed protocol
• When a special protocol is used
When it is specified using the label, use "ARRAY" for the
data type.

FB details
Item Description
Available device Target module R series C24
CPU module MELSEC iQ-R series CPU modules
Engineering tool GX Works3
Language Ladder diagram
Number of basic steps 58 steps
The number of steps of the FB in a program depends on the CPU model used and input and output definition.
Processing By turning ON i_bEN (Execution command), the protocol written to the flash ROM using the predefined protocol support
function and executing the special protocol.
FB compilation method Macro type
FB operation Pulse execution (multiple scan execution type)
Timing chart of I/O signals The operation of the I/O signals is the same as the one for the following FB.
Page 4 M+RJ71C24_SendOndemand
Restrictions or precautions • This FB does not include the error recovery processing. Program the error recovery processing separately in accordance
with the required system operation.
• This FB uses the dedicated instruction GP.CPRTCL.
• Turn OFF i_bEN (Execution command) after o_bOK (Normal completion) or o_bErr (Error completion) is turned ON. By
turning OFF i_bEN (Execution command), o_bOK (Normal completion) and o_bErr (Error completion) are turned OFF and
o_uErrId (Error code) is cleared to 0.

Error code
The error code is the same as the one that generates when the G(P).CPRTCL instruction is used. Refer to MELSEC iQ-R
Programming Manual (Instructions, Standard Functions/Function Blocks).

2 SERIAL COMMUNICATION MODULE FB


2.10 M+RJ71C24_ExeCommonProtocol 23
REVISIONS
*The manual number is given on the bottom left of the back cover.
Revision date *Manual number Description
June 2014 BCN-P5999-0379-A First edition
July 2014 BCN-P5999-0379-B Partial correction
March 2016 BCN-P5999-0379-C Partial correction

Japanese manual number: BCN-5999-0370C


This manual confers no industrial property rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held
responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.

2014 MITSUBISHI ELECTRIC CORPORATION

24
BCN-P5999-0379-C(1603)

HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN
NAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN

When exported from Japan, this manual does not require application to the
Ministry of Economy, Trade and Industry for service transaction permission.

Specifications subject to change without notice.

You might also like