Program Examples - Mitsubishi Electric MELSEC iQ-R Series User Manual

Profinet io device module
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Program examples

The IO controller (SIMATIC S7-1200) uses the big-endian byte order and the RJ71PN93 uses the little-endian byte order.
When the I/O data is exchanged between them, the byte order needs to be swapped by either the IO controller or the
RJ71PN93 to convert the endianness.
For the programs in this section, use the following:
• IO controller programsPage 37 When endianness is not converted
• IO device programPage 40 Program example of IO device
Program examples of IO controller
The following shows program examples of the IO controller (SIMATIC S7-1200).
Define tags as shown below.
Name
recv_word_data
recv_dword_data
send_word_data
send_dword_data
■When endianness is not converted
Network 1
Initial processing
Initial processing
Network 2
Receiving I/O data
%M0.0
"RefreshReq"
MOVE
EN
ENO
%IW68
#recv_word_
"recv_area_word"
IN
OUT1
data[0]
Network 3
Receive data processing
%M0.0
"RefreshReq"
Network 4
Send data processing
%M0.0
"RefreshReq"
Network 5
Sending I/O data
%M0.0
"RefreshReq"
MOVE
EN
ENO
#send_word_
%QW68
data[0]
IN
"send_area_
word"
OUT1
The above programs are for when the IO controller sends/receives I/O data. Swap the byte order of the I/O
data to convert the endianness using the IO device program.
Page 40 Program example of IO device
Data type
Array[0..63] of Word
Array[0..31] of DWord
Array[0..63] of Word
Array[0..31] of DWord
%M0.0
"RefreshReq"
MOVE
EN
ENO
#recv_dword_
%ID196
OUT1
"recv_area_
data[0]
dword"
IN
Receive data processing
Send data processing
MOVE
EN
ENO
#send_dword_
%QD196
data[0]
IN
"send_area_
dword"
OUT1
Comment
Receive data (unit: word)
Receive data (unit: double-word)
Send data (unit: word)
Send data (unit: double-word)
■Initial processing
Execute initial processing with the program (Network 1).
■Receive data processing
Transfer data as follows by executing the program (Network 2): The first data
stored in the IO data receive area (slot 3, unit: word) tag is transferred to the
first area of the receive data (unit: word) tag in "local". The first data stored in
the IO data receive area (slot 4, unit: double-word) tag is transferred to the first
area of the receive data (unit: double-word) tag in "local".
Execute receive data processing with the program (Network 3).
■Send data processing
Execute send data processing with the program (Network 4).
Transfer data as follows by executing the program (Network 5): The first data
stored in the receive data (unit: word) tag in "local" is transferred to the first
area of the IO data send area (slot 1, unit: word) tag. The first data stored in the
receive data (unit: double-word) tag in "local" is transferred to the first area of
the IO data send area (slot 2, unit: double-word) tag.
7 COMMUNICATION EXAMPLE
7.1 Example of I/O Data Exchanges
7
37

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec iq-rj71pn93

Table of Contents