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

Mitsubishi Electric MELSEC iQ-R C Series Programming Manual

Controller module
Table of Contents

Advertisement

Quick Links

MELSEC iQ-R C Controller Module
Programming Manual

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi Electric MELSEC iQ-R C Series

  • Page 1 MELSEC iQ-R C Controller Module Programming Manual...
  • Page 3: Safety Precautions

    Notwithstanding the above restrictions, Mitsubishi Electric may in its sole discretion, authorize use of the PRODUCT in one or more of the Prohibited Applications, provided that the usage of the PRODUCT is limited only for the specific applications agreed to by Mitsubishi Electric and provided further that no special quality assurance or fail-safe, redundant or other safety features which exceed the general specifications of the PRODUCTs are required.
  • Page 4: Considerations For Use

    • Wind River Systems, Inc.: www.windriver.com INTRODUCTION Thank you for purchasing the Mitsubishi Electric MELSEC iQ-R series programmable controllers. This manual describes the functions required for programming. Before using this product, please read this manual and the relevant manuals carefully and develop familiarity with the functions and performance of the MELSEC iQ-R series programmable controller to handle the product correctly.
  • Page 5: Table Of Contents

    CONTENTS SAFETY PRECAUTIONS ..............1 CONDITIONS OF USE FOR THE PRODUCT .
  • Page 6 CCPU_EntryInt ................89 CCPU_EntryTimerEvent .
  • Page 7 CCPU_WriteDevice ..............152 CCPU_WriteLinkDevice .
  • Page 8 MCv_Jog::SetEnableJog ..............223 CHAPTER 4 ERROR CODE LIST Common Error Codes .
  • Page 9: Relevant Manuals

    System configuration, specifications, functions, and e-Manual [SH-081373ENG] troubleshooting of CW Workbench/CW-Sim e-Manual refers to the Mitsubishi Electric FA electronic book manuals that can be browsed using a dedicated tool. e-Manual has the following features: • Required information can be cross-searched in multiple manuals.
  • Page 10: Terms

    TERMS Unless otherwise specified, this manual uses the following terms. Term Description MELSEC data link function A data link function library offered by C Controller module. It is used to access other CPU modules as a connection target via network or in a multiple CPU system. GENERIC TERMS AND ABBREVIATIONS Unless otherwise specified, this manual uses the following generic terms and abbreviations.
  • Page 11 Generic term/abbreviation Description Dedicated function library A generic term for C Controller module dedicated functions, MELSEC data link functions, and motion module dedicated classes. Redundant CPU A generic term for Q12PRHCPU and Q25PRHCPU.
  • Page 12: Chapter 1 Common Items

    COMMON ITEMS A user program is created by using the VxWorks standard API functions and dedicated function library provided by a C Controller module in accordance with the specification of VxWorks, the operating system of C Controller module. *1 For details on the VxWorks standard API functions, refer to the following programmer's guide supported. VxWorks "KERNEL PROGRAMMER'S GUIDE"...
  • Page 13: C Controller Module Dedicated Functions

    C Controller Module Dedicated Functions C Controller dedicated functions of the dedicated function libraries are used to control C Controller module. These functions can be used for reading status of C Controller module or accessing resources such as LED control and clock. Program processing The following shows the user program processing using the C Controller module dedicated function.
  • Page 14 Considerations for dedicated functions Argument • For the first argument, "pcInstName", categorizing the dedicated instructions (D/DP/J/JP/G/GP/M) is not required. • Devices of the own station cannot be specified. Reserve the required area with a user program, and specify the start address of the area to the relevant argument.
  • Page 15: Argument Specification

    Argument specification This section shows the argument specifications of the C Controller module dedicated functions. Device type The following tables show the device types specified to the C Controller module dedicated functions. Devices are defined in the header file "CCPUFunc.h". Either a code or a device name can be specified as a device type.
  • Page 16: Melsec Data Link Functions

    MELSEC Data Link Functions MELSEC data link functions are the integrated communication function libraries which are independent of the communication protocols. A program to communicate with a CPU module can be created regardless of a target hardware or communication protocols by using the MELSEC data link functions.
  • Page 17: Considerations

    Considerations The following shows the considerations when using the MELSEC data link functions. Considerations for programming Open/close processing of a communication line (mdOpen/mdClose function) Perform the open/close processing of communication line (the mdOpen/mdClose function) only once at the start of task (task activation) and at the end of task (task completion) respectively in each user program.
  • Page 18 Other station transient access (other station CPU module remote operation and device access) Create a user program that provides an interlock to enable reading/writing data when the following conditions are satisfied to access devices via each network module. Module to be routed Condition that requires interlock CC-Link IE Controller Network module When the following conditions are met:...
  • Page 19: Accessible Range And Devices

    Accessible range and devices This section explains the accessible range and accessible devices when using MELSEC data link functions. The accessible range of the devices varies depending on specifications and settings of an access target module. For the accessible range, check the access target module specifications. Bus interface communication The following explains the accessible range and devices for bus interface communication.
  • Page 20 Accessing the host CPU The following table shows the accessible devices when accessing the host module. : Accessible, : Not accessible Device Access method Access target CPU R12CCPU-V  Input relay Batch/random  Output relay Batch/random  Internal relay Batch/random ...
  • Page 21 Device Access method Access target CPU   File register Batch/random   Batch/random Refresh data register Batch/random     Link relay Batch/random Link register Batch/random     Link special relay Batch/random Retentive timer (Contact) Batch/random ...
  • Page 22 *1 To directly access link devices, access them as link direct devices (J\) depending on network module specifications. An access target device varies depending on a device number to be specified. Therefore, a device number which is actually accessed may be different from the specified device number.
  • Page 23 CC-Link IE Controller Network communication The following explains the range and devices accessible for communication via a CC-Link IE Controller Network module. Accessible range The system configuration in the accessible range and the accessibility of each access target CPU via a CC-Link IE Controller Network module are shown below.
  • Page 24 3. Network to be 4. Access target CPU Connected Connected routed Programmable controller C Controller module MELSEC Interface network station WinCPU board for a module personal computer MELSEC MELSEC MELSEC MELSEC MELSEC MELSEC iQ-R -Q series -L series iQ-R -Q series -Q series series series...
  • Page 25 Accessible devices The devices accessible for communication via a CC-Link IE Controller Network module are shown below. • 'Batch' and 'Random' in the following table indicate as follows: Batch: Batch write (mdSendEx function), batch read (mdReceiveEx function) Random: Random write (mdRandWEx function), random read (mdRandREx function), bit set (mdDevSetEx function), bit reset (mdDevRstEx function), random write by using a label name (mdRandWLabelEx function), random read by using a label name (mdRandRLabelEx function) •...
  • Page 26 Device Access method Access target CPU       Long counter (Coil) Batch/random       Timer (Current value) Batch/random Long timer (Current value) Batch/random          ...
  • Page 27 Device Access method Access target CPU       Fixed cycle communication area (CPU No.3 area) U3E2\HG Batch   Random Fixed cycle communication area (CPU No.4 area) U3E3\HG Batch        ...
  • Page 28 CC-Link IE Field Network communication The following explains the range and devices accessible for communication via a CC-Link IE Field Network module. Accessible range The system configuration in the accessible range and the accessibility of each access target CPU via a CC-Link IE Field Network module are shown below.
  • Page 29 3. Network to be 4. Access target CPU Connected Connected routed Programmable controller C Controller module MELSEC Interface network station WinCPU board for a module personal computer MELSEC MELSEC MELSEC MELSEC MELSEC MELSEC iQ-R -Q series -L series iQ-R -Q series -Q series series series...
  • Page 30 Accessible devices The devices accessible for communication via a CC-Link IE Field Network master/local module are shown below. • 'Batch' and 'Random' in the following table indicate as follows: Batch: Batch write (mdSendEx function), batch read (mdReceiveEx function) Random: Random write (mdRandWEx function), random read (mdRandREx function), bit set (mdDevSetEx function), bit reset (mdDevRstEx function), random write by using a label name (mdRandWLabelEx function), random read by using a label name (mdRandRLabelEx function) •...
  • Page 31 Device Access method Access target CPU       Long counter (Coil) Batch/random       Timer (Current value) Batch/random Long timer (Current value) Batch/random          ...
  • Page 32 Device Access method Access target CPU       Fixed cycle communication area (CPU No.3 U3E2\HG Batch area)   Random Fixed cycle communication area (CPU No.4 U3E3\HG Batch       area)  ...
  • Page 33 CC-Link IE TSN communication The following explains the range and devices accessible for communication via a CC-Link IE TSN module. Accessible range The system configuration in the accessible range and the accessibility of each access target CPU via a CC-Link IE TSN module are shown below.
  • Page 34 3. Network to be 4. Access target CPU Connected Connected routed Programmable controller C Controller module MELSEC Interface network station WinCPU board for a module personal computer MELSEC MELSEC MELSEC MELSEC MELSEC MELSEC iQ-R -Q series -L series iQ-R -Q series -Q series series series...
  • Page 35 Accessible devices The devices accessible for communication via a CC-Link IE TSN module are shown below. Accessing the own station The accessible devices of the CC-Link IE TSN module controlled by a C Controller module are shown in the following table. : Accessible, : Not accessible Device Access method...
  • Page 36 Device Access method Access target CPU       Link special relay Batch/random       Retentive timer (Contact) Batch/random Long retentive timer (Contact) Batch/random          ...
  • Page 37 Device Access method Access target CPU       Safety internal relay SA\M Batch/random       Safety link relay SA\B Batch/random Safety timer SA\T Batch/random         ...
  • Page 38 MELSECNET/H network communication The following explains the range and devices accessible for communication via a MELSECNET/H network module. Accessible range The system configuration in the accessible range and the accessibility of each access target CPU via a MELSECNET/H network module are shown below. System configuration C Controller module Connected network...
  • Page 39 Applicable access Accessibility is shown in the following table. The own station and the connected station CPU are accessible. : Accessible, : Not accessible 3. Network to be 4. Access target CPU Connected Connected routed Programmable controller C Controller module MELSEC Interface network...
  • Page 40 Accessible devices The devices accessible for communication via a MELSECNET/H network module are shown below. • 'Batch' and 'Random' in the following table indicate as follows: Batch: Batch write (mdSendEx function), batch read (mdReceiveEx function) Random: Random write (mdRandWEx function), random read (mdRandREx function), bit set (mdDevSetEx function), bit reset (mdDevRstEx function), random write by using a label name (mdRandWLabelEx function), random read by using a label name (mdRandRLabelEx function) •...
  • Page 41 Device Access method Access target CPU       Long counter (Coil) Batch/random       Timer (Current value) Batch/random Long timer (Current value) Batch/random          ...
  • Page 42 Device Access method Access target CPU       Fixed cycle communication area (CPU No.3 U3E2\HG Batch area)  Random Fixed cycle communication area (CPU No.4 U3E3\HG Batch       area)  Random Other station buffer memory ...
  • Page 43 CC-Link communication The following explains the accessible range and devices for CC-Link communication. Accessible range The accessible range for CC-Link communication includes the own station (the master station or local stations controlled by a C Controller module), the master station or local stations controlled by other stations (CPU module and C Controller module), an intelligent device station, and a personal computer on which a CC-Link board is installed.
  • Page 44 Accessing other stations The accessible devices of the CC-Link module on the other station are shown in the following table. Access target CPU Basic model QCPU, high performance model QCPU, process CPU, redundant CPU, universal model QCPU Q12DCCPU-V, Q24DHCCPU-V, Q24DHCCPU-LS, Q24DHCCPU-VG, and Q26DHCCPU-LS Personal computer and intelligent device station L02CPU, L26CPU-BT, L02CPU-P, L26CPU-PBT, L02SCPU, L26CPU, and L06CPU RCPU...
  • Page 45 Device Access method Access target CPU        SEND function (without arrival confirmation) Batch/random       Link direct device (link input) Jn\X Batch/random Link direct device (link output) Jn\Y Batch/random  ...
  • Page 46: Argument Specification

    Argument specification This section shows the argument specification of the MELSEC data link functions. Channel A channel implies a network and communication route to be used when communicating with a C Controller module. It needs to be set for each module in a user program. Channels to be used for MELSEC data link functions are as follows: Channel Network...
  • Page 47 Network number and station number Network number and station number for MELSEC data link functions (excluding the mdControl function and the mdTypeRead function) Network numbers and station numbers to be specified to MELSEC data link functions are as follows: To specify station numbers for the mdControl function and mdTypeRead function, refer to "Network number and station number for MELSEC data link functions (the mdControl function and the mdTypeRead function)".
  • Page 48 *7 When '0 (0H)' or '125 (7DH)' is specified for the station number, a specified control station of the network, which is specified for the network number, is accessed. To access the current control station (a station that is actually operating as the control station), specify the station number from 1 (1H) to 120 (78H).
  • Page 49 Network number and station number for MELSEC data link functions (the mdControl function and the mdTypeRead function) Network numbers and station numbers to be specified to the mdControl function or the mdTypeRead function are as follows: Communication Station number specification method Bus interface Own station: 255 (FFH) Other station: 1 (CPU No.1), 2 (CPU No.2), 3 (CPU No.3), 4 (CPU No.4)
  • Page 50 *4 Station number setting for CC-Link module Upper Lower Upper/ Setting item Setting value Description lower Upper Network number Set the value for CC-Link. Lower Station number 0 (0H) to 63 (3FH) Set the station number of other stations. Logical station number setting method Set '0' in the upper byte (network number) of the station number above, and specify a logical station number in the lower byte (station number).
  • Page 51 Device type The following tables show the device types specified to the MELSEC data link functions. Devices are defined in the header file "MDFunc.h". Either a code or a device name can be specified as a device type. Common device types Device name (Device) Device type Code...
  • Page 52 Device name (Device) Device type Code Device name Decimal Hexadecimal Edge relay (V) DevQV Refresh data register (RD) DevRD Global label (GV) For word, double word, and quad word size 258H DevGV For bit 0 259H DevGV_0 For bit 1 25AH DevGV_1 For bit 2...
  • Page 53 Device types for accessing CC-Link IE Controller Network modules The device types shown in the following table can be specified in the user program: • For sending/receiving message Device Device type Code Device name Decimal Hexadecimal SEND function (with arrival confirmation) and RECV function DevMAIL SEND function (without arrival confirmation) DevMAILNC...
  • Page 54: Motion Module Dedicated Class

    Motion Module Dedicated Class This library is an interface for executing MCFBs of a motion module. Before using this library, make sure to fully understand MCFB specifications. For specifications of MCFBs, refer to the following: MELSEC iQ-R Motion Module User's Manual (Application) Program processing The following shows the user program processing using a motion module dedicated class.
  • Page 55 A default value is stored in input variables, output variables, and public variables by creating an MCFB instance. Programming can be shortened by setting input variables only for variables required to be changed from the default value. Execution procedure The following shows the procedure for executing the Enable-type MCFB (MC_Power) using a motion module dedicated class. The procedure is the same as when executing the Execute-type MCFB.
  • Page 56 taskDelay(1); /*Wait for the motion module side to be refreshed*/ taskDelay(1); /*Servo OFF*/ /*Set I/O variables and input variables of a member variable*/ /*No member variables to be set due to the FALSE execution*/ /*Set I/O variables and input variables to the motion module*/ sRet = mcPower.SetEnable(FALSE);...
  • Page 57: Classes

    Classes The following explains classes provided in motion module dedicated classes. Category Name Description MCFB class MCFB A class for providing a function to execute an MCFB. The corresponding MCFB version is as follows: • MELSEC iQ-R motion module library version '03D' Execution class MCFBExecute A class for executing an Execute type or Enable type MCFB.
  • Page 58 Hierarchical class diagram Functions and variables defined at the upper class are inherited by the lower class. (Class inheritance relationship) The following table shows inheritance relationships between classes. MCFB class MCFBExecute class Instruction class(Execute type) MCFBEnable class Instruction class(Enable type) Execution class Instruction class MCFBExecute...
  • Page 59: Members

    Members The following explains members of each class provided in motion module dedicated classes. MCFB class Function list Function name Description RefreshLabels To execute an MCFB with I/O variables and input variables set in the MCFB setting function. After the execution, I/O variables, input variables and public variables are refreshed.
  • Page 60: Data Type

    Data type This section shows data types which can be used in this library. ENUM enumerators The following table shows I/O variables, input variables, output variables, and public variables which can be used in this library. For details on ENUM enumerators and structures (axis variables), refer to the following: MELSEC iQ-R Motion Module User's Manual (Application) Type name, enumerator Setting...
  • Page 61 Type name, enumerator Setting Description value  VectorSpeed Vector speed LongAxisSpeed Long axis speed ReferenceAxisSpeed Reference axis speed MC_EXECUTION_MODE  mcImmediately Execute immediately mcQueued Execute at completion mcNextExecute Execute at next start mcSpeculatively Execute speculatively MC_RECORD_MODE  mcOneShot One shot mode mcRecordCount Number of designation times mode mcRingBuffer...
  • Page 62 Corresponding classes The following table shows classes provided in this library and their corresponding ENUM enumerators. Corresponding class Type name Enumerator MC_CamIn MC_START_MODE • mcImmediate(0) • mcAbsolute(1) • mcRelative(2) • MC_CamIn MC_SOURCE • mcSetValue(1) • MC_CombineAxes • mcActualValue(2) • MC_GearIn •...
  • Page 63 Structures The following table shows structures can be used in this library. For details on the other structures, refer to the following: MELSEC iQ-R Motion Module User's Manual (Application) Type name, enumerator Description Type AXIS_REF  AxisNo Axis No. unsigned short StartIO I/O No.
  • Page 64: Considerations

    Considerations Initial execution of the MCFB setting function. A C Controller module creates an internal instance for sending/receiving data to/from a motion module at the initial execution of the MCFB setting function. Since the C Controller module communicates with the motion module when creating the instance, it may take longer time for the function to be executed.
  • Page 65: Considerations On Interrupt Service Routine (Isr)

    Considerations on Interrupt Service Routine (ISR) Fully understand the restrictions of VxWorks, operating system, before creating a routine which is executed in an interrupt service routine (ISR: InterruptServiceRoutine). To use another dedicated function by synchronizing it to an interrupt, implement the notification processing in a user program and perform it in a task. Setting an inappropriate value or executing a function other than a C Controller module dedicated function for ISR from an interrupt service routine may cause the VxWorks runaway.
  • Page 66: Chapter 2 Function List

    FUNCTION LIST This chapter describes the functions that can be used for a C Controller module. C Controller Module Dedicated Functions The C Controller module dedicated functions are as listed below. C Controller module dedicated functions Function name Function Reference CCPU_ChangeCCIEFBCycPrm To change the operation parameter of the cyclic transmission of the CC-Link Page 69 CCPU_ChangeCCIEFBCycPrm...
  • Page 67 Function name Function Reference CCPU_ReadDevice To read data from internal user devices and internal system devices of a C Page 120 CCPU_ReadDevice Controller module. CCPU_ReadLinkDevice To read data from the own station link devices of CC-Link IE Controller Page 121 CCPU_ReadLinkDevice Network module, CC-Link IE Field Network module, Ethernet module (when CC-Link IE Field Network is selected), MELSECNET/H network module, and CC-Link IE TSN module.
  • Page 68: C Controller Module Dedicated Functions For Isr

    C Controller module dedicated functions for ISR Function name Function Reference CCPU_DisableInt_ISR To disable the routine registered with the CCPU_EntryInt function. Page 165 CCPU_DisableInt_ISR CCPU_EnableInt_ISR To enable the routine registered with the CCPU_EntryInt function. Page 166 CCPU_EnableInt_ISR CCPU_FromBuf_ISR To read data from the CPU buffer memory of the CPU module and the buffer Page 167 CCPU_FromBuf_ISR memory of the intelligent function module which are mounted on the specified module position.
  • Page 69: Melsec Data Link Functions

    MELSEC Data Link Functions The MELSEC data link functions are as listed below. Function name Function Reference mdClose To close a communication line (channel). Page 190 mdClose mdControl To perform remote operations (remote RUN/STOP/PAUSE) for the CPU Page 191 mdControl module.
  • Page 70: Motion Module Dedicated Class

    Motion Module Dedicated Class The following table shows motion module dedicated classes. Function name Function Reference MCFB::RefreshLabels To execute an MCFB with I/O variables and input variables set in the MCFB Page 218 MCFB::RefreshLabels setting function. After the execution, I/O variables, input variables and public variables are refreshed.
  • Page 71: Chapter 3 Details Of Function

    DETAILS OF FUNCTION This chapter explains the details of C Controller module dedicated functions, MELSEC data link functions, and the motion module dedicated classes. C Controller Module Dedicated Functions This section explains the details of the C Controller module dedicated function. CCPU_ChangeCCIEFBCycPrm This function changes operation parameter of cyclic transmission of the CC-Link IE Field Network Basic function.
  • Page 72: Ccpu_Changefilesecurity

    CCPU_ChangeFileSecurity This function changes the file access restriction status of a C Controller module. Format short CCPU_ChangeFileSecurity(short sMode, char* pcPass); Argument Argument Name Description IN/OUT sMode File access mode Specify the file access mode. (When 'Reserved' is specified, this function ends normally without processing.) •...
  • Page 73: Ccpu_Clearerror

    CCPU_ClearError This function clears errors of a C Controller module. Format short CCPU_ClearError (long* plErrorInfo) Argument Argument Name Description IN/OUT plErrorInfo Error information Unused (Even if a value is specified, the operation is not affected.) Description • This function clears errors occurred in a C Controller module. •...
  • Page 74: Ccpu_Control

    CCPU_Control This function performs remote operations (remote RUN/STOP/PAUSE) for a CPU module. Format short CCPU_Control (short sCpuNo, short sCode) Argument Argument Name Description IN/OUT sCpuNo CPU number Specify the target CPU module number. Specify '0' to perform the remote operation for the host CPU. (When the CPU module specified with 1 to 4 is the host CPU, an error is returned.) •...
  • Page 75: Ccpu_Dedicateddinst

    CCPU_DedicatedDInst This function executes dedicated instructions categorized as 'D' or 'DP'. Format short CCPU_DedicatedDInst (char* pcInstName, short sCPUNo, short* psArg1, short sArg1Size, short* psArg2, short sArg2Size, short* psArg3, short sArg3Size, short* psArg4, short sArg4Size, short* psArg5, short sArg5Size, short* psArg6, short sArg6Size, short* psArg7, short sArg7Size, short* psArg8, short sArg8Size, short* psArg9, short sArg9Size) Argument Argument...
  • Page 76 *1 Out of the setting data for the dedicated instruction to be executed, setting the "start input/output number of the target CPU divided by 16" is not required. 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 77 Description The dedicated instructions that can be specified to the instruction name (pcInstName) are as shown below. For the specifications of each dedicated function and the completion status, refer to the programming manual for each module. Instruction name Description Instruction Supported firmware version of C Controller module...
  • Page 78: Ccpu_Dedicatedginst

    CCPU_DedicatedGInst This function executes dedicated instructions categorized as 'G' or 'GP'. Format short CCPU_DedicatedGInst (char* pcInstName, short sIoNo, short* psArg1, short sArg1Size, short* psArg2, short sArg2Size, short* psArg3, short sArg3Size, short* psArg4, short sArg4Size, short* psArg5, short sArg5Size, short* psArg6, short sArg6Size, short* psArg7, short sArg7Size, short* psArg8, short sArg8Size, short* psArg9, short sArg9Size) Argument Argument...
  • Page 79 *1 Out of the setting data for the dedicated instruction to be executed, setting the "start input/output number of the own station" is not required. 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 80 Description The dedicated instructions that can be specified to the instruction name (pcInstName) are as shown below. For the specifications of each dedicated function and the completion status, refer to the programming manual for each module. Instruction name Description Instruction Supported firmware version of C Controller module...
  • Page 81: Ccpu_Dedicatedjinst

    CCPU_DedicatedJInst This function executes dedicated instructions categorized as 'J' or 'JP'. Format short CCPU_DedicatedJInst (char* pcInstName, short sNetNo, short* psArg1, short sArg1Size, short* psArg2, short sArg2Size, short* psArg3, short sArg3Size, short* psArg4, short sArg4Size, short* psArg5, short sArg5Size, short* psArg6, short sArg6Size, short* psArg7, short sArg7Size, short* psArg8, short sArg8Size, short* psArg9, short sArg9Size) Argument Argument...
  • Page 82 Description The dedicated instructions that can be specified to the instruction name (pcInstName) are as shown below. For the specifications of each dedicated function and the completion status, refer to the programming manual for each module. Instruction name Description Instruction Supported firmware version of C Controller module...
  • Page 83: Ccpu_Dedicatedminst

    CCPU_DedicatedMInst This function executes dedicated instructions categorized as 'M' or 'MP'. Format short CCPU_DedicatedMInst (char* pcInstName, short sCPUNo, short* psArg1, short sArg1Size, short* psArg2, short sArg2Size, short* psArg3, short sArg3Size, short* psArg4, short sArg4Size, short* psArg5, short sArg5Size, short* psArg6, short sArg6Size, short* psArg7, short sArg7Size, short* psArg8, short sArg8Size, short* psArg9, short sArg9Size) Argument Argument...
  • Page 84 *1 Out of the setting data for the dedicated instruction to be executed, setting the "start input/output number of the target CPU divided by 16" is not required. 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 85 Description The dedicated instructions that can be specified to the instruction name (pcInstName) are as shown below. For the specifications of each dedicated function and the completion status, refer to the programming manual for each module. Instruction name Description Instruction Supported firmware version of C Controller module...
  • Page 86 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant functions • Page 73 CCPU_DedicatedDInst • Page 76 CCPU_DedicatedGInst • Page 79 CCPU_DedicatedJInst 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 87: Ccpu_Disableint

    CCPU_DisableInt This function disables the routine registered with the CCPU_EntryInt function. Format short CCPU_DisableInt (short sSINo) Argument Argument Name Description IN/OUT sSINo Interrupt pointer number Specify the interrupt pointer number. Description • This function disables the routine registered with the CCPU_EntryInt function. (The routine is not executed when an interrupt occurs.) •...
  • Page 88: Ccpu_Enableint

    CCPU_EnableInt This function enables the routine registered with the CCPU_EntryInt function. Format short CCPU_EnableInt (short sSINo) Argument Argument Name Description IN/OUT sSINo Interrupt pointer number Specify the interrupt pointer number. Description • This function enables the routine registered with the CCPU_EntryInt function. (The routine is executed when an interrupt occurs.) •...
  • Page 89: Ccpu_Endcciefbdataassurance

    CCPU_EndCCIEFBDataAssurance This function ends data assurance for one link scan of CC-Link IE Field Network Basic. Format short CCPU_EndCCIEFBDataAssurance (unsigned short usGroupNo) Argument Argument Name Description IN/OUT usGroupNo Group No. Specify a group number to end data assurance. (1 to 4) Description •...
  • Page 90: Ccpu_Entrycciefbrefendfunc

    CCPU_EntryCCIEFBRefEndFunc This function registers a routine to be called when the link scan of CC-Link IE Field Network Basic is completed. Format short CCPU_EntryCCIEFBRefEndFunc (CCPU_REFENDFUNCPTR pREFENDFuncPtr) Argument Argument Name Description IN/OUT pREFENDFuncPtr Registered routine Specify a routine to be registered. (The routine is deregistered by specifying NULL.) The data type of the registered routine (pREFENDFuncPtr) is defined in the header file 'CCPUFunc.h' as follows.
  • Page 91 CCPU_EntryInt This function registers a routine to be called when an interrupt occurs. Format short CCPU_EntryInt (short sSINo, CCPU_FUNCPTR pFuncPtr) Argument Argument Name Description IN/OUT sSINo Interrupt pointer number Specify the interrupt pointer number. pFuncPtr Registered routine Specify a routine to be registered. (The routine is deregistered by specifying NULL.) •...
  • Page 92 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant functions • Page 86 CCPU_EnableInt • Page 85 CCPU_DisableInt 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 93 CCPU_EntryTimerEvent This function registers a timer event. Format short CCPU_EntryTimerEvent (long* plEvent) Argument Argument Name Description IN/OUT plEvent Registered event Specify a timer event to be registered. The specification method for the registered event (plEvent) is as follows: plEvent Description plEvent[0] Number of timer event settings (1 to 16) plEvent[1]...
  • Page 94 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant function • Page 149 CCPU_WaitTimerEvent 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 95 CCPU_EntryWDTInt This function registers a routine to be called when a user WDT error interrupt occurs. Format short CCPU_EntryWDTInt (short sType, CCPU_FUNCPTR pFuncPtr) Argument Argument Name Description IN/OUT sType WDT type Specify the WDT type. (If reserve is specified, an error is returned.) •...
  • Page 96 CCPU_FromBuf This function reads data from the CPU buffer memory of the CPU module and the buffer memory of the intelligent function module which are mounted on the specified module position. (FROM instruction) Format short CCPU_FromBuf (unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument...
  • Page 97 CCPU_FromBufHG This function reads data from the fixed cycle communication area of the CPU module mounted on the specified module position. Format short CCPU_FromBufHG(unsigned short usIoNo, unsigned long short ulOffset, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description...
  • Page 98 CCPU_GetCCIEFBDiagnosticInfo This function acquires the diagnostic information of CC-Link IE Field Network Basic. Format short CCPU_GetCCIEFBDiagnosticInfo (unsigned short usSlave, short* psStatusBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT usSlave Slave station number Specify a slave station to acquire diagnostic information. (1 to 64) psStatusBuf Diagnostic information storage Specify a storage destination for diagnostic information.
  • Page 99 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 100 CCPU_GetConstantProcessStatus This function acquires the fixed cycle processing status of C Controller module. Format short CCPU_GetConstantProcessStatus(unsigned short * pusStatusBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT pusStatusBuf Fixed cycle processing status Specify the fixed cycle processing status storage destination. storage destination ulBufSize Fixed cycle processing status...
  • Page 101 CCPU_GetCounterMicros This function acquires a 1 μs counter value of a C Controller module. Format short CCPU_GetCounterMicros(unsigned long* pulMicros) Argument Argument Name Description IN/OUT pulMicros 1μs counter value storage Specify the storage destination of the 1μs counter value. destination Description •...
  • Page 102 CCPU_GetCounterMillis This function acquires a 1 ms counter value of a C Controller module. Format short CCPU_GetCounterMillis(unsigned long* pulMillis) Argument Argument Name Description IN/OUT pulMillis 1 ms counter value storage Specify the storage destination of the 1 ms counter value. destination Description •...
  • Page 103 CCPU_GetCpuStatus This function acquires the operating status of a C Controller module. Format short CCPU_GetCpuStatus(long* plStatusBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT plStatusBuf Operating status storage Specify the storage destination of the operating status. destination ulBufSize Operating status storage Specify the size of area reserved in the operating status storage destination in double destination size word units.
  • Page 104 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant function • Page 105 CCPU_GetErrInfo 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 105 CCPU_GetDotMatrixLED This function acquires the value displayed on the dot matrix LED of a C Controller module, and stores it to the LED data storage destination (pcData). Format short CCPU_GetDotMatrixLED(char* pcData, unsigned long ulDataSize) Argument Argument Name Description IN/OUT pcData LED data storage destination Specify the storage destination of LED data.
  • Page 106 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant function • Page 131 CCPU_SetDotMatrixLED 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 107 CCPU_GetErrInfo This function acquires the error information of a C Controller module. Format short CCPU_GetErrInfo(unsigned short* pusErrorInfo, unsigned long ulBufSize) Argument Argument Name Description IN/OUT pusErrorInfo Error information storage Specify the error information storage destination . destination ulBufSize Error information storage Specify the error information storage destination size in word units.
  • Page 108 CCPU_GetFileSecurity This function acquires the file access mode of a C Controller module. Format short CCPU_GetFileSecurity(short* psMode); Argument Argument Name Description IN/OUT psMode File access mode Stores the file access mode. • 0: Access restriction clear mode • 1: Access restriction mode Description This function acquires the current file access mode, and stores it to the file access mode (psMode).
  • Page 109 CCPU_GetIDInfo This function acquires the individual identification information of a C Controller module. Format short CCPU_GetIDInfo(unsigned char *pucGetData, unsigned long ulBufSize); Argument Argument Name Description IN/OUT pucGetData Individual identification Specify the individual identification information storage destination. information storage destination ulBufSize Individual identification Specify the individual identification information storage destination size in word units.
  • Page 110 CCPU_GetLEDStatus This function acquires the LED status of a C Controller module. Format short CCPU_GetLEDStatus(long lLed, unsigned short* pusLedInfo, unsigned long ulBufSize) Argument Argument Name Description IN/OUT lLed Target LED Specify the target LED. (When 'Reserved' is specified, this function ends normally without processing.) •...
  • Page 111 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant function • Page 105 CCPU_GetErrInfo 3 DETAILS OF FUNCTION 3.1 C Controller Module Dedicated Functions...
  • Page 112 CCPU_GetOpSelectMode This function acquires the operation selection mode of a C Controller module. Format short CCPU_GetOpSelectMode(long lModeInfo, long* plSelectMode) Argument Argument Name Description IN/OUT lModeInfo Mode information Specify the mode information. • 1: Operation selection mode when the MODE/SELECT switch is held in the SELECT position •...
  • Page 113 CCPU_GetPowerStatus This function acquires the power status of C Controller module. Format short CCPU_GetPowerStatus(long* plStatusBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT plStatusBuf Power status storage destination Specify the storage destination of the power status. ulBufSize Power status storage destination Specify the power status storage destination size in double word units.
  • Page 114 CCPU_GetRTC This function acquires the clock data (local time) of a C Controller module. Format short CCPU_GetRTC(short* psGetData,unsigned long ulBufSize) Argument Argument Name Description IN/OUT psGetData Clock data storage destination Specify the storage destination of the clock data (local time). ulBufSize Clock data storage destination Specify the clock data (local time) storage destination size in word units.
  • Page 115 CCPU_GetSerialNo This function acquires the serial number of a C Controller module. Format short CCPU_GetSerialNo(char* pcGetData, unsigned long ulDataSize) Argument Argument Name Description IN/OUT pcGetData Serial number storage destination Specify the serial number storage destination. ulDataSize Serial number storage destination Specify the serial number storage destination in byte units.
  • Page 116 CCPU_GetSwitchStatus This function acquires the switch status of a C Controller module. Format short CCPU_GetSwitchStatus(long* plStatusBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT plStatusBuf Switch status storage destination Specify the switch status storage destination. ulBufSize Switch status storage destination Specify the switch status storage destination size in double word units.
  • Page 117 CCPU_GetUnitInfo This function acquires the module configuration information. Format short CCPU_GetUnitInfo (unsigned short* pusUnitInfo1, unsigned short* pusUnitInfo2, unsigned short* pusUnitInfo3) Argument Argument Name Description IN/OUT pusUnitInfo1 Module configuration information Specify the storage destination of module configuration information 1. pusUnitInfo2 Module configuration information Specify the storage destination of module configuration information 2.
  • Page 118 pusUnitInfo Description Storage position Status pusUnitInfo1[0-64] bit15 Module mounting status • 0: Not mounted • 1: Mounted bit14 Series information 1: MELSEC iQ-R series (0: MELSEC-Q series)  bit13-0 Reserved  pusUnitInfo2[0-64] No module mounted bit15-0 Reserved A module mounted bit15-8 Reserved ...
  • Page 119 Series information is MELSEC-Q series The series can be checked in the 14th bit of pusUnitInfo1[0-64]. CPU slot information pusUnitInfo1[0] pusUnitInfo1[1] Information on slot 0 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Series information Input/output point information pusUnitInfo1[63]...
  • Page 120 CCPU_LockFWUpdate This function prohibits the execution of the firmware update of a C Controller module. Format short CCPU_LockFWUpdate(char* pcPass) Argument Argument Name Description IN/OUT pcPass Password Specify a password for removing the prohibition on the firmware update. Description • This function prohibits the execution of the firmware update of a C Controller module. •...
  • Page 121 CCPU_MountMemoryCard This function mounts the SD memory card inserted to a C Controller module. Format short CCPU_MountMemoryCard (short sDrive) Argument Argument Name Description IN/OUT sDrive Target drive Specify a target drive. (When 'Reserved' is specified, this function ends normally without processing.) •...
  • Page 122 CCPU_ReadDevice This function reads data from internal user devices and internal system devices of C Controller module. Format short CCPU_ReadDevice (short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type.
  • Page 123 CCPU_ReadLinkDevice This function reads data from the own station link devices of CC-Link IE Controller Network module, CC-Link IE Field Network module, Ethernet module (when CC-Link IE Field Network is selected), MELSECNET/H network module, and CC-Link IE TSN module which are controlled by a C Controller module. Format short CCPU_ReadLinkDevice (unsigned short usIoNo, short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize)
  • Page 124 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 Description IN/OUT ulUnitLabel...
  • Page 125 Precautions When reading data from module labels, data is read from the module label (ulUnitLabel) and offset (ulOffset) for the size specified in the size (ulSize). However, this function does not check whether the data is within the specified module label. Therefore, data may be read from module labels other than the specified ones depending on the offset (ulOffset) and size (ulSize).
  • Page 126 CCPU_ReadMCUnitLabelBit This function reads data from module labels of a C Controller module in bit units. Format short CCPU_ReadMCUnitLabelBit (unsigned long ulUnitLabel, unsigned short* pusDataBuf, unsigned long ulUnitLabelID) Argument Argument Name Description IN/OUT ulUnitLabel Module label Specify a module label. pusDataBuf Data storage destination Specify the storage destination of read data.
  • Page 127 CCPU_RegistEventLog This function registers an event log in the event history of a C Controller module. Format short CCPU_RegistEventLog (long lEventCode, char* pcEventMsg) Argument Argument Name Description IN/OUT lEventCode Detailed code Specify a detailed event code to be registered in the event history. pcEventMsg Detailed information Specify detailed information character string data of an event to be registered in the event...
  • Page 128 CCPU_Reset This function resets the bus master CPU (CPU No.1). Format short CCPU_Reset (void) Argument None Description • This function resets the bus master CPU (CPU No.1). • Use this function only to reset the bus master CPU due to an error or others. •...
  • Page 129 CCPU_ResetDevice This function resets internal user devices and internal system devices (bit devices) of C Controller module. Format short CCPU_ResetDevice (short sDevType, unsigned long ulDevNo) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 13 Argument specification ulDevNo Start device number Specify the start device number.
  • Page 130 CCPU_ResetWDT This function resets the user WDT of a C Controller module. Format short CCPU_ResetWDT (short sType) Argument Argument Name Description IN/OUT sType WDT type Specify the WDT type. (If reserve is specified, an error is returned.) • 0: User WDT •...
  • Page 131 CCPU_RestoreDefaultCCIEFBCycPrm This function restores the operation parameter of cyclic transmission of CC-Link IE Field Network Basic to the default value (which is set in the parameter). Format short CCPU_RestoreDefaultCCIEFBCycPrm (void) Argument None Description • This function restores the all group operation parameters of cyclic transmission to their default value (which are set in the parameter).
  • Page 132 CCPU_SetDevice This function sets internal user devices and internal system devices (bit devices) of C Controller module. Format short CCPU_SetDevice (short sDevType, unsigned long ulDevNo) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 13 Argument specification ulDevNo Device number Specify the device number.
  • Page 133 CCPU_SetDotMatrixLED This function sets a value to be displayed on the dot matrix LED of C Controller module. Format short CCPU_SetDotMatrixLED(unsigned short usLedMode, char* pcData) Argument Argument Name Description IN/OUT usLedMode Output mode Specify the output mode to the dot matrix LED. (When 'Reserved' is specified, this function ends normally without processing.) •...
  • Page 134 ⋅Mode 1: ASCII mode The specified character strings are displayed in pcData[0] to pcData[3]. Available characters (ASCII code) are shown below. : character string specification not allowed Upper four bits           ...
  • Page 135 CCPU_SetLEDStatus This function sets the LED status of a C Controller module. Format short CCPU_SetLEDStatus(long lLed, unsigned short usLedInfo) Argument Argument Name Description IN/OUT lLed Target LED Specify the target LED. (When 'Reserved' is specified, this function ends normally without processing.) •...
  • Page 136 CCPU_SetOpSelectMode This function sets the operation selection mode of C Controller module. Format short CCPU_SetOpSelectMode(long lModeInfo, long lSelectMode) Argument Argument Name Description IN/OUT lModeInfo Mode information Specify the mode information. lSelectMode Operation selection mode Specify the operation selection mode. The specification method for the mode information (lModeInfo) and operation selection mode (lSelectMode) is as follows: lModeInfo lSelectMode Description...
  • Page 137 CCPU_SetRTC This function sets the clock data (local time) of C Controller module. Format short CCPU_SetRTC(short* psSetData) Argument Argument Name Description IN/OUT psSetData Clock data Specify the clock data (local time) to be set. • Specify the clock data (local time) to the clock data (psSetData) as follows. (Available range: January 1, 1980 to December 31, 2079) psSetData Description...
  • Page 138 CCPU_ShutdownRom This function shuts down the program memory and data memory of a C Controller module. Format short CCPU_ShutdownRom (void) Argument None Description • This function shuts down the program memory and data memory of a C Controller module. The BUS RUN LED starts flashing at high speed after the shutdown.
  • Page 139 CCPU_StartCCIEFBDataAssurance This function starts data assurance for one link scan of CC-Link IE Field Network Basic. Format short CCPU_StartCCIEFBDataAssurance (unsigned short usGroupNo, unsigned long ulTimeout) Argument Argument Name Description IN/OUT usGroupNo Group No. Specify a group number to start data assurance. (1 to 4) ulTimeout Timeout value Specify a timeout time until data assurance is started in milliseconds.
  • Page 140 CCPU_StartWDT This function sets and starts the user WDT of a C Controller module. Format short CCPU_StartWDT(short sType, short sInterval) Argument Argument Name Description IN/OUT sType WDT type Specify the WDT type. (If reserve is specified, an error is returned.) •...
  • Page 141 CCPU_StopWDT This function stops the user WDT of a C Controller module. Format short CCPU_StopWDT(short sType) Argument Argument Name Description IN/OUT sType WDT type Specify the WDT type. (If reserve is specified, an error is returned.) • 0: User WDT •...
  • Page 142 CCPU_SysClkRateGet This function reads the system clock rate specified with the CCPU_SysClkRateSet function from the backup RAM. Format short CCPU_SysClkRateGet(short* psTicks) Argument Argument Name Description IN/OUT psTicks Clock rate Stores the system clock rate in the unit of clock frequency (Hz) per one second. •...
  • Page 143 CCPU_SysClkRateSet This function saves the specified system clock rate in the backup RAM. Format short CCPU_SysClkRateSet(short sTicks, short* psRestart) Argument Argument Name Description IN/OUT sTicks Clock rate Specify the system clock rate in the unit of clock frequency (Hz) per one second. •...
  • Page 144 CCPU_ToBuf This function writes data to the CPU buffer memory of the CPU module (host CPU) and the buffer memory of the intelligent function module which are mounted on the specified module position. (TO instruction) Format short CCPU_ToBuf (unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument...
  • Page 145 CCPU_ToBufHG This function writes data to the fixed cycle communication area of the CPU module mounted on the specified module position. Format short CCPU_ToBufHG(unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT...
  • Page 146 CCPU_UnlockFWUpdate This function removes the prohibition on the firmware update of a C Controller module. Format short CCPU_UnlockFWUpdate(char* pcPass) Argument Argument Name Description IN/OUT pcPass Password Specify a password for removing the prohibition on the firmware update. Description • This function removes the prohibition on the firmware update of a C Controller module. •...
  • Page 147 CCPU_UnmountMemoryCard This function unmounts the SD memory card and USB Mass Storage Class-compliant device inserted to a C Controller module. Format short CCPU_UnmountMemoryCard (short sDrive) Argument Argument Name Description IN/OUT sDrive Target drive Specify a target drive. (When 'Reserved' is specified, this function ends normally without processing.) •...
  • Page 148 CCPU_WaitEvent This function waits for an interrupt event notification from other CPUs. Format short CCPU_WaitEvent (short* psEvent, unsigned long ulTimeout, short* psSetEventNo) Argument Argument Name Description IN/OUT psEvent Interrupt event setting Specify the interrupt event. ulTimeout Timeout value Specify the timeout value in milliseconds (0H to FFFFFFFFH). (When FFFFFFFFH is specified, the function waits for an event infinitely.) psSetEventNo Occurred event...
  • Page 149 Setting of psEvent to wait for interrupt event 0 and 1 for CPU No.1, and interrupt event 10 for CPU No.2 psEvent[0] = 3; psEvent[1] = 1; psEvent[2] = 0; psEvent[3] = 1; psEvent[4] = 1; psEvent[5] = 2; psEvent[6] = 10; When interrupt event 10 for CPU No.2 occurs, '2' and '10' are returned to psSetEventNo[0] and psSetEventNo[1], respectively.
  • Page 150 CCPU_WaitSwitchEvent This function waits for a switch interrupt event of C Controller module to occur. Format short CCPU_WaitSwitchEvent(short sSwitch, unsigned long ulTimeout) Argument Argument Name Description IN/OUT sSwitch Switch interrupt event type Specify the switch interrupt event type. • 0: RUN switch interrupt event •...
  • Page 151 CCPU_WaitTimerEvent This function waits for a timer event to occur. Format short CCPU_WaitTimerEvent (long lEventNo) Argument Argument Name Description IN/OUT lEventNo Timer event number Specify a timer event number that waits for a timer event to occur. (1 to 16) Description •...
  • Page 152 CCPU_WaitUnitEvent This function waits for an interrupt event notification from modules. Format short CCPU_WaitUnitEvent (short* psEvent, unsigned long ulTimeout, short* psSetEventNo) Argument Argument Name Description IN/OUT psEvent Event setting Specify the interrupt event. ulTimeout Timeout value Specify the timeout value in milliseconds (0H to FFFFFFFFH). (When FFFFFFFFH is specified, the function waits for an event infinitely.) psSetEventNo Occurred event...
  • Page 153 Setting of psEvent when waiting for interrupt event 0, interrupt event 1, interrupt event 50, and interrupt event 51 psEvent[0] = 4; psEvent[1] = 0; psEvent[2] = 1; psEvent[3] = 50; psEvent[4] = 51; When event 51 occurs, 51 is returned to psSetEventNo. The event numbers (interrupt pointer numbers) are as follows.
  • Page 154 CCPU_WriteDevice This function writes data to internal user devices and internal system devices of C Controller module. Format short CCPU_WriteDevice (short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type.
  • Page 155 CCPU_WriteLinkDevice This function writes data to the own station link devices of the following modules: CC-Link IE Controller Network module, CC- Link IE Field Network module, Ethernet module (when CC-Link IE Field Network is selected), MELSECNET/H network module, and CC-Link IE TSN module which are controlled by a C Controller module. Format short CCPU_WriteLinkDevice (unsigned short usIoNo, short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize)
  • Page 156 CCPU_WriteMCUnitLabel This function writes data to module labels of a C Controller module in word units. Format short CCPU_WriteMCUnitLabel (unsigned long ulUnitLabel, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize ,unsigned long ulUnitLabelID) Argument Argument Name Description IN/OUT ulUnitLabel...
  • Page 157 Specification method for a module label • For the module label (ulUnitLabel), specify a module label other than bit type. Specifying a bit type module label may cause an unpredictable operation. • To specify an array label for the module label (ulUnitLabel) and write data to each array element, specify an offset for the offset (ulOffset) in word units.
  • Page 158 Specification method for data size • For the data size (ulSize), specify the number of words according to the label data type. The following shows an example for specifying data size. Label data type Number of words Word (signed, unsigned) Double words (signed, unsigned) Single precision real number Double precision real number...
  • Page 159 Precautions • When specifying '0' for the module label ID (ulUnitLabelID), this function does not check the address in the label area where the public labels (module labels), which are written to a C Controller module, and the module labels, which are specified in a function for accessing module labels, are assigned.
  • Page 160 CCPU_WriteMCUnitLabelBit This function writes module labels of a C Controller module in bit units. Format short CCPU_WriteMCUnitLabelBit (unsigned long ulUnitLabel, unsigned short usDataBuf, unsigned long ulUnitLabelID) Argument Argument Name Description IN/OUT ulUnitLabel Module label Specify a module label. usDataBuf Data storage destination Specify the storage destination of write data.
  • Page 161 CCPU_X_In_BitEx This function reads an input signal (X) in bit (1-point) units. Format short CCPU_X_In_BitEx (short sFlg, unsigned short usXNo, unsigned short* pusData) Argument Argument Name Description IN/OUT sFlg Access flag Specify an access flag. • 0: Normal access • Others: Reserved usXNo Input signal Specify an input signal (X).
  • Page 162 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 Description IN/OUT sFlg Access flag Specify an access flag. •...
  • Page 163 CCPU_Y_In_BitEx This function reads an output signal (Y) in bit (1-point) units. Format short CCPU_Y_In_BitEx (short sFlg, unsigned short usYNo, unsigned short* pusData) Argument Argument Name Description IN/OUT sFlg Access flag Specify an access flag. • 0: Normal access • Others: Reserved usYNo Output signal Specify an output signal (Y).
  • Page 164 CCPU_Y_In_WordEx This function reads an output signal (Y) in word (16-point) units. Format short CCPU_Y_In_WordEx (short sFlg, unsigned short usYNo, unsigned short usSize, unsigned short* pusDataBuf, unsigned short usBufSize) Argument Argument Name Description IN/OUT sFlg Access flag Specify an access flag. •...
  • Page 165 CCPU_Y_Out_BitEx This function outputs an output signal (Y) in bit (1-point) units. Format short CCPU_Y_Out_BitEx (short sFlg, unsigned short usYNo, unsigned short usData) Argument Argument Name Description IN/OUT sFlg Access flag Specify an access flag. • 0: Normal access • Others: Reserved usYNo Output signal Specify an output signal (Y).
  • Page 166 CCPU_Y_Out_WordEx This function outputs an output signal (Y) in word (16-point) units. Format short CCPU_Y_Out_WordEx (short sFlg, unsigned short usYNo, unsigned short usSize, unsigned short* pusDataBuf, unsigned short usBufSize) Argument Argument Name Description IN/OUT sFlg Access flag Specify an access flag. •...
  • Page 167 C Controller module dedicated functions for ISR CCPU_DisableInt_ISR This function disables the routine registered with the CCPU_EntryInt function. Format short CCPU_DisableInt (short sSINo) Argument Argument Name Description IN/OUT sSINo Interrupt pointer number Specify the interrupt pointer number. Description • This function disables the routine registered with the CCPU_EntryInt function. (The routine is not executed when an interrupt occurs.) •...
  • Page 168 CCPU_EnableInt_ISR This function enables the routine registered with the CCPU_EntryInt function. Format short CCPU_EnableInt (short sSINo) Argument Argument Name Description IN/OUT sSINo Interrupt pointer number Specify the interrupt pointer number. Description • This function enables the routine registered with the CCPU_EntryInt function. (The routine is executed when an interrupt occurs.) •...
  • Page 169 CCPU_FromBuf_ISR This function reads data from the CPU buffer memory of the CPU module and the buffer memory of the intelligent function module which are mounted on the specified module position. (FROM instruction) Format short CCPU_FromBuf_ISR (unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf) Argument Argument...
  • Page 170 CCPU_FromBufHG_ISR This function reads data from the fixed cycle communication area of the CPU module mounted on the specified module position. Format short CCPU_FromBufHG_ISR (unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf) Argument Argument Name Description IN/OUT usIoNo Module position...
  • Page 171 CCPU_GetCounterMicros_ISR This function acquires a 1 μs counter value of a C Controller module. Format short CCPU_GetCounterMicros_ISR(unsigned long* pulMicros) Argument Argument Name Description IN/OUT pulMicros 1μs counter value storage Specify the storage destination of the 1μs counter value. destination Description •...
  • Page 172 CCPU_GetCounterMillis_ISR This function acquires a 1 ms counter value of a C Controller module. Format short CCPU_GetCounterMillis_ISR(unsigned long* pulMillis) Argument Argument Name Description IN/OUT pulMillis 1 ms counter value storage Specify the storage destination of the 1 ms counter value. destination Description •...
  • Page 173 CCPU_GetDotMatrixLED_ISR This function acquires the value displayed on the dot matrix LED of a C Controller module, and stores it to the LED data storage destination (pcData). Format short CCPU_GetDotMatrixLED_ISR (char* pcData, unsigned long ulDataSize) Argument Argument Name Description IN/OUT pcData LED data storage destination Specify the storage destination of LED data.
  • Page 174 WARNING If any function in which an invalid argument is specified is executed, an error such as hardware failure (3C02H) may occur on C Controller module. Return value Return value Description 0 (0000H) Normal Relevant function • Page 177 CCPU_SetDotMatrixLED_ISR 3 DETAILS OF FUNCTION 3.2 C Controller module dedicated functions for ISR...
  • Page 175 CCPU_ReadDevice_ISR This function reads data from internal user devices and internal system devices of C Controller module. Format short CCPU_ReadDevice_ISR (short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 13 Argument specification ulDevNo Start device number...
  • Page 176 CCPU_RegistEventLog_ISR This function registers an event log in the event history of a C Controller module. Format short CCPU_RegistEventLog_ISR (long lEventCode, char* pcEventMsg) Argument Argument Name Description IN/OUT lEventCode Detailed code Specify a detailed event code to be registered in the event history. pcEventMsg Detailed information Specify detailed information character string data of an event to be registered in the event...
  • Page 177 CCPU_ResetDevice_ISR This function resets internal user devices and internal system devices (bit devices) of C Controller module. Format short CCPU_ResetDevice_ISR(short sDevType, unsigned long ulDevNo) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 13 Argument specification ulDevNo Start device number Specify the start device number.
  • Page 178 CCPU_SetDevice_ISR This function sets internal user devices and internal system devices (bit devices) of C Controller module. Format short CCPU_SetDevice_ISR (short sDevType, unsigned long ulDevNo) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 13 Argument specification ulDevNo Device number Specify the device number.
  • Page 179 CCPU_SetDotMatrixLED_ISR This function sets a value to be displayed on the dot matrix LED of C Controller module. Format short CCPU_SetDotMatrixLED_ISR (unsigned short usLedMode, char* pcData) Argument Argument Name Description IN/OUT usLedMode Output mode Unused (Even if a value is specified, the operation is not affected.) pcData LED data Specify the LED data.
  • Page 180 Description This function displays the value specified to the LED data (pcData) on the dot matrix LED. • Do not execute this function in a routine other than an interrupt routine. • Do not execute this function when a mode other than "USER" is selected in the operation selection mode. An unintended value may be displayed on the dot matrix LED.
  • Page 181 CCPU_SetLEDStatus_ISR This function sets the LED status of a C Controller module. Format short CCPU_SetLEDStatus_ISR(long lLed, unsigned short usLedInfo) Argument Argument Name Description IN/OUT lLed Target LED Unused (Even if a value is specified, the operation is not affected.) usLedInfo LED status information Specify the LED status information.
  • Page 182 CCPU_ToBuf_ISR This function writes data to the CPU buffer memory of the CPU module (host CPU) and the buffer memory of the intelligent function module which are mounted on the specified module position. (TO instruction) Format short CCPU_ToBuf_ISR (unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf) Argument Argument Name...
  • Page 183 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant function • Page 167 CCPU_FromBuf_ISR 3 DETAILS OF FUNCTION 3.2 C Controller module dedicated functions for ISR...
  • Page 184 CCPU_ToBufHG_ISR This function writes data to the fixed cycle communication area of the CPU module mounted on the specified module position. Format short CCPU_ToBufHG_ISR (unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf) Argument Argument Name Description IN/OUT usIoNo Module position...
  • Page 185 CCPU_WriteDevice_ISR This function writes data to internal user devices and internal system devices of C Controller module. Format short CCPU_WriteDevice_ISR (short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 13 Argument specification ulDevNo Start device number...
  • Page 186 CCPU_X_In_Word_ISR This function reads an input signal (X) in word (16-point) units. Format short CCPU_X_In_Word_ISR (unsigned short usXNo, unsigned short usSize, unsigned short* pusDataBuf) Argument Argument Name Description IN/OUT usXNo Start input signal Specify a start input signal (X). (Specify a multiple of 16.) usSize Read data size Specify the read data size in word units.
  • Page 187 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant functions • Page 186 CCPU_Y_In_Word_ISR • Page 188 CCPU_Y_Out_Word_ISR 3 DETAILS OF FUNCTION 3.2 C Controller module dedicated functions for ISR...
  • Page 188 CCPU_Y_In_Word_ISR This function reads an output signal (Y) in word (16-point) units. Format short CCPU_Y_In_Word_ISR (unsigned short usYNo, unsigned short usSize, unsigned short* pusDataBuf) Argument Argument Name Description IN/OUT usYNo Start output signal Specify a start output signal (Y). (Specify a multiple of 16.) usSize Read data size Specify the read data size in word units.
  • Page 189 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant function • Page 184 CCPU_X_In_Word_ISR • Page 188 CCPU_Y_Out_Word_ISR 3 DETAILS OF FUNCTION 3.2 C Controller module dedicated functions for ISR...
  • Page 190 CCPU_Y_Out_Word_ISR This function outputs an output signal (Y) in word (16-point) units. Format short CCPU_Y_Out_Word_ISR (unsigned short usYNo, unsigned short usSize, unsigned short* pusDataBuf) Argument Argument Name Description IN/OUT usYNo Start output signal Specify a start output signal (Y). (Specify a multiple of 16.) usSize Output size Specify the output size in word units.
  • Page 191 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant functions • Page 184 CCPU_X_In_Word_ISR • Page 186 CCPU_Y_In_Word_ISR 3 DETAILS OF FUNCTION 3.2 C Controller module dedicated functions for ISR...
  • Page 192 MELSEC Data Link Functions This section explains the details of the MELSEC data link function. mdClose This function closes a communication line (channel). Format short mdClose(long lPath) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. Description •...
  • Page 193 mdControl This function performs remote operations (remote RUN/STOP/PAUSE) for a CPU module. Format short mdControl(long lPath, short sStNo, short sCode) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. sStNo Station number Specify the network number and station number of the target module. Page 44 Argument specification sCode Instruction code...
  • Page 194 mdDevRstEx This function resets bit devices. Format long mdDevRstEx(long lPath, long lNetNo, long lStNo, long lDevType, long lDevNo) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. lNetNo Network number Specify the network number of target module. lStNo Station number Specify the station number of target module.
  • Page 195 mdDevSetEx This function sets bit devices. Format long mdDevSetEx (long lPath, long lNetNo, long lStNo, long lDevType, long lDevNo) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. lNetNo Network number Specify the network number of target module. lStNo Station number Specify the station number of target module.
  • Page 196 mdGetLabelInfo This function acquires device information corresponding to label names. Format long mdGetLabelInfo (long lPath, long lNetNo, long lStNo, long lLbCnt, void* pLbLst, long* plDevLst, unsigned long long* pullLbCode) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. lNetNo Network number Specify the network number of target module.
  • Page 197 Description • This function reads labels of a CPU module specified to the network number (lNetNo) and the station number (lStNo). • Reserve the area for the device name array (plDevLst) in the call source. • Reserve the area for (lLbCnt × 3 + 1) for the size of area of the device name array (plDevLst). •...
  • Page 198 Example The following tables show the examples of values specified to the label name array (pLbLst) and data read to the device name array (plDevLst). (For five labels to be read: Label 1 to 5). Describe a target label name in a text file, and save it by specifying Unicode (UTF-16). Read the label name in a binary format on a user program from the saved text file, and store the address of the label name to pass to the label name array (pLbLst) on the memory.
  • Page 199 mdInit This function initializes communication route information. Format short mdInit(long lPath) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. Description This function clears communication route information using the path of the specified channel. Return value Return value Description...
  • Page 200 mdOpen This function opens a communication line (channel). Format short mdOpen(short sChan, short sMode, long* plPath) Argument Argument Name Description IN/OUT sChan Channel Specify a communication line (channel). Page 44 Argument specification sMode Mode Specify '-1'. plPath Path of channel Specify the storage destination (address) of the path of the channel.
  • Page 201 mdRandREx This function reads devices randomly. Format long mdRandREx(long lPath, long lNetNo, long lStNo, long* plDev, short* psBuf, long lBufSize) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. lNetNo Network number Specify the network number of target module. Page 44 Argument specification lStNo Station number...
  • Page 202 Example The following tables show the examples of values specified to the randomly selected device (plDev), values read to the read data storage destination (psBuf), and the number of bytes of read data. Device to be read randomly Current value M100 to M115 All bits are OFF.
  • Page 203 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant functions • Page 198 mdOpen • Page 190 mdClose • Page 205 mdRandWEx 3 DETAILS OF FUNCTION 3.3 MELSEC Data Link Functions...
  • Page 204 mdRandRLabelEx This function reads devices corresponding to labels randomly. Format long mdRandRLabelEx(long lPath, long lNetNo, long lStNo, long* plDev, short* psBuf, long lBufSize, unsigned long long ullLbCode) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. lNetNo Network number Specify the network number of target module.
  • Page 205 Example The following tables show the examples of values specified to the randomly selected device (plDev), values read to the read data storage destination (psBuf), and the number of bytes of read data. Device to be read randomly Current value M100 Bit is OFF.
  • Page 206 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST *1 For a return value which does not exist in the reference, refer to the manual for the programmable controller CPU. (MELSEC iQ-R CPU Module User's Manual (Application)) Relevant functions •...
  • Page 207 mdRandWEx This function writes devices randomly. Format long mdRandWEx(long lPath, long lNetNo, long lStNo, long* plDev, short* psBuf, long lBufSize) Argument Argument Name Description IN/OUT lPath Channel Specify the path of the channel. lNetNo Network number Specify the network number of target module. Page 44 Argument specification lStNo Station number...
  • Page 208 Example The following tables show the examples of values specified to the randomly selected device (plDev) and the write data storage destination (psBuf), and the number of bytes of write data. Device to be written randomly Description M100 to M115 Turns all the bits OFF.
  • Page 209 mdRandWLabelEx This function writes devices corresponding to labels randomly. Format long mdRandWLabelEx(long lPath, long lNetNo, long lStNo, long* plDev, short* psBuf, long lBufSize, unsigned long long ullLbCode) Argument Argument Name Description IN/OUT lPath Channel Specify the path of the channel. lNetNo Network number Specify the network number of target module.
  • Page 210 Example The following tables show the examples of values specified to the randomly selected device (plDev) and the write data storage destination (psBuf), and the number of bytes of write data. Device to be written randomly Description M100 Turns the bit OFF. D10 to D13 Stores 10 in D10, 200 in D11, 300 in D12, and 400 in D13.
  • Page 211 mdReceiveEx This function reads devices in a batch. Format long mdReceiveEx(long lPath, long lNetNo, long lStNo, long lDevType, long lDevNo, long* plSize, short* psData) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. lNetNo Network number Specify the network number of target module.
  • Page 212 mdReceiveEx This function receives messages. (RECV function) Format long mdReceiveEx(long lPath, long lNetNo, long lStNo, long lDevType, long lDevNo, long* plSize, short* psData) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. lNetNo Network number Specify '0' (0H).
  • Page 213 • The arguments of this function correspond to the control data (device) of the dedicated instruction (RECV) as shown below: Device Item Corresponding argument and return value  Error completion type Completion status sRet Own station storage channel lDevNo Channel used by send station psData[2] Send station network number psData[0]...
  • Page 214 mdSendEx This function writes devices in a batch. Format long mdSendEx(long lPath, long lNetNo, long lStNo, long lDevType, long lDevNo, long* plSize, short* psData) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. lNetNo Network number Specify the network number of target module.
  • Page 215 mdSendEx This function sends messages. (SEND function) Format long mdSendEx(long lPath, long lNetNo, long lStNo, long lDevType, long lDevNo, long* plSize, short* psData) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. lNetNo Network number Specify the network number of target module.
  • Page 216 • The arguments of this function correspond to the control data (device) of the dedicated instruction (SEND) as shown below: Device Item Corresponding argument and return value Execution/error completion type lDevType Completion status sRet Own station channel lDevNo Target station storage channel lDevNo Target station network number lNetNo...
  • Page 217 mdTypeRead This function reads the model code of a CPU module. Format short mdTypeRead(long lPath, short sStNo, short* psCode) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel. sStNo Station number Specify the network number and station number of the target module. Page 44 Argument specification psCode Model code...
  • Page 218 Model code (hexadecimal) CPU module 0362H Q04UDPVCPU 0363H Q06UDPVCPU 0364H Q13UDPVCPU 0365H Q26UDPVCPU 0366H Q03UDVCPU 0367H Q04UDVCPU 0368H Q06UDVCPU 036AH Q13UDVCPU 036CH Q26UDVCPU 0541H L02CPU 0543H L02SCPU 0544H L06CPU 0545H L26CPU 0548H L26CPU-BT 0549H L02CPU-P 054AH L26CPU-PBT 0641H LJ72GF15-T2 0642H NZ2GF-ETB 2014H Q172DCPU(-S1)
  • Page 219 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST Relevant functions • Page 198 mdOpen • Page 190 mdClose 3 DETAILS OF FUNCTION 3.3 MELSEC Data Link Functions...
  • Page 220 Motion Module Dedicated Class This section shows the details of the motion module dedicated classes. MCFB::RefreshLabels This function executes an MCFB with I/O variables and input variables set in the MCFB setting function. After the execution, I/ O variables, input variables and public variables are refreshed. Format short MCFB::RefreshLabels(void) Argument...
  • Page 221 MCFBExecute::SetExecute This function sets I/O variables and input variables of an Execute-type MCFB in a motion module. Format short MCFBExecute::SetExecute(bool Execute) Argument Argument Name Description IN/OUT Execute Execution command Specify a value to be set for Execute, which is an input variable of an Execute-type MCFB.
  • Page 222 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST 3 DETAILS OF FUNCTION 3.4 Motion Module Dedicated Class...
  • Page 223 MCFBEnable::SetEnable This function sets I/O variables and input variables of an Enable-type MCFB in a motion module. Format short MCFBEnable::SetEnable(bool Enable) Argument Argument Name Description IN/OUT Enable Execution command Specify a value to be set for Enable, which is an input variable of an Enable-type MCFB. Description •...
  • Page 224 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST 3 DETAILS OF FUNCTION 3.4 Motion Module Dedicated Class...
  • Page 225: Mcv_Jog::setenablejog

    MCv_Jog::SetEnableJog This function sets I/O variables and input variables of an Enable-type MCv_Jog in a motion module. Format short MCv_Jog::SetEnableJog(bool JogForward, bool JogBackward) Argument Argument Name Description IN/OUT JogForward Forward JOG command Specify a value to be set in JogForward, which is the input variable of MCv_Jog of an Enable-type MCFB.
  • Page 226 Return value Return value Description 0 (0000H) Normal Other than 0 Error For details on the error, refer to the following: Page 225 ERROR CODE LIST 3 DETAILS OF FUNCTION 3.4 Motion Module Dedicated Class...
  • Page 227: Chapter 4 Error Code List

    ERROR CODE LIST This chapter shows the codes for errors occurred in the dedicated function library and the corrective actions. Common Error Codes The following table shows the common error codes for the dedicated function library. Error code Description Corrective action Decimal Hexadec imal...
  • Page 228 Error code Description Corrective action Decimal Hexadec imal Device number error 0082H Check the device number. • The specified device number is out of range. • The specified bit device number is not a multiple of 8. Number of device points error 0083H Check the specified number of device points.
  • Page 229 Error code Description Corrective action Decimal Hexadec imal Function unsupported error -28624 9030H • Check if the target CC-Link module supports the station- • Any processing was performed to the module which does not based block data assurance function for cyclic data. support the station-based block data assurance function for •...
  • Page 230 Error code Description Corrective action Decimal Hexadec imal Inaccessible error -28661 900BH Review the specified offset and size. Inaccessible area was specified. -28662 900AH CPU number specification error • Review the specified CPU number. The specified CPU number is out of range or unavailable. •...
  • Page 231: C Controller Module Dedicated Functions

    C Controller Module Dedicated Functions The following table shows the error codes of the C Controller module dedicated functions. Error code Description Corrective action Decimal Hexadec imal Module identification error -201 FF37H Check the specified module identification. The specified module identification is unavailable. I/O signal error -203 FF35H...
  • Page 232 Error code Description Corrective action Decimal Hexadec imal Event wait error -234 FF16H • Check if a program is forcibly being terminated. An error other than timeout occurred while the function waits • Check if the C Controller module is running normally. for the event.
  • Page 233 Error code Description Corrective action Decimal Hexadec imal Response completion wait timeout error -256 FF00H • Increase the timeout time specified to the argument. A timeout occurred while waiting for completion of a • Review and correct the user program (including other tasks which response of a processing requested to other CPU modules.
  • Page 234 Error code Description Corrective action Decimal Hexadec imal MODE is being selected by switch operation -290 FEDEH Execute the function after selecting an operation. The CCPU_SetOpSelectMode function or the CCPU_SetDotMatrixLED function was executed while an operation was being selected with the MODE/SELECT switch.
  • Page 235 Error code Description Corrective action Decimal Hexadec imal Program fault -309 FECBH Correct the argument of the function. The specified number of devices is incorrect. -310 FECAH Operation error Correct the argument of the function. An unusable character string for a function is specified. Operation error -311 FEC9H...
  • Page 236 Error code Description Corrective action Decimal Hexadec imal Group No. specification error -328 FEB8H Check the specified group number. The specified group number is out of range. -329 FEB7H Link time specification error Check the specified link scan time. The specified link scan time is out of range. Number of detections of disconnected slave stations error -330 FEB6H...
  • Page 237: Melsec Data Link Functions

    MELSEC Data Link Functions The following table shows the error codes of MELSEC data link functions. Error code Description Corrective action Decimal Hexadec imal Path error FFFFH • Use a path pointer returned with the mdOpen function. • The specified path is unavailable. •...
  • Page 238 Error code Description Corrective action Decimal Hexadec imal Module load error FFE1H • The memory may be insufficient. End another running task or Loading modules required for executing functions failed. reduce the access size. • Check the status of the system drive of the C Controller module.
  • Page 239 Error code Description Corrective action Decimal Hexadec imal Size error FFADH Check the number of labels. The number of labels exceeded the range. FFACH Device specification method error Check the device specification method. A device was specified by inappropriate specification method (bit specification or digit specification).
  • Page 240: Motion Module Dedicated Class

    Motion Module Dedicated Class The following table shows error codes for the motion module dedicated class. Error code Description Corrective action Decimal Hexadec imal I/O number specification error 1024 400H Specify the input/output number specified at the first normal The input/output number of an instance is changed from the one completion of the MCFB setting function and execute the specified at the first normal completion of the MCFB setting function or MCFB::RefreshLabels function.
  • Page 241: Error Codes Different From Conventional Functions

    Error Codes Different From Conventional Functions Error code (return value) for replaced functions may differ from the one for conventional functions. Be sure to refer to the list of error code in this manual (Page 225 ERROR CODE LIST) to perform the troubleshooting. 4 ERROR CODE LIST 4.5 Error Codes Different From Conventional Functions...
  • Page 242: Appendix

    APPENDIX Appendix 1 Example for Replacing Ladder by C Language This section shows program examples for replacing ladder by C language. Program example The following shows a program for writing the data in psData[5] of the station number 0 (own station) to the buffer memory (address: 0 to 4) of the intelligent device station/remote device station on the station number 1 (target station).
  • Page 243 The CPU module is C Controller module Example for using the C Controller module dedicated function short CCPU_DedicatedJInstSample(void){ short sRet=0; /*(1)*/ char pcInstName[8]="REMTO"; /*(2)*/ short sNetNo=1; /*(3)*/ short sChan=1; /*(4)*/ short sStNo=1; /*(5)*/ short sIoNo=0x0000; /*(6)*/ short sAdd=0; /*(7)*/ short psData[5]={1,2,3,4,5}; /*(8)*/ short sSize=5;...
  • Page 244: Appendix 2 How To Replace A Q12Dccpu-V

    Appendix 2 How to Replace a Q12DCCPU-V Replacement of projects Import the Q12DCCPU-V projects by using the Import function of CW Workbench (SW1DND-CWWR-E/EZ/EVZ). Select the "Build Support and Specs" tab on the screen of property for the imported project, and change "Active build spec" to "ARMARCH7gnu_SMP".
  • Page 245 MELSEC data link functions Device types for accessing CC-Link modules Device type deleted from R12CCPU-V Alternative method Device Device name specification Own station remote input DevX The area (device) corresponding to the device type deleted from R12CCPU-V can be accessed with either of the methods below. Own station remote output DevY Page 244 Refreshing device, The access target is a network...
  • Page 246 Device types for accessing CC-Link IE Field Network modules Device type deleted from R12CCPU-V Alternative method Device Device name specification Own station remote input DevLX(0) The area (device) corresponding to the device type deleted from R12CCPU-V can be accessed with either of the methods below. Own station remote output DevLY(0) Page 244 Refreshing device, The access target is a network...
  • Page 247: Compilation Of Replaced Project

    Compilation of replaced project Compile the replaced project in CW Workbench. APPX Appendix 2 How to Replace a Q12DCCPU-V...
  • Page 248: Appendix 3 Correspondence Table To Q12Dccpu-V Functions

    Appendix 3 Correspondence Table to Q12DCCPU-V Functions : Conventional functions can be used. : Conventional functions cannot be used. : Replacement of functions is not required. Not available: No functions are available to be replaced. C Controller module dedicated functions Function name (Q12DCCPU-V) Mode type Availability in R12CCPU-V Function name (replaced)
  • Page 249: Bus Interface Functions

    Bus interface functions Function name (Q12DCCPU-V) Mode type Availability in R12CCPU- Function name (replaced)  QBF_Close Basic mode/Extended mode Not available QBF_ControlEx Basic mode/Extended mode  CCPU_Control  QBF_ControlProgram Basic mode/Extended mode Not available QBF_FromBuf Basic mode/Extended mode  CCPU_FromBuf, CCPU_FromBufHG ...
  • Page 250: Bus Interface Functions For Isr

    Function name (Q12DCCPU-V) Mode type Availability in R12CCPU- Function name (replaced) QBF_ClearError Basic mode/Extended mode  CCPU_ClearError  QBF_Control Basic mode/Extended mode CCPU_Control QBF_Control7SegLED Basic mode/Extended mode  CCPU_SetDotMatrixLED  QBF_ControlLED Basic mode/Extended mode CCPU_SetLEDStatus  QBF_EntryTimerEvent Basic mode/Extended mode CCPU_EntryTimerEvent ...
  • Page 251: Melsec Data Link Functions

    MELSEC data link functions Function name (Q12DCCPU-V) Mode type Availability in R12CCPU- Function name (replaced)   mdClose Basic mode/Extended mode mdControl Basic mode/Extended mode     mdDevRstEx Basic mode/Extended mode mdDevSetEx Basic mode/Extended mode    ...
  • Page 252: Appendix 4 How To Replace A Q06Ccpu-V

    Appendix 4 How to Replace a Q06CCPU-V Replacement of projects Create a new project in CW Workbench and add source code. *1 For creating a project, refer to the following: CW Workbench/CW-Sim Operating Manual Replacement of VxWorks standard API functions The operating system of R12CCPU-V has been upgraded from Q06CCPU-V.
  • Page 253 MELSEC data link functions Device types for accessing CC-Link modules Device type deleted from R12CCPU-V Alternative method Device Device name specification Own station remote input DevX The area (device) corresponding to the device type deleted from R12CCPU-V can be accessed with either of the methods below. Own station remote output DevY The access target is a network module on the own...
  • Page 254 Alternative method Refreshing device Access target Alternative method The access target is a network module on the own Configure the refresh setting so that a device of C Controller module, M, B, D, W, or ZR is refreshed by station. a link device of a network module.
  • Page 255: Compilation Of Replaced Project

    Compilation of replaced project Compile the replaced project in CW Workbench. APPX Appendix 4 How to Replace a Q06CCPU-V...
  • Page 256: Appendix 5 Correspondence Table To Q06Ccpu-V Functions

    Appendix 5 Correspondence Table to Q06CCPU-V Functions : Conventional functions can be used. : Conventional functions cannot be used. : Replacement of functions is not required. Not available: No functions are available to be replaced. Bus interface functions Function name (Q06CCPU-V) Availability in R12CCPU-V Function name (replaced) ...
  • Page 257: Melsec Data Link Functions

    MELSEC data link functions Function name (Q06CCPU-V) Availability in R12CCPU-V Function name (replaced) mdClose     mdControl mdDevRstEx     mdDevSetEx mdInit     mdOpen   mdRandREx   mdRandWEx   mdReceiveEx (Device batch read function) mdReceiveEx (Message receive function) ...
  • Page 258: Index

    INDEX ... . . 14,17 Bus interface communication ..8,10 C Controller module dedicated function ....14,41 CC-Link communication .
  • Page 259 MEMO...
  • Page 260: Function Index

    FUNCTION INDEX ....134 CCPU_SetOpSelectMode ......135 CCPU_SetRTC .
  • Page 261 MEMO...
  • Page 262: Revisions

    Japanese manual number: SH-081370-L This manual confers no industrial property rights or any 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.
  • Page 263: Warranty

    WARRANTY Please confirm the following product warranty details before using this product. 1. Gratis Warranty Term and Gratis Warranty Range If any faults or defects (hereinafter "Failure") found to be the responsibility of Mitsubishi occurs during use of the product within the gratis warranty term, the product shall be repaired at no cost via the sales representative or Mitsubishi Service Company.
  • Page 264: Information And Services

    INFORMATION AND SERVICES For further information and services, please contact your local Mitsubishi Electric sales office or representative. Visit our website to find our locations worldwide. MITSUBISHI ELECTRIC Factory Automation Global Website Locations Worldwide www.MitsubishiElectric.com/fa/about-us/overseas/ TRADEMARKS Microsoft and Windows are trademarks of the Microsoft group of companies.
  • Page 266 SH(NA)-081371ENG-L(2310) MODEL: RCCPU-P-E HEAD OFFICE: TOKYO BLDG., 2-7-3, MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN NAGOYA WORKS: 1-14, YADA-MINAMI 5-CHOME, HIGASHI-KU, NAGOYA 461-8670, 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.

Table of Contents