Mitsubishi Electric MELSEC iQ-R C R12CCPU-V User Manual page 139

Controller module
Hide thumbs Also See for MELSEC iQ-R C R12CCPU-V:
Table of Contents

Advertisement

Programming example
The following shows an example of cyclic transmission using C Controller module dedicated functions.
■Cyclic transmission program which is synchronized with link scans
1.
Register a cyclic data processing routine (A) for link refreshes with the C Controller dedicated function
(CCPU_EntryCCIEFBRefEndFunc).
2.
The registered routine (A) is executed by every link refreshes.
Operation of routine (A)
 Check if a cyclic transmission is operating normally with the C Controller module dedicated function (CCPU_ReadDevice).
 The sampled cyclic data is processed (refresh target device is accessed).
■Cyclic transmission program which is not synchronized with link scans
1.
Start data assurance for one link scan with the C Controller dedicated function (CCPU_StartCCIEFBDataAssurance).
2.
Configure an interlock in a program with the C Controller module dedicated function (CCPU_ReadDevice) to check if a
cyclic transmission is operating normally.
3.
The sampled cyclic data is processed (refresh target device is accessed).
4.
End data assurance for one link scan with the C Controller dedicated function (CCPU_EndCCIEFBDataAssurance).
By using the C Controller dedicated function (CCPU_StartCCIEFBDataAssurance), data inconsistency among
acquired device data can be prevented.
Precautions
During the assurance of one link scan data, link refresh is controlled. When the control period of link refresh exceeded the set
link scan time, the actual link scan time may exceed the set link scan time. (Consequently, link scan time is extended.)
Whether or not a link scan time is exceeding the set time can be checked by checking the maximum link scan time.
Parameter change example
The following shows an example to change parameters using a C Controller module dedicated function.
■Changing a cyclic transmission operation parameter
A link scan time and link refresh parameter can be changed by calling the C Controller module dedicated function
(CCPU_ChangeCCIEFBCycPrm). The changed link scan time and link refresh parameter can be restored to the default value
(which is set in the parameter) using the C Controller module dedicated function (CCPU_RestoreDefaultCCIEFBCycPrm).
• Changing link scan time (1) (parameter setting value: 100 ms)
(1)
25ms
50ms
100ms
CCPU_ChangeCCIEFBCycPrm(25)
CCPU_ChangeCCIEFBCycPrm(50)
CCPU_RestoreDefaultCCIEFBCycPrm()
7 CC-Link IE Field Network Basic FUNCTION
7.2 Programming
7
137

Advertisement

Table of Contents
loading

Table of Contents