Mitsubishi Electric MELIPC MI5000 Series Programming Manual
Mitsubishi Electric MELIPC MI5000 Series Programming Manual

Mitsubishi Electric MELIPC MI5000 Series Programming Manual

Vxworks
Hide thumbs Also See for MELIPC MI5000 Series:

Advertisement

Quick Links

MELIPC MI5000 Series
Programming Manual (VxWorks)

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi Electric MELIPC MI5000 Series

  • Page 1 MELIPC MI5000 Series Programming Manual (VxWorks)
  • 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. Make sure that the end users read this manual and then keep the manual in a safe place for future reference. CONDITIONS OF USE FOR THE PRODUCT (1) Mitsubishi industrial PC ("the PRODUCT") shall be used in conditions;...
  • Page 4: Considerations For Use

    Thank you for purchasing the Mitsubishi Electric Industrial PC. This manual describes the functions required for programming. Before using the Mitsubishi Electric Industrial PC, please read this manual and the relevant manuals carefully and develop familiarity with the functions and performance to handle the product correctly.
  • Page 5: Table Of Contents

    CONTENTS SAFETY PRECAUTIONS ..............1 CONDITIONS OF USE FOR THE PRODUCT .
  • Page 6 CCPU_MELIPCShutdown ..............52 CCPU_ReadDevice.
  • Page 7 mdRandWEx ................107 mdReceiveEx .
  • Page 8: Relevant Manuals

    RELEVANT MANUALS Manual name [manual number] Description Available form MELIPC MI5000 Series Programming Manual Explains the programming specifications and dedicated function library. e-Manual (VxWorks) [SH-081936ENG](this manual) e-Manual refers to the Mitsubishi FA electronic book manuals that can be browsed using a dedicated tool.
  • Page 9: Terms

    A dedicated function library used for controlling a MELIPC. CW Workbench 4 An abbreviation for the engineering tool for Mitsubishi Electric Industrial PC, CW Workbench 4. Fan module An abbreviation for a fan module for Mitsubishi Electric Industrial PC, MI5FAN.
  • Page 10: Chapter 1 Programming

    CW Workbench 4 is used for development of user programs to run on the VxWorks part. For details of creation of user programs, refer to the following manual. MELIPC MI5000 Series User's Manual (Startup) For details on CW Workbench 4, refer to the following manual.
  • Page 11: Considerations

    ■Device types for accessing CC-Link IE Field Networks The following table shows the device types that can be specified by the argument [Device type (sDevType)]. Device name (device) Code Device name specification Decimal Hexadecimal Direct link input (RX) 1000 3E8H Dev_LX Direct link output (RY) 2000...
  • Page 12: Melsec Data Link Functions

    MELSEC Data Link Functions This section shows the access ranges, devices, argument specifications, and considerations of MELSEC communication functions. Access ranges and accessible devices The following shows the access ranges and accessible devices of MELSEC communication functions. Communication addressed to own station The access ranges and accessible devices during communication addressed to own stations are as follows.
  • Page 13 CC-Link IE Field Network communication The following shows the access ranges and accessible devices in CC-Link IE Field Network communications. ■access range The system configuration within an access range for CC-Link IE field network communication is as follows. Connected network Connected station •...
  • Page 14 During other station access The following table shows the accessible devices during other station access via CC-Link IE Field Network communication. Access target Q00JCPU, Q00UJCPU, Q00CPU, Q00UCPU, Q01CPU, Q01UCPU, Q02(H)CPU, Q02PHCPU, Q02UCPU, Q03UDCPU, Q03UDECPU, Q03UDVCPU, Q04UDHCPU, Q04UDEHCPU, Q04UDVCPU, Q06HCPU, Q06PHCPU, Q06UDHCPU, Q06UDEHCPU, Q06UDVCPU, Q10UDHCPU, Q10UDEHCPU, Q12HCPU, Q12PHCPU, Q13UDHCPU, Q13UDEHCPU, Q13UDVCPU, Q20UDHCPU, Q20UDEHCPU, Q25HCPU, Q25PHCPU, Q26UDHCPU, Q26UDEHCPU, Q26UDVCPU, Q50UDEHCPU, Q100UDEHCPU Q12DCCPU-V (Basic mode), Q12DCCPU-V (Advanced mode), Q24DHCCPU-V, Q24DHCCPU-LS, Q24DHCCPU-VG, Q26DHCCPU-LS...
  • Page 15 Device name (device) Device name Access target specification         Counter current value (C) Batch DevCN Random Long counter current value (LC) Batch DevLCN         Random Data register (D) Batch DevD ...
  • Page 16 Device name (device) Device name Access target specification         Link direct device link output (Jn\Y) Batch DevLY(1) to DevLY(255) Random Remote output (RY) for CC-Link IE Field Network Batch DevLY(1) to   ...
  • Page 17 *1 Only the following devices can be accessed. ⋅ Q12DCCPU-V with a serial number whose first five digits are '12042' or higher ⋅Q24DHCCPU-V, Q24DHCCPU-LS, Q24DHCCPU-VG, Q26DHCCPU-LS *2 Q00JCPU is not accessible. *3 There are no module refresh registers or module access devices for LJ72GF15-2 and BZ2GF-ETB. *4 Only the following devices can be accessed.
  • Page 18: Program Processing

    Program processing The following shows the procedure for processing a use program using a MELSEC data link function. Start a task. Open a communication line. (mdOpen function) Perform a dummy access to the target. (Device read or model name read) Access the target using a MELSEC data link function.
  • Page 19 ■Remote operation and model name reading The following table shows the station numbers to be specified during remote operation and model name reading. Communication route Specification method Station number Own station address Own station 255(FFH) CC-Link IE Field Network Own station 255(FFH) Other station Refer to the following chart...
  • Page 20 Device name (device) Code Device name specification Decimal Hexadecimal Long counter current value (LC) DevLCN Data register (D) DevD Special register (SD) DevSD Index register (Z) DevZ Long index register (LZ) DevLZ File register (R) DevR File register (ZR) DevZR Link relay (B) DevB Link register (W)
  • Page 21: 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 22: Chapter 2 Function List

    FUNCTION LIST This chapter shows the functions that can be used for a MELIPC. C Controller Module Dedicated Functions The C Controller module dedicated functions are as listed below. Function name Function Reference CCPU_ChangeCCIEFBCycPrm Changes the operation parameter of the cyclic transmission of CC-Link IE Page 24 CCPU_ChangeCCIEFBCycPrm Field Network Basic.
  • Page 23 Function name Function Reference CCPU_SetDotMatrixLED Sets values to be displayed on the dot matrix LED of a MELIPC. Page 64 CCPU_SetDotMatrixLED CCPU_SetLEDStatus Sets the INFO LED status of a MELIPC. Page 66 CCPU_SetLEDStatus CCPU_SetRTC Sets the clock data (local time) of a MELIPC. Page 67 CCPU_SetRTC CCPU_ShutdownRom Shuts down the user drive of the VxWorks part.
  • Page 24: C Controller Module Dedicated Functions (For Isr)

    C Controller Module Dedicated Functions (For ISR) The C Controller module dedicated functions (for ISR) are as listed below. Function name Function Reference CCPU_FromBuf_ISR Reads data from the buffer memory of a MELIPC. Page 82 CCPU_FromBuf_ISR Acquires a 1 μs counter value of a MELIPC. CCPU_GetCounterMicros_ISR Page 83 CCPU_GetCounterMicros_ISR CCPU_GetCounterMillis_ISR...
  • Page 25: Melsec Data Link Functions

    MELSEC Data Link Functions The MELSEC data link functions are as listed below. Function name Function Reference mdClose Closes a communication line (channel). Page 99 mdClose mdControl Performs remote operations (RUN/STOP/PAUSE) for a programmable Page 100 mdControl controller CPU. mdDevRstEx Resets bit devices.
  • Page 26: Chapter 3 Details Of Functions

    DETAILS OF FUNCTIONS This chapter shows the details on the functions used for MELIPC MI5000 series. C Controller Module Dedicated Functions This section explains the details of the C Controller module dedicated function. CCPU_ChangeCCIEFBCycPrm Changes the operation parameter of the cyclic transmission of CC-Link IE Field Network Basic.
  • Page 27 Return value Return value Description 0(0000H) Normal -328(FEB8H) Group number error -329(FEB7H) Link time specification error -330(FEB6H) Number of detections of disconnected slave stations error -331(FEB5H) CC-Link IE Field Network Basic parameter unset -332(FEB4H) Slave station timeout time specification range error For details on error codes, refer to the following section.
  • Page 28: Ccpu_Clearerror

    CCPU_ClearError Clears continuation errors of a MELIPC. Format short CCPU_ClearError(long* plErrorInfo) Argument Argument Name Description IN/OUT plErrorInfo Error information Not used (Value is not related to operation. ) Description • Clears continuation errors. • When no continuation error has occurred, this function ends normally. •...
  • Page 29: Ccpu_Control

    CCPU_Control Performs a remote operation (remote RUN/STOP) of a MELIPC. Format short CCPU_Control(short sCpuNo, short sCode) Argument Argument Name Description IN/OUT sCpuNo CPU number Specify '0'. sCode Operation specification code Specifies the remote operation to be performed. • 0: Remote RUN •...
  • Page 30: Ccpu_Endcciefbdataassurance

    CCPU_EndCCIEFBDataAssurance Ends data assurance for access to a link device of CC-Link IE Field Network Basic. Format short CCPU_EndCCIEFBDataAssurance(unsigned short usGroupNo) Argument Argument Name Description IN/OUT usGroupNo Group No. Specifies a group number for data assurance. (1 to 4) Description •...
  • Page 31: Ccpu_Endlinkdeviceassurance

    CCPU_EndLinkDeviceAssurance Ends data assurance for access to a link device of CC-Link IE Field Network. Format short CCPU_EndLinkDeviceAssurance(unsigned short usIoNo) Argument Argument Name Description IN/OUT usIoNo Module position Specify 0x03E0. Description • Ends data assurance for access to a link device of CC-Link IE Field Network. •...
  • Page 32: Ccpu_Entrycciefblinkscanendfunc

    CCPU_EntryCCIEFBLinkScanEndFunc Registers a routine to be called when a link scan of CC-Link IE Field Network Basic is completed. Format short CCPU_EntryCCIEFBLinkScanEndFunc(CCPU_SCANENDFUNCPTR pEndFuncPtr) Argument Argument Name Description IN/OUT pEndFuncPtr Registered routine Specify a routine to be registered. (The routine is deregistered by specifying NULL.) The data type of the registered routine (pEndFuncPtr) is defined in the header file "CCPUFunc.h"...
  • Page 33: Ccpu_Entrylinkscanendfunc

    CCPU_EntryLinkScanEndFunc Registers a routine to be called when a link scan of CC-Link IE Field Network is completed. Format short CCPU_EntryLinkScanEndFunc(unsigned short usIoNo, CCPU_FUNCPTR pFuncPtr) Argument Argument Name Description IN/OUT usIoNo Module position Specify 0x03E0. pFuncPtr Registered routine Specify a routine to be registered. (The routine is deregistered by specifying NULL.) *1 The data type is defined as a void type in the include file "CCPUFunc.h".
  • Page 34: Ccpu_Entryshutdownfunc

    CCPU_EntryShutdownFunc Registers a routine to be called before the shutdown function of a MELIPC is executed. Format short CCPU_EntryShutdownFunc(CCPU_FUNCPTR pFuncPtr) Argument Argument Name Description IN/OUT pFuncPtr Registered routine Specify a routine to be registered. (The routine is deregistered by specifying NULL.) *1 The data type is defined as a void type in the include file "CCPUFunc.h".
  • Page 35: Ccpu_Entrytimerevent

    CCPU_EntryTimerEvent 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. Registration events (plEvent) are specified as follows. plEvent Description plEvent[0] Number of timer event settings (1 to 16) plEvent[1] First timer event number (1 to 16) First event setting...
  • Page 36 Return value Return value Description 0(0000H) Normal -225(FF1FH) Event number specification error -235(FF15H) Number of event settings specification error -241(FF0FH) Cycle specification error -242(FF0EH) Synchronization type specification error -246(FF0AH) Timer event registration error -264(FEF8H) Pointer error For details on error codes, refer to the following section. Page 116 Function error codes Relevant function Page 77 CCPU_WaitTimerEvent...
  • Page 37: Ccpu_Entrywdtint

    CCPU_EntryWDTInt Registers a routine to be called when a user WDT error interrupt of the VxWorks part occurs. Format short CCPU_EntryWDTInt(short sType, CCPU_FUNCPTR pFuncPtr) Argument Argument Name Description IN/OUT sType WDT type Specify the WDT type. (When 'Reserved' is specified, an error is returned.) •...
  • Page 38: Ccpu_Entrywinresetfunc

    CCPU_EntryWinResetFunc Registers a routine to be called before the Windows forced-restart function of the individual reset function is executed. Format short CCPU_EntryWinResetFunc(CCPU_FUNCPTR pFuncPtr) Argument Argument Name Description IN/OUT pFuncPtr Registered routine Specify a routine to be registered. (The routine is deregistered by specifying NULL.) *1 The data type is defined as a void type in the include file "CCPUFunc.h".
  • Page 39: Ccpu_Frombuf

    CCPU_FromBuf Reads data from the buffer memory of a MELIPC. Format short CCPU_FromBuf(unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT usIoNo Module position Specify 0x03E0. ulOffset Offset Specify the offset in word units. ulSize Data size Specify the read data size in word units.
  • Page 40: Ccpu_Getcciefbdiagnosticinfo

    CCPU_GetCCIEFBDiagnosticInfo 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 Specifies a slave station from which to acquire diagnostic information. psStatusBuf Diagnostic information storage Specify a storage destination for diagnostic information.
  • Page 41 Return value Return value Description 0(0000H) Normal -264(FEF8H) Pointer error -331(FEB5H) CC-Link IE Field Network Basic parameter unset -336(FEB0H) Slave station number specification error For details on error codes, refer to the following section. Page 116 Function error codes 3 DETAILS OF FUNCTIONS 3.1 C Controller Module Dedicated Functions...
  • Page 42: Ccpu_Getcountermicros

    CCPU_GetCounterMicros Acquires a 1 μs counter value of a MELIPC. 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 • This function acquires a 1 μs counter value of a MELIPC, and stores it in the 1 μs counter value storage destination (pulMicros).
  • Page 43: Ccpu_Getcountermillis

    CCPU_GetCounterMillis Acquires a 1 ms counter value of a MELIPC. 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 • This function acquires a 1 ms counter value of a MELIPC, and stores it in the 1 ms counter value storage destination (pulMillis).
  • Page 44: Ccpu_Getcpustatus

    CCPU_GetCpuStatus Acquires the operating status of a MELIPC. 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 destination size in double word units.
  • Page 45: Ccpu_Getdotmatrixled

    CCPU_GetDotMatrixLED Acquires the values displayed on the dot matrix LED of a MELIPC. Format short CCPU_GetDotMatrixLED(char* pcData, unsigned long ulDataSize) Argument Argument Name Description IN/OUT pcData LED data Specify the storage destination of LED data. ulDataSize LED data storage destination size Specify the LED data storage destination size in byte units.
  • Page 46 Relevant function Page 64 CCPU_SetDotMatrixLED 3 DETAILS OF FUNCTIONS 3.1 C Controller Module Dedicated Functions...
  • Page 47: Ccpu_Geterrinfo

    CCPU_GetErrInfo Acquires error information of a MELIPC. 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. destination size (When '0' is specified, this function ends normally without processing.) Description...
  • Page 48: Ccpu_Getledstatus

    CCPU_GetLEDStatus Acquires the LED status of a MELIPC. Format short CCPU_GetLEDStatus(long lLed, unsigned short* pusLedInfo, unsigned long ulBufSize) Argument Argument Name Description IN/OUT lLed Target LED Specify a target LED. (When 'Reserved' is specified, this function ends normally without processing.) ■Main LED •...
  • Page 49 • When '-1' is specified for the target LED (lLed), the LED status is stored in the LED status storage destination (pusLedInfo) as follows in a range that does not exceed the LED status storage destination size (ulBufSize). (When a value from 0 through 12 was specified, the LED status specified for pusLedInfo[0] is stored. ) pusLedInfo Description pusLedInfo[0]...
  • Page 50: Ccpu_Getpowerstatus

    CCPU_GetPowerStatus Acquires the power supply status of a MELIPC. 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. size (When '0' is specified, this function ends normally without processing.) Description...
  • Page 51: Ccpu_Getrtc

    CCPU_GetRTC Acquires the clock data (local time) of a MELIPC. 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 52: Ccpu_Getserialno

    CCPU_GetSerialNo Acquires the serial number of a MELIPC. 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. size (When '0' is specified, this function ends normally without processing.) Description...
  • Page 53: Ccpu_Getswitchstatus

    CCPU_GetSwitchStatus Acquires the switch status of a MELIPC. 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. size (When '0' is specified, this function ends normally without processing.) Description...
  • Page 54 CCPU_MELIPCShutdown Performs a shutdown operation so that the power of a MELIPC can turn OFF. Format short CCPU_MELIPCShutdown(void) Argument None Description • Runs processing equivalent to when the SHUTDOWN switch of the MELIPC was operated and sets it to a state in which the power can be turned OFF.
  • Page 55 CCPU_ReadDevice Reads data from the internal user devices and internal system devices of a MELIPC. 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 8 Device type ulDevNo Start device number...
  • Page 56 CCPU_ReadLinkDevice Reads data from link devices of CC-Link IE Field Network. Format short CCPU_ReadLinkDevice(unsigned short usIoNo, short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT usIoNo Module position Specify 0x03E0. sDevType Device type Specify the device type.
  • Page 57 CCPU_ReadSharedMemory Reads data from the shared memory of a MELIPC. Format short CCPU_ReadSharedMemory(unsigned long ulOffset, unsigned long ulSize, unsigned char* pucDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT ulOffset Offset Specify the offset in byte units. ulSize Data size Specify the read data size in byte units.
  • Page 58 CCPU_ReceiveInterOSEvent Waits for notification of inter OS events. Format short CCPU_ReceiveInterOSEvent(short sOsEventNo, unsigned long ulTimeout) Argument Argument Name Description IN/OUT sOsEventNo Inter OS event number Specifies '1'. If a value other than "1" is specified, an error is returned. ulTimeout Timeout Specify the timeout value in milliseconds.
  • Page 59 CCPU_RegistEventLog Registers event logs in the event history of a MELIPC. 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 history.
  • Page 60 CCPU_Reset Resets a MELIPC. Format short CCPU_Reset(void) Argument None Precautions When this function is executed, no value is returned because a MELIPC is restarted from an operating system. (All programs are forcibly terminated.) Description • Resets a MELIPC. • Use this function only to reset and restart, such as when an error has occurred. •...
  • Page 61 CCPU_ResetDevice Resets internal user devices and internal system devices (bit devices) of a MELIPC. Format short CCPU_ResetDevice(short sDevType, unsigned long ulDevNo) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 8 Device type ulDevNo Device number Specify a device number.
  • Page 62 CCPU_ResetWDT Resets a user WDT of the VxWorks part. Format short CCPU_ResetWDT(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 • Others: Reserved Description •...
  • Page 63 CCPU_RestoreDefaultCCIEFBCycPrm Restores the operation parameter of cyclic transmission of CC-Link IE Field Network Basic to the default value (which is set to the parameter). Format short CCPU_RestoreDefaultCCIEFBCycPrm(void) Argument None Description • Restores the all group operation parameters of cyclic transmission to their default value (parameters setting value). •...
  • Page 64 CCPU_SendInterOSEvent Notifies inter OS events. Format short CCPU_SendInterOSEvent(short sOsEventNo) Argument Argument Name Description IN/OUT sOsEventNo Inter OS event number Specifies '1'. If a value other than "1" is specified, an error is returned. Description Sends notice of the inter OS event specified by the inter OS event number (sOsEventNo) to the Windows part from VxWorks part.
  • Page 65 CCPU_SetDevice Sets internal user devices and internal system devices (bit devices) of a MELIPC. Format short CCPU_SetDevice(short sDevType, unsigned long ulDevNo) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 8 Device type ulDevNo Device number Specify a device number.
  • Page 66 CCPU_SetDotMatrixLED Sets values to be displayed on the dot matrix LED of a MELIPC. Format short CCPU_SetDotMatrixLED(unsigned short usMode, char* pcData) Argument Argument Name Description IN/OUT usMode Output mode Specify the output mode to the dot matrix LED. (When 'Reserved' is specified, this function ends normally without processing.) •...
  • Page 67 If this function is executed in a state other than the above-mentioned state, an error occurs. For details on the display status of the dot matrix LED, refer to the following manual. MELIPC MI5000 Series User's Manual (Startup) Return value...
  • Page 68 CCPU_SetLEDStatus Sets the INFO LED status of a MELIPC. Format short CCPU_SetLEDStatus(long lLed, unsigned short usLedInfo) Argument Argument Name Description IN/OUT lLed Target LED Specify a target LED. (When 'Reserved' is specified, this function ends normally without processing.) • 0: INFO LED •...
  • Page 69 CCPU_SetRTC Sets the clock data (local time) of a MELIPC. 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 70 CCPU_ShutdownRom Shuts down the user drive of the VxWorks part. Format short CCPU_ShutdownRom(void) Argument None Description • Shuts down the user drive of the MELIPC and sets the VxWorks part to a state in which the power supply can be turned OFF.
  • Page 71 • The specified timeout value (ulTimeout) is rounded (rounding up after the decimal point) to tick units. • For the processing procedure to access a link device that underwent data assurance, refer to the following manual. (MELIPC MI5000 Series User's Manual (Application)) Return value...
  • Page 72 • The specified timeout value (ulTimeout) is rounded (rounding up after the decimal point) to tick units. • For the processing procedure to access a link device that underwent data assurance, refer to the following manual. (MELIPC MI5000 Series User's Manual (Application)) Return value...
  • Page 73 CCPU_StartWDT Sets the user WDT of the VxWorks part and starts the user WDT. Format short CCPU_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 74 CCPU_StopWDT Stops the user WDT of the VxWorks part. Format short CCPU_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 • Others: Reserved Description •...
  • Page 75 CCPU_SysClkRateGet Reads the system clock rate specified with the CCPU_SysClkRateSet function from MRAM. Format short CCPU_SysClkRateGet(short* psTicks) Argument Argument Name Description IN/OUT psTicks Clock rate Specify the system clock rate in the unit of clock frequency (Hz) per one second. •...
  • Page 76 CCPU_SysClkRateSet Saves a specified system clock rate to MRAM. 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. • 0: Default value (60 Hz) •...
  • Page 77 CCPU_ToBuf Writes data to the buffer memory of a MELIPC. Format short CCPU_ToBuf(unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT usIoNo Module position Specify 0x03E0. ulOffset Offset Specify the offset in word units. ulSize Data size Specify the write data size in word units.
  • Page 78 CCPU_WaitSwitchEvent Waits for a switch interruption event to occur. Format short CCPU_WaitSwitchEvent(short sSwitch, unsigned long ulTimeout) Argument Argument Name Description IN/OUT sSwitch Switch interrupt event type Specify a switch interrupt event type. • 0: MAIN RUN switch interrupt event • 1: STOP switch interrupt event If a value other than the above-mentioned is specified, an error is returned.
  • Page 79 CCPU_WaitTimerEvent 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 • This function waits for a timer event specified to the timer event number (lEventNo) to occur. •...
  • Page 80 CCPU_WinReset Forces a restart of the Windows part of a MELIPC. Format short CCPU_WinReset(void) Argument None Description • Runs processing equivalent to when the WIN RESET switch of the MELIPC was operated and forces a restart of the Windows part of the MELIPC. •...
  • Page 81 CCPU_WriteDevice Writes data to internal user devices and internal system devices of a MELIPC. 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 8 Device type ulDevNo Start device number...
  • Page 82 CCPU_WriteLinkDevice Writes data to link devices of CC-Link IE Field Network. Format short CCPU_WriteLinkDevice(unsigned short usIoNo, short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT usIoNo Module position Specify 0x03E0. sDevType Device type Specify the device type.
  • Page 83 CCPU_WriteSharedMemory Writes data to the shared memory of a MELIPC. Format short CCPU_WriteSharedMemory(unsigned long ulOffset, unsigned long ulSize, unsigned char* pucDataBuf) Argument Argument Name Description IN/OUT ulOffset Offset Specify the offset in word units. ulSize Data size Specify the write data size in byte units. pucDataBuf Data storage destination Specify the storage destination of write data.
  • Page 84 C Controller Module Dedicated Functions (for ISR) The following table shows details on the C Controller module dedicated functions (for ISR). CCPU_FromBuf_ISR Reads data from the buffer memory of a MELIPC. Format short CCPU_FromBuf_ISR(unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf) Argument Argument...
  • Page 85 CCPU_GetCounterMicros_ISR Acquires a 1 μs counter value of a MELIPC. 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 • This function acquires a 1 μs counter value of a MELIPC, and stores it in the 1 μs counter value storage destination (pulMicros).
  • Page 86 CCPU_GetCounterMillis_ISR Acquires a 1 ms counter value of a MELIPC. 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 • This function acquires a 1 ms counter value of a MELIPC, and stores it in the 1 ms counter value storage destination (pulMillis).
  • Page 87 CCPU_GetDotMatrixLED_ISR Acquires the values displayed on the dot matrix LED of a MELIPC. 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. ulDataSize LED data storage destination size Specify the LED data storage destination size in byte units.
  • Page 88 Warning If any function to which an invalid argument is specified is executed, an error such as hardware failure (3C02H) may occur on the MELIPC. Return value Return value Description 0(0000H) Normal Relevant function Page 43 CCPU_GetDotMatrixLED Page 64 CCPU_SetDotMatrixLED Page 92 CCPU_SetDotMatrixLED_ISR 3 DETAILS OF FUNCTIONS 3.2 C Controller Module Dedicated Functions (for ISR)
  • Page 89 CCPU_ReadDevice_ISR Reads data from the internal user devices and internal system devices of a MELIPC. 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 8 Device type ulDevNo Start device number...
  • Page 90 CCPU_ReadLinkDevice_ISR Reads data from link devices of CC-Link IE Field Network. Format short CCPU_ReadLinkDevice_ISR(unsigned short usIoNo, short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT usIoNo Module position Specify 0x03E0. sDevType Device type Specify the device type.
  • Page 91 CCPU_RegistEventLog_ISR Registers event logs in the event history of a MELIPC. 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 history.
  • Page 92 CCPU_ResetDevice_ISR Resets internal user devices and internal system devices (bit devices) of a MELIPC. Format short CCPU_ResetDevice_ISR(short sDevType, unsigned long ulDevNo) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 8 Device type ulDevNo Start device number Specify the start device number.
  • Page 93 CCPU_SetDevice_ISR Sets internal user devices and internal system devices (bit devices) of a MELIPC. Format short CCPU_SetDevice_ISR(short sDevType, unsigned long ulDevNo) Argument Argument Name Description IN/OUT sDevType Device type Specify the device type. Page 8 Device type ulDevNo Device number Specify a device number.
  • Page 94 CCPU_SetDotMatrixLED_ISR Sets values to be displayed on the dot matrix LED of a MELIPC. Format short CCPU_SetDotMatrixLED_ISR(unsigned short usMode, char* pcData) Argument Argument Name Description IN/OUT usMode Output mode Specify the output mode to the dot matrix LED. (When 'Reserved' is specified, this function ends normally without processing.) •...
  • Page 95 If this function is executed in a state other than the above-mentioned state, an error occurs. For details on the display status of the dot matrix LED, refer to the following manual. MELIPC MI5000 Series User's Manual (Startup) Do not execute this function in a routine other than an interrupt routine.
  • Page 96 Return value Return value Description 0(0000H) Normal -289(FEDFH) Dot matrix LED Display mode error For details on error codes, refer to the following section. Page 116 Function error codes Relevant function Page 43 CCPU_GetDotMatrixLED Page 64 CCPU_SetDotMatrixLED Page 85 CCPU_GetDotMatrixLED_ISR 3 DETAILS OF FUNCTIONS 3.2 C Controller Module Dedicated Functions (for ISR)
  • Page 97 CCPU_SetLEDStatus_ISR Sets the INFO LED status of a MELIPC. Format short CCPU_SetLEDStatus_ISR(long lLed, unsigned short usLedInfo) Argument Argument Name Description IN/OUT lLed Target LED Specify a target LED. (When 'Reserved' is specified, this function ends normally without processing.) • 0: INFO LED •...
  • Page 98 CCPU_ToBuf_ISR Writes data to the buffer memory of a MELIPC. Format short CCPU_ToBuf_ISR(unsigned short usIoNo, unsigned long ulOffset, unsigned long ulSize, unsigned short* pusDataBuf) Argument Argument Name Description IN/OUT usIoNo Module position Specify 0x03E0. ulOffset Offset Specify the offset in word units. ulSize Data size Specify the write data size in word units.
  • Page 99 CCPU_WriteDevice_ISR Writes data to internal user devices and internal system devices of a MELIPC. 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 8 Device type ulDevNo Start device number Specify the start device number.
  • Page 100 CCPU_WriteLinkDevice_ISR Writes data to link devices of CC-Link IE Field Network. Format short CCPU_WriteLinkDevice_ISR(unsigned short usIoNo, short sDevType, unsigned long ulDevNo, unsigned long ulSize, unsigned short* pusDataBuf, unsigned long ulBufSize) Argument Argument Name Description IN/OUT usIoNo Module position Specify 0x03E0. sDevType Device type Specify the device type.
  • Page 101 MELSEC Data Link Functions This section shows the details of MELSEC data link functions. mdClose 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 102 mdControl Performs remote operations (RUN/STOP/PAUSE) for a programmable controller CPU. 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 Network number and station Specify the network number and station number of the target module. Page 16 Network number and station number number sCode...
  • Page 103 mdDevRstEx 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 104 mdDevSetEx 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 105 mdOpen 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 16 Channel sMode Mode Specify '-1'. plPath Path of channel Specify the storage destination (address) of the path of the channel. (The path of the opened channel is stored.) Description •...
  • Page 106 mdRandREx Reads data by specifying a device type and a range to be read. 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 107 Example The following tables show the examples of values configured to the random-specified devices (plDev), data 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 108 Return value Return value Description 0(0000H) Normal Other than 0 Error For details on error codes, refer to the following section. Page 116 Function error codes Relevant function Page 99 mdClose Page 103 mdOpen Page 107 mdRandWEx 3 DETAILS OF FUNCTIONS 3.3 MELSEC Data Link Functions...
  • Page 109 mdRandWEx Writes data by specifying a device type and a range to be written. 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 110 Example The following tables show the examples of random-specified devices (plDev), data configured for the write data storage destination (psBuf), and the number of bytes of write data. Device to be written randomly Description M100 to M115 All bits are OFF. D10 to D13 Stores 10 in D10, 200 in D11, 300 in D12, and 400 in D13.
  • Page 111 mdReceiveEx Reads data from 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 112 mdRemBufReadEx Reads data from the buffer memory of a remote device station on CC-Link IE Field Network. Format long mdRemBufReadEx(long lPath, long lNetNo, long lStNo, long lOffset, long* plSize, short* psData) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel.
  • Page 113 mdRemBufWriteEx Writes data to the buffer memory of a remote device station on CC-Link IE Field Network. Format long mdRemBufWriteEx(long lPath, long lNetNo, long lStNo, long lOffset, long* plSize, short* psData) Argument Argument Name Description IN/OUT lPath Path of channel Specify the path of the opened channel.
  • Page 114 mdSendEx Writes data to 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 115 mdTypeRead Reads the model code of a 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 16 Network number and station number psCode Model code...
  • Page 116 Model code (hexadecimal) CPU module 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) 2015H Q173DCPU(-S1) 2018H Q172DSCPU 2019H Q173DSCPU 2043H Q12DCCPU-V 2044H Q24DHCCPU-V 2045H Q24DHCCPU-LS 2046H Q24DHCCPU-VG...
  • Page 117 Return value Return value Description 0(0000H) Normal Other than 0 Error For details on error codes, refer to the following section. Page 116 Function error codes Relevant function Page 99 mdClose Page 103 mdOpen 3 DETAILS OF FUNCTIONS 3.3 MELSEC Data Link Functions...
  • Page 118 APPENDIX Appendix 1 Function error codes This chapter shows the codes for errors occurred in the dedicated function library and the corrective actions. common The following table shows the common error codes for the dedicated function library. Error code Description Corrective action Decimal Hexadec...
  • Page 119 Error code Description Corrective action Decimal Hexadec imal ■Online registration error 16480 4060H • Complete the operation of the other engineering tool or other An online debugging function (online change, etc.) or remote CPU module, and then execute it again. operation is being executed by another engineering tool or •...
  • Page 120 Error code Description Corrective action Decimal Hexadec imal ■Pointer address specification error -28628 902CH Check the address of the specified pointer. An incorrect address was specified to the argument pointer. -28629 902BH ■WDT not started error Reset the WDT after starting it. An attempt was made to reset a WDT before starting it.
  • Page 121 C Controller module dedicated function 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. -203 FF35H ■I/O signal error...
  • Page 122 Error code Description Corrective action Decimal Hexadec imal ■Not executable during interrupt service routine -245 FF0BH Specify '1' to the call source flag (ISR) and execute the function A function was executed from interrupt service routine again. without specifying '1' (ISR) to the call source flag. ■Timer event registration error -246 FF0AH...
  • Page 123 Error code Description Corrective action Decimal Hexadec imal ■Setting data size error -296 FED8H Check the setting data size. The setting data size is out of range. -328 FEB8H ■Group number error Check the specified group number. The specified group number is out of range. ■Link time specification error -329 FEB7H...
  • Page 124 MELSEC data link function The following table shows the error codes of MELSEC data link functions. Error code Description Corrective action Decimal Hexadec imal FFFFH ■Path error • Use a path pointer returned with the mdOpen function. • The specified path is unavailable. •...
  • Page 125 Error code Description Corrective action Decimal Hexadec imal ■Registry open error FFDEH Check if the access target is correctly set with MI Configurator. Opening parameter files in the registry failed. FFDDH ■Registry read error • Check if the access target is correctly set with MI Reading parameter files from the registry failed.
  • Page 126 INDEX ..11 CC-Link IE Field Network communication ......16 Channel .
  • Page 127 MEMO...
  • Page 128 FUNCTION INDEX ......78 CCPU_WinReset ..... .79 CCPU_WriteDevice .
  • Page 129 MEMO...
  • Page 130 Japanese manual number: SH-081935-C This manual confers no industrial property rights of any other kind, nor does it confer any patent licenses. Mitsubishi Electric Corporation cannot be held responsible for any problems involving industrial property rights which may occur as a result of using the contents noted in this manual.
  • Page 131 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 132 TRADEMARKS Ethernet is a registered trademark of Fuji Xerox Co., Ltd. in Japan. Microsoft and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. Unicode is either a registered trademark or a trademark of Unicode, Inc. in the United States and 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 134 SH(NA)-081936ENG-B(1805) MODEL:MELIPC-MI5000-P-VX-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.

Table of Contents