Mitsubishi Electric MELSEC iQ-R Series Manual

Mitsubishi Electric MELSEC iQ-R Series Manual

Intelligent function module
Hide thumbs Also See for MELSEC iQ-R Series:

Quick Links

MELSEC iQ-R C Intelligent Function Module
Programming Manual
Table of Contents
loading

Summary of Contents for Mitsubishi Electric MELSEC iQ-R Series

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

    SAFETY PRECAUTIONS (Read these precautions before using this product.) Before using this product, please read this manual and the relevant manuals carefully, and pay full attention to safety to handle the product correctly. In this manual, the safety precautions are classified into two levels: " WARNING"...
  • Page 4: Considerations For Use

    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. Please make sure that the end users read this manual.
  • Page 5: Table Of Contents

    MELSEC iQ-R Series Data Link Functions ........
  • Page 6: Relevant Manuals

    System configuration, specifications, functions, and troubleshooting of CW e-Manual [SH-081373ENG] 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 7: Terms

    CW Workbench not installed. Dedicated function library A generic term for C intelligent function module dedicated function and MELSEC iQ-R series data link function. Engineering tool Another term of the software package for the MELSEC programmable controllers.
  • Page 8: Chapter 1 Common Items

    Dedicated function libraries offered by a C intelligent function module are as follows: • C intelligent function module dedicated function • MELSEC iQ-R series data link function For the execution procedure of user programs, refer to the following manual. MELSEC iQ-R C Intelligent Function Module User's Manual (Startup) Header Files Include the following header files in a user program to use the dedicated function library.
  • Page 9: C Intelligent Function Module Dedicated Functions

    C Intelligent Function Module Dedicated Functions C intelligent function module dedicated functions of the dedicated function libraries are used to control C intelligent function module. These functions can be used for reading status of the module or accessing resources such as LED control. Program processing The following procedure shows the processing flow of the user program using C intelligent function module.
  • Page 10: Melsec Iq-R Series Data Link Functions

    Accesses a CPU module on the CC-Link via a CC-Link module. Program processing The following procedure shows the processing flow of the user program using MELSEC iQ-R series data link function. When accessing with a device name Start a task.
  • Page 11: Considerations

    ■ taskDelete execution Do not execute the taskDelete in a task using MELSEC iQ-R series data link function. Also, do not delete a task using the MELSEC iQ-R series data link function with the taskDelete. Otherwise, the MELSEC iQ-R series data link function may not operate properly.
  • Page 12: Accessible Range

    Own station : Accessible, : Not accessible, : Not applicable Communication route Access target  (CPU No.1 to 4)  (CPU No.1 to 4)    Bus interface communication 1 COMMON ITEMS 1.3 MELSEC iQ-R Series Data Link Functions...
  • Page 13 : Accessible, : Not accessible, : Not applicable Communication route Access target  (CPU No.1 to 4)  (CPU No.1 to 4)  (CPU No.1 to 4)   (CPU No.1 to 4) CC-Link 1 COMMON ITEMS 1.3 MELSEC iQ-R Series Data Link Functions...
  • Page 14     Step relay (S) Direct input (DX)           Direct output (DY)      Accumulator (A) 1 COMMON ITEMS 1.3 MELSEC iQ-R Series Data Link Functions...
  • Page 15 *11 "": Specify the start I/O number 10H. *12 "": Specify the CPU number (CPU No.1: 0, CPU No.2: 1, CPU No.3: 2, CPU No.4: 3) *13 Only the mdrRandRLabel/mdrRandWLabel function can be used. 1 COMMON ITEMS 1.3 MELSEC iQ-R Series Data Link Functions...
  • Page 16: Argument Specification

    Bus interface Used for communication via bus. CPU number, network number, start I/O number, station number CPU numbers, Network numbers, start I/O numbers and station numbers to be specified to MELSEC iQ-R series data link functions are as follows: Access route...
  • Page 17 For bit A 263H DevGV_A For bit B 264H DevGV_B For bit C 265H DevGV_C For bit D 266H DevGV_D For bit E 267H DevGV_C For bit F 268H DevGV_F 1 COMMON ITEMS 1.3 MELSEC iQ-R Series Data Link Functions...
  • Page 18 (All of the bits turn ON in read data. For word devices, the read data is '-1'.) *4 "": indicates a network number. *5 Only the mdrRandRLabel/mdrRandWLabel function can be used. 1 COMMON ITEMS 1.3 MELSEC iQ-R Series Data Link Functions...
  • Page 19: 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 will be executed in an interrupt service routine (ISR: InterruptServiceRoutine) by using the C intelligent function module dedicated function for ISR. To use another dedicated function by synchronizing it to an interrupt, implement the notification processing in a user program and perform the processing in a task.
  • Page 20: Chapter 2 Function List

    FUNCTION LIST This chapter shows the functions used for C intelligent function modules. C Intelligent Function Module Dedicated Functions The C intelligent function module dedicated functions are as listed below. C intelligent function module dedicated functions Function name Description Reference Page 22 CITL_ChangeFileSecurity CITL_ChangeFileSecurity To change the file access restriction status of a C intelligent function...
  • Page 21 Function name Description Reference Page 59 CITL_ToBuf CITL_ToBuf To write data to the buffer memory of a C intelligent function module. CITL_UnmountMemoryCard To unmount the SD memory card inserted to a C intelligent function Page 60 CITL_UnmountMemoryCard module. Page 61 CITL_WaitCollectDataRecvEvent CITL_WaitCollectDataRecvEvent To wait for data to be sampled in data sampling in each sequence scan.
  • Page 22: C Intelligent Function Module Dedicated Functions For Isr

    C intelligent function module dedicated functions for ISR Function name Description Reference Page 71 CITL_DisableYInt_ISR CITL_DisableYInt_ISR To disable the routine registered with the CITL_EntryYInt function. Page 72 CITL_EnableYInt_ISR CITL_EnableYInt_ISR To enable the routine registered with the CITL_EntryYInt function. Page 73 CITL_FromBuf_ISR CITL_FromBuf_ISR To read data from the buffer memory of a C intelligent function module.
  • Page 23: Melsec Iq-R Series Data Link Functions

    MELSEC iQ-R Series Data Link Functions The MELSEC iQ-R series data link functions are as listed below. Function name Description Reference Page 82 mdrClose mdrClose To close a communication line (channel). Page 83 mdrControl mdrControl To perform remote operations (RUN/STOP/PAUSE) for a CPU module.
  • Page 24: Chapter 3 Details Of Function

    DETAILS OF FUNCTION This chapter shows the details of the C intelligent function module dedicated function and the MELSEC iQ-R series data link function. C Intelligent Function Module Dedicated Functions This section shows the details of the C intelligent function module dedicated function.
  • Page 25 CITL_ClearError This function clears errors of a C intelligent function module. ■ Format short CITL_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 intelligent function module. •...
  • Page 26 CITL_DisableYInt This function disables the routine registered with the CITL_EntryYInt function. ■ Format short CITL_DisableYInt (short sYNo) ■ Argument Argument Name Description IN/OUT sYNo Output signal (Y) number Specify the output signal (Y) number. (If -1 is specified, disable all the registered routines.) ■...
  • Page 27 CITL_EnableYInt This function enables the routine registered with the CITL_EntryYInt function. ■ Format short CITL_EnableYInt (short sYNo) ■ Argument Argument Name Description IN/OUT sYNo Output signal (Y) number Specify the output signal (Y) number. (If -1 is specified, enable all the registered routines.) ■...
  • Page 28 CITL_EntryDedicatedInstFunc This function registers a routine to be executed with the dedicated instruction (G(P).CEXECUTE). ■ Format short CITL_EntryDedicatedInstFunc (CITL_CEXECUTEFUNCPTR pCEXECUTEFuncPtr) ■ Argument Argument Name Description IN/OUT pCEXECUTEFuncPtr Registered routine Specify the routine to be registered. (The routine is deregistered by specifying NULL.) The data type of registered routine (pCEXECUTEFuncPtr) is defined by the header file (CITLFunc.h) as follows: •...
  • Page 29 CITL_EntryTimerEvent This function registers a timer event. ■ Format short CITL_EntryTimerEvent (long* plEvent) ■ Argument Argument Name Description IN/OUT plEvent Registered event Specify a timer event to be registered. The specification method of the registered event (plEvent) is as follows: Specification Description position...
  • Page 30 ■ Description • The CITL_EntryTimerEvent function sets the cycle and synchronization type for the timer event registration. • When '0' is specified to the cycle of the registered event (plEvent), the timer event is deregistered (the occurrence is cleared). Deregistration will clear the events that have occurred before that. •...
  • Page 31 CITL_EntryWDTInt This function registers a routine to be called when a user WDT error interrupt occurs. ■ Format short CITL_EntryWDTInt (short sType, CITL_FUNCPTR pFuncPtr) ■ Argument Argument Name Description IN/OUT sType WDT type Specify the WDT type. (When 'Reserved' is specified, an error is returned.) •...
  • Page 32 CITL_EntryYInt This function registers a routine to be called when an output signal (Y) interrupt occurs. ■ Format short CITL_EntryYInt (short sYNo, CITL_FUNCPTR pFuncPtr) ■ Argument Argument Name Description IN/OUT sYNo Output signal (Y) number Specify the output signal (Y) number. pFuncPtr Registered routine Specify the routine to be registered.
  • Page 33 CITL_FromBuf This function reads data from the buffer memory of a C intelligent function module. ■ Format short CITL_FromBuf (unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) ■ Argument Argument Name Description IN/OUT ulOffset Offset Specify the offset in word units. ulSize Data size Specify the read data size in word units.
  • Page 34 CITL_GetCollectData This function acquires data sampled in data sampling in each sequence scan. ■ Format short CITL_GetCollectData (short* psBuf, unsigned long ulBufSize, unsigned long* pulRecordNum) ■ Argument Argument Name Description IN/OUT psBuf Acquired data storage destination Specify the storage destination of acquired data. ulBufSize Acquired data storage destination Specify the size of the area reserved in the acquired data storage destination...
  • Page 35 Precautions If CPU parameters of a control CPU module are changed during data sampling in each sequence scan, data sampling is stopped. Since the assignment of devices may be changed due to the change of CPU parameters, set target data with the C intelligent function module dedicated function (CITL_SetCollectData) again when restarting data sampling.
  • Page 36 CITL_GetCounterMicros This function acquires a 1 s counter value of a C intelligent function module. ■ Format short CITL_GetCounterMicros(unsigned long* pulMicros) ■ Argument Argument Name Description IN/OUT 1 s counter value storage Specify the storage destination of the 1 s counter value. pulMicros destination ■...
  • Page 37 CITL_GetCounterMillis This function acquires a 1 ms counter value of a C intelligent function module. ■ Format short CITL_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 ■...
  • Page 38 CITL_GetErrInfo This function acquires the error information of a C intelligent function module. ■ Format short CITL_GetErrInfo(unsigned short* pusErrorInfo, unsigned long ulBufSize) ■ Argument Argument Name Description IN/OUT pusErrorInfo Error information storage destination Specify the error information storage destination. ulBufSize Error information storage destination Specify the error information storage destination size in word units.
  • Page 39 CITL_GetFileSecurity This function acquires the file access mode of a C intelligent function module. ■ Format short CITL_GetFileSecurity(short* psMode) ■ Argument Argument Name Description IN/OUT psMode File access mode Stores the file access mode. • 0: Access restriction clear mode •...
  • Page 40 CITL_GetIDInfo This function acquires the individual identification information of a C intelligent function module. ■ Format short CITL_GetIDInfo (unsigned char* pucGetData, unsigned long ulBufSize) ■ Argument Argument Name Description IN/OUT pucGetData Individual identification information Specify the individual identification information storage destination. storage destination ulBufSize Individual identification information...
  • Page 41 CITL_GetLEDStatus This function acquires the LED status of a C intelligent function module. ■ Format short CITL_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 42 CITL_GetSerialNo This function acquires the serial number of a C intelligent function module. ■ Format short CITL_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 43 CITL_GetSwitchStatus This function acquires the switch status of a C intelligent function module. ■ Format short CITL_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 size Specify the switch status storage destination size in double word units.
  • Page 44 CITL_GetTime This function acquires the clock data (local time) of a C intelligent function module. ■ Format short CITL_GetTime(short* psGetData, unsigned long ulBufSize) ■ Argument Argument Name Description IN/OUT psGetData Clock data storage destination Specify the storage destination of the clock data. ulBufSize Clock data storage destination size Specify the clock data storage destination size in word units.
  • Page 45 CITL_GetUnitStatus This function acquires the operating status of a C intelligent function module. ■ Format short CITL_GetUnitStatus(long* plStatusBuf, unsigned long ulBufSize) ■ Argument Argument Name Description IN/OUT plStatusBuf Operating status storage destination Specify the storage destination of the operating status. ulBufSize Operating status storage destination Specify the size of area reserved in the operating status storage destination...
  • Page 46 CITL_MountMemoryCard This function mounts the SD memory card inserted to a C intelligent function module. ■ Format short CITL_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 47 CITL_RegistEventLog This function registers an event log in the event history of a control CPU module. ■ Format short CITL_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...
  • Page 48 CITL_ResetWDT This function resets the user WDT of a C intelligent function module. ■ Format short CITL_ResetWDT (short sType) ■ Argument Argument Name Description IN/OUT sType WDT type Specify the WDT type. (When 'Reserved' is specified, an error is returned.) •...
  • Page 49 (plSetData), settings will be cleared and the temporary area will be released. • Specify a device which can be accessed with a MELSEC iQ-R series data link function for the device type. • The specification method of the storage destination for data set in the data sampling in each sequence scan setting...
  • Page 50 ■ Description • This function sets data to be sampled in each sequence scan according to the storage destination for data set in the data sampling in each sequence scan setting (plSetData). • When executing the CITL_SetCollectData function multiple times, the last executed setting is enabled. •...
  • Page 51 CITL_SetLEDStatus This function sets the LED status of a C intelligent function module. ■ Format short CITL_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 52 CITL_SetSyncTimeStatus This function sets the operating status of time synchronization of a C intelligent function module. ■ Format short CITL_SetSyncTimeStatus (unsigned short usSyncTimeStatus) ■ Argument Argument Name Description IN/OUT usSyncTimeStatus Time synchronization operating Specify the operating status of time synchronization. status The specification method of the time synchronization operating status (usSyncTimeStatus) is as follows: Either a definition name or a value can be specified as the time synchronization operating status.
  • Page 53 CITL_ShutdownRom This function shuts down the standard ROM of a C intelligent function module. ■ Format short CITL_ShutdownRom (void) ■ Argument None ■ Description • This function shuts down the standard ROM of a C intelligent function module. (The shutdown status can be checked with the CITL_GetUnitStatus function.) •...
  • Page 54 CITL_StartCollectData This function starts data sampling in each sequence scan. ■ Format short CITL_StartCollectData (void) ■ Argument None ■ Description This function starts data sampling in each sequence scan. This function performs according to the contents set with the CITL_SetCollectData function. ■...
  • Page 55 CITL_StartWDT This function sets and starts the user WDT of a C intelligent function module. ■ Format short CITL_StartWDT(short sType, short sInterval) ■ Argument Argument Name Description IN/OUT sType WDT type Specify the WDT type. (When 'Reserved' is specified, an error is returned.) •...
  • Page 56 CITL_StopCollectData This function stops data sampling in each sequence scan. ■ Format short CITL_StopCollectData (void) ■ Argument None ■ Description This function stops data sampling in each sequence scan. To restart data sampling in each sequence scan, execute the CITL_StartCollectData function. Precautions When executing the CITL_StopCollectData function, the buffer memory (data missing status) of a C intelligent function module is initialized.
  • Page 57 CITL_StopWDT This function stops the user WDT of a C intelligent function module. ■ Format short CITL_StopWDT(short sType) ■ Argument Argument Name Description IN/OUT sType WDT type Specify the WDT type. (When 'Reserved' is specified, an error is returned.) • 0: User WDT •...
  • Page 58 CITL_SyncTime This function synchronizes the time of a C intelligent function module with that of a control CPU module. ■ Format short CITL_SyncTime (void) ■ Argument None ■ Description This function synchronizes the time of a C intelligent function module with that of a control CPU module. ■...
  • Page 59 CITL_SysClkRateGet This function reads the system clock rate specified with the CITL_SysClkRateSet function from the flash ROM. ■ Format short CITL_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 60 CITL_SysClkRateSet This function saves the specified system clock rate in the flash ROM. ■ Format short CITL_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 61 CITL_ToBuf This function writes data to the buffer memory of a C intelligent function module. ■ Format short CITL_ToBuf (unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) ■ Argument Argument Name Description IN/OUT ulOffset Offset Specify the offset in word units. ulSize Data size Specify the write data size in word units.
  • Page 62 CITL_UnmountMemoryCard This function unmounts the SD memory card inserted to a C intelligent function module. ■ Format short CITL_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 63 CITL_WaitCollectDataRecvEvent This function waits for data to be sampled in data sampling in each sequence scan. ■ Format short CITL_WaitCollectDataRecvEvent (unsigned short usWaitRecord, unsigned long ulTimeout) ■ Argument Argument Name Description IN/OUT usWaitRecord Number of wait records Specify the number of records waiting to be sampled. ulTimeout Timeout value Specify the timeout value in ms units (0H to FFFFFFFFH).
  • Page 64 CITL_WaitSwitchEvent This function waits for a switch interrupt event of a C intelligent function module to occur. ■ Format short CITL_WaitSwitchEvent(short sSwitch, unsigned long ulTimeout) ■ Argument Argument Name Description IN/OUT sSwitch Switch interrupt event type Specify the switch interrupt event type. •...
  • Page 65 CITL_WaitTimerEvent This function waits for a timer event to occur. ■ Format short CITL_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) ■...
  • Page 66 CITL_WaitYEvent This function waits for the output signal (Y) interrupt event notification. ■ Format short CITL_WaitYEvent (short* psYNo, unsigned long ulTimeout, unsigned short* pusSetEventNo) ■ Argument Argument Name Description IN/OUT psYNo Output signal (Y) number Specify the output signal (Y) number. ulTimeout Timeout value Specify the timeout value in ms units (0H to FFFFFFFFH).
  • Page 67 CITL_X_In_Bit This function reads an input signal (X) in bit (1-point) units. ■ Format short CITL_X_In_Bit (unsigned short usXNo, unsigned short* pusData) ■ Argument Argument Name Description IN/OUT usXNo Input signal Specify the input signal (X). (0 to 31) pusData Data storage destination Specify the storage destination of read data.
  • Page 68 CITL_X_In_Word This function reads an input signal (X) in word (16-point) units. ■ Format short CITL_X_In_Word (unsigned short usXNo, unsigned short usSize, unsigned short* pusDataBuf, unsigned short usBufSize) ■ Argument Argument Name Description IN/OUT usXNo Start input signal Specify a start input signal (X). (Only 0x00 and 0x10 can be specified.) usSize Read data size...
  • Page 69 CITL_X_Out_Bit This function writes to an input signal (X) in bit (1-point) units. ■ Format short CITL_X_Out_Bit (unsigned short usXNo, unsigned short usData) ■ Argument Argument Name Description IN/OUT usXNo Input signal Specify the input signal (X). (0 to 31) usData Write data Specify the written data.
  • Page 70 CITL_X_Out_Word This function writes to an input signal (X) in word (16-point) units. ■ Format short CITL_X_Out_Word (unsigned short usXNo, unsigned short usSize, unsigned short* pusDataBuf, unsigned short usBufSize) ■ Argument Argument Name Description IN/OUT usXNo Start input signal Specify a start input signal (X). (Only 0x00 and 0x10 can be specified.) usSize Write data size...
  • Page 71 CITL_Y_In_Bit This function reads an output signal (Y) in bit (1-point) units. ■ Format short CITL_Y_In_Bit (unsigned short usYNo, unsigned short* pusData) ■ Argument Argument Name Description IN/OUT usYNo Output signal Specify the output signal (Y). (0 to 31) pusData Data storage destination Specify the storage destination of read data.
  • Page 72 CITL_Y_In_Word This function reads an output signal (Y) in word (16-point) units. ■ Format short CITL_Y_In_Word (unsigned short usYNo, unsigned short usSize, unsigned short* pusDataBuf, unsigned short usBufSize) ■ Argument Argument Name Description IN/OUT usYNo Start output signal Specify a start output signal (Y). (Only 0x00 and 0x10 can be specified.) usSize Read data size...
  • Page 73: C Intelligent Function Module Dedicated Functions For Isr

    C intelligent function module dedicated functions for ISR CITL_DisableYInt_ISR This function disables the routine registered with the CITL_EntryYInt function. ■ Format short CITL_DisableYInt_ISR(short sYNo) ■ Argument Argument Name Description IN/OUT sYNo Output signal (Y) number Specify the output signal (Y) number. (If -1 is specified, disable all the registered routines.) ■...
  • Page 74 CITL_EnableYInt_ISR This function enables the routine registered with the CITL_EntryYInt function. ■ Format short CITL_EnableYInt_ISR (short sYNo) ■ Argument Argument Name Description IN/OUT sYNo Output signal (Y) number Specify the output signal (Y) number. (If -1 is specified, enable all the registered routines.) ■...
  • Page 75 CITL_FromBuf_ISR This function reads data from the buffer memory of a C intelligent function module. ■ Format short CITL_FromBuf_ISR (unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf) ■ Argument Argument Name Description IN/OUT ulOffset Offset Specify the offset in word units. ulSize Data size Specify the read data size in word units.
  • Page 76 CITL_GetCounterMicros_ISR This function acquires a 1 s counter value of a C intelligent function module. ■ Format short CITL_GetCounterMicros_ISR (unsigned long* pulMicros) ■ Argument Argument Name Description IN/OUT 1 s counter value storage Specify the storage destination of the 1 s counter value. pulMicros destination ■...
  • Page 77 CITL_GetCounterMillis_ISR This function acquires a 1 ms counter value of a C intelligent function module. ■ Format short CITL_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 ■...
  • Page 78 CITL_RegistEventLog_ISR This function registers an event log in the event history of a control CPU module. ■ Format short CITL_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...
  • Page 79 CITL_SetLEDStatus_ISR This function sets the LED status of a C intelligent function module. ■ Format short CITL_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 80 CITL_ToBuf_ISR This function writes data to the buffer memory of a C intelligent function module. ■ Format short CITL_ToBuf_ISR (unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf) ■ Argument Argument Name Description IN/OUT ulOffset Offset Specify the offset in word units. ulSize Data size Specify the write data size in word units.
  • Page 81 CITL_X_In_Word_ISR This function reads an input signal (X) in word (16-point) units. ■ Format short CITL_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). (Only 0x00 and 0x10 can be specified.) usSize Read data size...
  • Page 82 CITL_X_Out_Word_ISR This function writes to an input signal (X) in word (16-point) units. ■ Format short CITL_X_Out_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). (Only 0x00 and 0x10 can be specified.) usSize Write data size...
  • Page 83 CITL_Y_In_Word_ISR This function reads an output signal (Y) in word (16-point) units. ■ Format short CITL_Y_In_Word_ISR (unsigned short usYNo, unsigned short usSize, unsigned short* pusDataBuf, unsigned short usBufSize) ■ Argument Argument Name Description IN/OUT usYNo Start output signal Specify a start output signal (Y). (Only 0x00 and 0x10 can be specified.) usSize Read data size...
  • Page 84: Melsec Iq-R Series Data Link Functions

    MELSEC iQ-R Series Data Link Functions This section shows the details of the MELSEC iQ-R series data link function. mdrClose This function closes a communication line (channel). ■ Format short mdrClose(long lPath) ■ Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel.
  • Page 85 Other than 0 (0000H) Error For details on the error, refer to the following chapter. Page 108 ERROR CODE LIST ■ Relevant function Page 82 mdrClose Page 90 mdrOpen 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 86 Other than 0 (0000H) Error For details on the error, refer to the following chapter. Page 108 ERROR CODE LIST ■ Relevant function Page 82 mdrClose Page 85 mdrDevSet Page 90 mdrOpen 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 87 Other than 0 (0000H) Error For details on the error, refer to the following chapter. Page 108 ERROR CODE LIST ■ Relevant function Page 82 mdrClose Page 84 mdrDevRst Page 90 mdrOpen 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 88 • One block comprises of three elements such as device type, start device number, and number of read points, and the total number of blocks will be stored in the first element of the device name array (plDevLst). 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 89 • DevGV can be specified only with the functions supporting label access (mdrRandRLabel/mdrRandWLabel). • For accessible CPU modules, refer to the following manual. MELSEC iQ-R C Intelligent Function Module User's Manual (Application) 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 90 *1 For return values which do not exist in the reference, refer to the manual for the CPU module. (MELSEC iQ-R CPU Module User's Manual (Application)) ■ Relevant function Page 82 mdrClose Page 90 mdrOpen Page 94 mdrRandRLabel Page 100 mdrRandWLabel 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 91 Other than 0 (0000H) Error For details on the error, refer to the following chapter. Page 108 ERROR CODE LIST ■ Relevant function Page 82 mdrClose Page 90 mdrOpen 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 92 • Setting range: 1 to 360 sec (1 sec unit) ■ Description • The path of the channel opened by the mdrOpen function is used when MELSEC iQ-R series data link functions are executed. • To end the program, close the path of the opened channel using the mdrClose function.
  • Page 93 To reduce communication time, use the mdrReceive function. • To access the own station, set the station number to 255. When the actual station number is used, an error will occur. 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 94 0x10000 Lower bit of LCN101 = 0x0000 psBuf[10] Upper bit of LCN101 = 0x0001 Number of bytes of read data (psBuf[0] to psBuf[10] = 11)  2 = 22 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 95 Other than 0 (0000H) Error For details on the error, refer to the following chapter. Page 108 ERROR CODE LIST ■ Relevant function Page 82 mdrClose Page 90 mdrOpen Page 98 mdrRandW 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 96 • One block comprises of three elements such as device type, start device number, and number of read points, the total number of blocks will be stored in the first element of the randomly-specified device (plDev). 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 97 • Specify so that the total number of read points specified for each block is 10240 points or less. Otherwise, a size error (-5) will occur. • When '0' is specified to the label code (ullLbCode), the device is read without checking the label code. 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 98 0x10000 Lower bit of LCN101 = 0x0000 psBuf[10] Upper bit of LCN101 = 0x0001 Number of bytes of read data (psBuf[0] to psBuf[10] = 11)  2 = 22 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 99 *1 For return values which do not exist in the reference, refer to the manual for the CPU module. (MELSEC iQ-R CPU Module User's Manual (Application)) ■ Relevant function Page 82 mdrClose Page 86 mdrGetLabelInfo Page 90 mdrOpen Page 100 mdrRandWLabel 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 100 • Also, note that sub 2 or sub 3 program will be deleted when data is written to a block (extension file register) overlapping with the program setting area for sub 2 or sub 3. 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 101 Other than 0 (0000H) Error For details on the error, refer to the following chapter. Page 108 ERROR CODE LIST ■ Relevant function Page 82 mdrClose Page 90 mdrOpen Page 91 mdrRandR 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 102 • One block comprises of three elements such as device type, start device number, and number of write points, the total number of blocks will be stored in the first element of the randomly-specified device (plDev). 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 103 Lower bit of LCN101 = 0x0000 psBuf[8] 0x0001 Upper bit of LCN101 = 0x0001 Number of bytes of write data (psBuf[0] to psBuf[8] = 9)  2 = 18 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 104 *1 For return values which do not exist in the reference, refer to the manual for the CPU module. (MELSEC iQ-R CPU Module User's Manual (Application)) ■ Relevant function Page 82 mdrClose Page 86 mdrGetLabelInfo Page 90 mdrOpen Page 94 mdrRandRLabel 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 105 Other than 0 (0000H) Error For details on the error, refer to the following chapter. Page 108 ERROR CODE LIST ■ Relevant function Page 82 mdrClose Page 90 mdrOpen Page 104 mdrSend 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 106 Other than 0 (0000H) Error For details on the error, refer to the following chapter. Page 108 ERROR CODE LIST ■ Relevant function Page 82 mdrClose Page 90 mdrOpen Page 103 mdrReceive 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 107 Q00CPU 0252H Q01CPU 0260H Q00UJCPU 0261H Q00UCPU 0262H Q01UCPU 0263H Q02UCPU 0266H Q10UDHCPU 0267H Q20UDHCPU 0268H Q03UDCPU 0269H Q04UDHCPU 026AH Q06UDHCPU 026BH Q13UDHCPU 026CH Q26UDHCPU 02E6H Q10UDEHCPU 02E7H Q20UDEHCPU 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 108 R08ENCPU 4807H R16ENCPU 4808H R32ENCPU 4809H R120ENCPU 4820H R12CCPU-V 4C00H R16MTCPU 4C01H R32MTCPU 4C02H R64MTCPU 4841H R08PCPU 4842H R16PCPU 4843H R32PCPU 4844H R120PCPU 4C00H R16MTCPU 4C01H R32MTCPU 4C02H R64MTCPU 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 109 Other than 0 (0000H) Error For details on the error, refer to the following chapter. Page 108 ERROR CODE LIST ■ Relevant function Page 82 mdrClose Page 90 mdrOpen 3 DETAILS OF FUNCTION 3.2 MELSEC iQ-R Series Data Link Functions...
  • Page 110: Chapter 4 Error Code List

    • During CC-Link communication, the request was issued to • Retry on the user program. other stations when the station number of the own station is • Increase the timeout value of MELSEC iQ-R series data link '64'. function. • The module specified as the communication target is not •...
  • Page 111 Error code Description Corrective action Decimal Hexadec imal ■Number of device points error 0083H Check the device points. • The specified number of device points is out of range. • The specified number of bit device points is not a multiple of 16384 to 4000H to ■Errors detected in the access target CPU module...
  • Page 112 Error code Description Corrective action Decimal Hexadec imal -28630 902AH ■WDT startup error Start the WDT after stopping the WDT which is starting up. An attempt was made to start WDT while the other WDT is starting up. ■Buffer access range error -28631 9029H •...
  • Page 113: C Intelligent Function Module Dedicated Functions

    C Intelligent Function Module Dedicated Functions The following table shows the error codes of the C intelligent function module dedicated functions. Error code Description Corrective action Decimal Hexadec imal ■I/O signal error -203 FF35H Check the specified I/O signal. The specified I/O signal is out of range. -204 FF34H ■I/O access size error...
  • Page 114 Error code Description Corrective action Decimal Hexadec imal -258 FEFEH ■Output signal (Y) number specification error Check the specified value. The value specified to the output signal (Y) number is out of range. ■Interrupt service routine unregistered error -259 FEFDH Register the processing for the event (interrupt) and perform the The processing was not registered when enabling the operation again.
  • Page 115 Error code Description Corrective action Decimal Hexadec imal ■Sampling wait suspension error -339 FEADH When the processing to wait for sampling is required again, Since data sampling in each sequence scan was stopped, the perform it after starting data sampling in each sequence scan. wait processing was interrupted.
  • Page 116: Melsec Iq-R Series Data Link Functions

    MELSEC iQ-R Series Data Link Functions The following table shows the error codes of the MELSEC iQ-R series data link functions. Error code Description Corrective action Decimal Hexadec imal ■Path error FFFFH • Use a path pointer returned with the mdrOpen function.
  • Page 117 A TC setting value was written to the CPU module during ROM operation. ■MELSEC iQ-R series data link function service error FFCCH Enable the MELSEC iQ-R series data link function service with MELSEC iQ-R series data link function service is disabled. an engineering tool. FFCBH ■Timeout value error...
  • Page 118  Specify the CC-Link IE Field Network module: D000H to DFFFH  Specify the CC-Link IE Controller Network module: E000H to EFFFH  Specify the MELSECNET/H module: F000H to FFFFH 4 ERROR CODE LIST 4.3 MELSEC iQ-R Series Data Link Functions...
  • Page 119 MEMO 4 ERROR CODE LIST 4.3 MELSEC iQ-R Series Data Link Functions...
  • Page 120: Index

    ....... . . 17 ..5 MELSEC iQ-R series data link function ....8 MELSECNET/H communication .
  • Page 121: Function Index

    FUNCTION INDEX ....22 ......82 CITL_ChangeFileSecurity mdrClose .
  • Page 122: Revisions

    3.2, Section 4.2 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 123: 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 124: Trademarks

    TRADEMARKS VxWorks and Wind River are either registered trademarks or trademarks of Wind River Systems, Inc. Windows is either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. The company names, system names and product names mentioned in this manual are either registered trademarks or trademarks of their respective companies.
  • Page 126 SH(NA)-081568ENG-C(2007) MODEL:RD55UP06-V-P-E HEAD OFFICE : TOKYO BUILDING, 2-7-3 MARUNOUCHI, CHIYODA-KU, TOKYO 100-8310, JAPAN NAGOYA WORKS : 1-14 , YADA-MINAMI 5-CHOME , HIGASHI-KU, NAGOYA , JAPAN When exported from Japan, this manual does not require application to the Ministry of Economy, Trade and Industry for service transaction permission. Specifications subject to change without notice.

This manual is also suitable for:

Melsec iq-r c

Table of Contents