Mitsubishi MR-EM340GF User Manual
Mitsubishi MR-EM340GF User Manual

Mitsubishi MR-EM340GF User Manual

Simple motion board
Table of Contents

Advertisement

Quick Links

Personal Computer Embedded Type
Servo System Controller
Simple Motion Board
User's Manual (API Library)
-MR-EM340GF

Advertisement

Table of Contents
loading

Summary of Contents for Mitsubishi MR-EM340GF

  • Page 1 Personal Computer Embedded Type Servo System Controller Simple Motion Board User's Manual (API Library) -MR-EM340GF...
  • 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. The precautions given in this manual are concerned with this product only. In this manual, the safety precautions are classified into two levels: "...
  • Page 4 [Design Precautions] WARNING ● If a communication cable is disconnected, the network may be unstable, resulting in a communication failure of multiple stations. Configure an interlock in the program to ensure that the entire system will always operate safely even if communications fail. Failure to do so may result in an accident due to an incorrect output or malfunction.
  • Page 5 [Installation Precautions] CAUTION ● Use the Simple Motion board in an environment that meets the general specifications in the Simple Motion Board User's Manual. Failure to do so may result in electric shock, fire, malfunction, or damage to or deterioration of the product. ●...
  • Page 6 [Wiring Precautions] CAUTION ● Ground the controllers, servo amplifiers and servo motors embedded with a Simple Motion board with a ground resistance of 100 ohm or less. Do not use a common grounding with other equipment. ● Check the rated voltage and signal layout before wiring to the Simple Motion board, and connect the cables correctly.
  • Page 7 [Startup and Maintenance Precautions] CAUTION ● When modifying data of a running Simple Motion board, configure an interlock in the program to ensure that the entire system will always operate safely. For other forms of control (such as program modification, parameter change, forced output, or operating status change) of a running Simple Motion board, read the relevant manuals carefully and ensure that the operation is safe before proceeding.
  • Page 8 [Startup and Maintenance Precautions] CAUTION ● Do not place the Simple Motion board or servo amplifier on metal that may cause a power leakage or wood, plastic or vinyl that may cause static electricity buildup. Doing so can cause malfunction or failure of the Simple Motion board.
  • Page 9: Conditions Of Use For The Product

    Notwithstanding the above, restrictions Mitsubishi 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 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 10: Table Of Contents

    CONTENTS SAFETY PRECAUTIONS ..............1 CONDITIONS OF USE FOR THE PRODUCT .
  • Page 11 MMC_Controller::DisableDMA............. . . 54 MMC_Controller::ReadRemoteBufferMemory.
  • Page 12 MmfGetLastError ............... . 106 MmfCreateSemaphore .
  • Page 13 MC_MoveRelative class ..............162 MC_Reset class .
  • Page 14 REVISIONS................244 WARRANTY .
  • Page 15: Relevant Manuals

    A device (X, Y, RX, RY, or others) in the Simple Motion board DMA transmission Automatic data transfer between a buffer memory of the MR-EM340GF and a memory in the host personal computer EM Software Development Kit A product name for software development kit for Simple Motion board...
  • Page 16 Term Description User program A general name for applications using the API library...
  • Page 17: Chapter 1 Specifications

    SPECIFICATIONS The API library is used to create applications on a host personal computer that controls the Simple Motion board (MR- EM340GF). The API library executes open and closed communication, positioning control etc. with the Simple Motion board. Operating Environment The operating environment and conditions for use of the API library are shown below.
  • Page 18: Precautions

    • The I/O mode of the servo amplifier MR-J4-GF supports only the function block class. • When using the same VisualStudio IntelliSense function as the C++ in the C# development environment, store the following XML file in the same folder as the C# API library DLL file. Language 32-bit 64-bit...
  • Page 19: File Configuration

    File Configuration The root folder, and file/folder configuration for the API library are shown below. Root folder Find the root folder of the API library by the following procedure.  ■Windows [Start][All programs][MELSOFT][EM Software Development Kit][EM API Library]  ■Windows 8.1 or later [Start][All apps][MELSOFT][EM API Library] File/folder configuration...
  • Page 20: Chapter 2 Class/Function List

    Controls such as starting the interrupt driver for the device driver are executed by class calling the method of this class. Objects of the device driver class are generated with object generation functions, and deleted by Delete method. *1 MMC: Mitsubishi Motion Class Host personal computer User program API library...
  • Page 21: Public Method/Data Method List

    Public method/Data Method List A list of the public methods and public data members used by the API library for each class is shown below. Do not use any public methods and public data members other than those in the following lists. Using a public method or public data member that is not listed may cause the API library to operate incorrectly.
  • Page 22: Mmc_Controller Class

    MMC_Controller class Refer to the following for details of MMC_Controller class. • Basic functions (Page 32 MMC_Controller Class) • Advanced synchronous control (Page 127 MMC_Controller Class) • Function block (Page 189 MMC_Controller Class) Public method Category Name Description Reference Get object GetAxis Gets the object of the axis class.
  • Page 23 Category Name Description Reference SLMP ReadRemoteBufferMemory Reads data from the buffer memory in the remote Page 55 communication device station. MMC_Controller::ReadRemoteBufferMemory method WriteRemoteBufferMemory Writes data to the buffer memory in the remote Page 56 device station. MMC_Controller::WriteRemoteBufferMemory Public data member Variable name Data type Initial value...
  • Page 24: Mmc_Axis Class

    MMC_Axis class Refer to the following for details of MMC_Axis class. • Basic functions (Page 57 MMC_Axis Class) • Advanced synchronous control (Page 134 MMC_Axis Class) Public method Category Name Description Reference Positioning data SetPositioningData Sets the positioning data. Page 59 MMC_Axis::SetPositioningData method SetBlockStartData Sets the block start data.
  • Page 25: Mmc_Io Class

    Public data member Variable name Data type Initial value Description LastErrorNumber unsigned long MMERR_NONE Latest error code LastDetailErrorNumber unsigned long MMERR_NONE Latest detail error code StationNumber unsigned long Station No. (1 to 16)  MMC_Io class Refer to the following for details of MMC_Io class. •...
  • Page 26: Mmc_Syncencoder Class

    MMC_SyncEncoder class Refer to the following for details of MMC_SyncEncoder class. • Advanced synchronous control function (Page 139 MMC_SyncEncoder Class) Public method Category Name Description Reference Error method ResetSyncEncoderError Performs error reset of the synchronous encoder Page 140 axis. MMC_SyncEncoder::ResetSyncEncoderError Change method ChangeSyncEncoderPosition Changes current value of the synchronous encoder...
  • Page 27 Derived classes Name Description Reference MC_Power Changes the servo amplifier of the specified axis to an operable state. Page 153 MC_Power class MCv_Home Executes home position return for the specified axis. Page 155 MCv_Home class MC_Stop Stops the specified axis. Page 157 MC_Stop class MC_MoveAbsolute Specifies the absolute target position of the specified axis and executes positioning.
  • Page 28: Mmc_Label Class

    MMC_Label class Refer to the following for details of MMC_Label class. • Basic functions (Page 89 MMC_Label Class) Public method Category Name Description Reference Wait method Wait Waits by polling until the value of the label satisfies Page 90 Wait the specified conditions.
  • Page 29: Function List

    Function List A list of the functions used by the API library is shown below. Object generation functions Category Function name Description Reference Object generation MmfCreateEM340GF Generates MMC_EM340GF class objects. Page 102 function MmfCreateEM340GF (C++) Page 103 MmfCreateEM340GF (C#) MmfCreatePciDevice Generates PCI Express device driver class objects.
  • Page 30: Chapter 3 Api Library Details (Basic Functions)

    API LIBRARY DETAILS (BASIC FUNCTIONS) This chapter describes the procedures for using the basic functions of the API library, and the relevant classes. Execution procedure An example of the execution procedure is shown below. ■Preparation and ending procedure for using the methods of controller class and axis class START Generate object of device driver class MmfCreatePciDevice...
  • Page 31 ■Procedure for starting positioning control, and waiting for positioning completion interrupt START Set parameters Start interrupt driver MMC_DeviceDriver::StartInterrupt Preparation Turn ON user program READY signal [Y0] MMC_Controller::SetUserProgramReady Enable interrupt output MMC_Controller::EnableInterrupt Set positioning data MMC_Axis::SetPositioningData Set the positioning completion interrupt MMC_Axis::ResetPositioningDoneIntEvent Start event to a nonsignaled state...
  • Page 32: Mmc_Networkmodule Class

    MMC_NetworkModule Class This class controls the network module. class MMC_NetworkModule Member ■Public method Category Name Description Reference Object Delete Deletes object. Page 31 MMC_NetworkModule::Delete generation/ Delete method ■Public data member Variable name Data type Initial value Description long long A variable that the user may use freely. An integer value or pointer can be cast to long long type and stored.
  • Page 33: Mmc_Networkmodule::delete

    MMC_NetworkModule::Delete Deletes axis object. void Delete( void Detailed description ■Parameter None. ■Return value None. ■Point Because the objects gotten by the get object method of the controller class (GetAxis, GetSlaveIo, GetSyncEncoder, GetFbAxisRef) are automatically deleted at the time of controller class object delete, calling this method is not necessary. ■Supported version API version Software version...
  • Page 34: Mmc_Controller Class

    MMC_Controller Class This class controls the controller. class MMC_Controller: public MMC_Master Member ■Public method Category Name Description Reference Get object method GetAxis Gets the object of the axis class. Page 34 MMC_Controller::GetAxis (C++) Page 35 MMC_Controller::GetAxis (C#) GetSlaveIo Gets the object of the I/O class. Page 36 MMC_Controller::GetSlaveIo (C++) Page 37 MMC_Controller::GetSlaveIo...
  • Page 35 Inheritance hierarchy MMC_NetworkModule MMC_Master MMC_Controller Execution procedure The procedure for returning parameters to their initial factory values is given as an example. START Preparation Turn OFF user program READY signal [Y0] MMC_Controller::SetUserProgramReady Initialization Return parameters to the initial factory values MMC_Controller::InitializeParameter 3 API LIBRARY DETAILS (BASIC FUNCTIONS) 3.2 MMC_Controller Class...
  • Page 36: Mmc_Controller::getaxis (C++)

    MMC_Controller::GetAxis (C++) Gets axis class object. unsigned long GetAxis( unsigned long axisNumber, MMC_Axis **axis Detailed description ■Parameter Argument Description axisNumber [in] Axis No. (1 to 16) axis [out] Pointer to the axis class object pointer. ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0...
  • Page 37: Mmc_Controller::getaxis (C#)

    MMC_Controller::GetAxis (C#) Gets axis class object. MMC_J4GF^ GetAxis( uint axisNumber Detailed description ■Parameter Argument Description axisNumber [in] Axis No. (1 to 16) ■Return value Value Description Reference to the axis class object Function succeeded null Failed to generate object. Call the MmfGetLastError function of MMC_BasicLibrary class and confirm the error details.
  • Page 38: Mmc_Controller::getslaveio (C++)

    MMC_Controller::GetSlaveIo (C++) Gets I/O class object. unsigned long GetSlaveIo( unsigned long stationNumber, MMC_Io **slaveIo Detailed description ■Parameter Argument Description stationNumber [in] Station No. (1 to 120) slaveIo [out] Pointer to the I/O class object pointer. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called.
  • Page 39: Mmc_Controller::getslaveio (C#)

    MMC_Controller::GetSlaveIo (C#) Gets I/O class object. MMC_CcieSlaveIo^ GetSlaveIo( uint stationNumber Detailed description ■Parameter Argument Description stationNumber [in] Station No. (1 to 120) ■Return value Value Description Reference to the I/O class object Function succeeded null Failed to generate object. Call the MmfGetLastError function of MMC_BasicLibrary class and confirm the error details.
  • Page 40: Mmc_Controller::resetcontroller

    MMC_Controller::ResetController Executes remote RESET. unsigned long ResetController( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (30 seconds) has elapsed. ■Point After writing "1EA5H"...
  • Page 41: Mmc_Controller::setuserprogramready

    MMC_Controller::SetUserProgramReady Sets the user program READY signal [Y0]. unsigned long SetUserProgramReady( bool userProgramReady Detailed description ■Parameter Argument Description userProgramReady [in] User program READY signal [Y0] (MMC_ON or MMC_OFF) ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (1 second) has elapsed.
  • Page 42: Mmc_Controller::initializeparameter

    MMC_Controller::InitializeParameter Returns the data set in the buffer memory/internal memory and flash ROM/internal memory (nonvolatile) to their initial factory values. unsigned long InitializeParameter( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (30 seconds) has elapsed.
  • Page 43: Mmc_Controller::backupparameter

    MMC_Controller::BackupParameter Writes execution data to flash ROM/internal memory (nonvolatile). unsigned long BackupParameter( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (10 seconds) has elapsed. MMERR_CONDITION_USER_PROGRAM_READY_ON User program READY signal [Y0] is ON.
  • Page 44: Mmc_Controller::setinterruptparameter

    MMC_Controller::SetInterruptParameter Sets the interrupt parameter. unsigned long SetInterruptParameter( unsigned long intNumber, MMC_Label &label, const MMST_InterruptParameter &interruptParameter Detailed description ■Parameter Argument Description intNumber [in] Interrupt factor No. (9 to 64) label [in] Interrupt factor label interruptParameter [in] Interrupt parameter structure interruptParameter.IntCondition [in] Interrupt condition interruptParameter.IntSensitivity [in] Interrupt detection timing...
  • Page 45 ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location ■Point • When a bool label is specified to an interrupt factor label, setting interrupt condition judge value 1 is not required because the API library automatically sets the mask value.
  • Page 46: Mmc_Controller::enableinterrupt

    MMC_Controller::EnableInterrupt Enables the interrupt output. unsigned long EnableInterrupt( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_WIN_RESET_EVENT An error occurred in the ResetEvent function (Win32API). Call the GetLastError function of Win32API and confirm the error details.
  • Page 47: Mmc_Controller::disableinterrupt

    MMC_Controller::DisableInterrupt Disables the interrupt output. unsigned long DisableInterrupt( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_WIN_RESET_EVENT An error occurred in the ResetEvent function (Win32API). Call the GetLastError function of Win32API and confirm the error details.
  • Page 48: Mmc_Controller::registerintcallback (C++)

    MMC_Controller::RegisterIntCallback (C++) Registers the interrupt callback function. The registered function is called back from the interrupt driver when an interrupt occurs. unsigned long RegisterIntCallback( void *interruptProc Detailed description ■Parameter Argument Description interruptProc [in] Callback function pointer ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0...
  • Page 49: Mmc_Controller::registerintcallback (C#)

    MMC_Controller::RegisterIntCallback (C#) Registers the interrupt callback function. The registered function is called back from the interrupt driver when an interrupt occurs. uint RegisterIntCallback( INT_CB_FUNC^ int_CB_FUNC Detailed description ■Parameter Argument Description int_CB_FUNC [in] Reference to the delegate registered the callback function ■Return value Value Description...
  • Page 50 ■Reference UnregisterIntCallback (Page 49 MMC_Controller::UnregisterIntCallback) 3 API LIBRARY DETAILS (BASIC FUNCTIONS) 3.2 MMC_Controller Class...
  • Page 51: Mmc_Controller::unregisterintcallback

    MMC_Controller::UnregisterIntCallback Unregisters the interrupt callback function. unsigned long UnregisterIntCallback( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_INT_ALREADY_UNREREGISTER_CALLBACK The interrupt callback function has already been unregistered. ■Point None. ■Supported version API version Software version 1.00 ■Reference RegisterIntCallbacks (Page 46 MMC_Controller::RegisterIntCallback (C++), Page 47 MMC_Controller::RegisterIntCallback (C#)) 3 API LIBRARY DETAILS (BASIC FUNCTIONS)
  • Page 52: Mmc_Controller::resetintevent

    MMC_Controller::ResetIntEvent Sets the interrupt event to a nonsignaled state. This function is used if interrupt events occurring prior to calling the WaitIntEvent method are to be disabled. unsigned long ResetIntEvent( unsigned long intNumber Detailed description ■Parameter Argument Description intNumber [in] Interrupt factor No.
  • Page 53: Mmc_Controller::setintevent

    MMC_Controller::SetIntEvent Sets the interrupt event to a signaled state. This function is used to release the standby status with the WaitIntEvent method at the timing of the user program, not the interrupt event of the Simple Motion board. unsigned long SetIntEvent( unsigned long intNumber Detailed description ■Parameter...
  • Page 54: Mmc_Controller::waitintevent

    MMC_Controller::WaitIntEvent Waits until the interrupt event is in a signaled state. This function is used to wait for the interrupt from the Simple Motion board for the designated interrupt factor. unsigned long WaitIntEvent( unsigned long intNumber, unsigned long timeout Detailed description ■Parameter Argument Description...
  • Page 55: Mmc_Controller::enabledma

    MMC_Controller::EnableDMA Enables DMA transmission. unsigned long EnableDMA( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_DMA_NOT_START_DRIVER The DMA transmission driver is stopped. Call the StartDMA method. MMERR_DMA_INVALID_ADDRESS The DMA destination address is incorrect.
  • Page 56: Mmc_Controller::disabledma

    MMC_Controller::DisableDMA Disables DMA transmission. unsigned long DisableDMA( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (1 second) has elapsed. ■Point •...
  • Page 57: Mmc_Controller::readremotebuffermemory

    MMC_Controller::ReadRemoteBufferMemory Reads data from the buffer memory in the remote device station. unsigned long ReadRemoteBufferMemory ( unsigned char netno, unsigned char stno, unsigned long offset, unsigned short size, void *data, unsigned long timeout Detailed description ■Parameter Argument Description netno [in] Network No.
  • Page 58: Mmc_Controller::writeremotebuffermemory

    MMC_Controller::WriteRemoteBufferMemory Writes data to the buffer memory in the remote device station. unsigned long WriteRemoteBufferMemory( unsigned char netno, unsigned char stno, unsigned long offset, unsigned short size, void *data, unsigned long timeout Detailed description ■Parameter Argument Description netno [in] Network No. of the remote device station (0 to 239) stno [in] Station No.
  • Page 59: 3.3 Mmc_Axis Class

    MMC_Axis Class This class controls the servo amplifier axis. class MMC_Axis: public MMC_Slave Member ■Public method Category Name Description Reference Positioning data SetPositioningData Sets the positioning data. Page 59 MMC_Axis::SetPositioningData method SetBlockStartData Sets the block start data. Page 60 MMC_Axis::SetBlockStartData SetBlockConditionData Sets the condition data used by block start.
  • Page 60 ■Label Refer to label list for labels. (Page 203 LABEL LIST) Point Get axis class objects with the GetAxis method of the controller class. Inheritance hierarchy MMC_NetworkModule MMC_Slave MMC_Axis Execution procedure The procedure for starting positioning control and waiting for positioning completion by polling is given as an example. START Set parameters Preparation...
  • Page 61: Mmc_Axis::setpositioningdata

    MMC_Axis::SetPositioningData Sets the positioning data ([Da.1] to [Da.10], [Da.20] to [Da.22], [Da.27] to [Da.29]). unsigned long SetPositioningData( unsigned long dataNo, const MMST_PositioningData &positioningData Detailed description ■Parameter Argument Description dataNo [in] Positioning data No. (1 to 600) positioningData [in] Positioning structure ■Return value Value Description...
  • Page 62: Mmc_Axis::setblockstartdata

    MMC_Axis::SetBlockStartData Sets the block start data. unsigned long SetBlockStartData( unsigned long blockNo, unsigned long pointNo, const MMST_BlockStartData &blockStartData Detailed description ■Parameter Argument Description blockNo [in] Block No.(0 to 4) pointNo [in] Point No.(1 to 50) blockStartData [in] Block start data structure ■Return value Value Description...
  • Page 63: Mmc_Axis::setblockconditiondata

    MMC_Axis::SetBlockConditionData Sets the condition data used by block start. unsigned long SetBlockConditionData( unsigned long blockNo, unsigned long conditionNo, const MMST_BlockConditionData &blockConditionData Detailed description ■Parameter Argument Description blockNo [in] Block No. (0 to 4) conditionNo [in] Condition data No.(1 to 10) blockConditionData [in] Condition data structure ■Return value...
  • Page 64: Mmc_Axis::getpositioningdata

    MMC_Axis::GetPositioningData Gets the positioning data ([Da.1] to [Da.10], [Da.20] to [Da.22], [Da.27] to [Da.29]). Unsigned long GetPositioningData( unsigned long dataNo, MMST_PositioningData *positioningData Detailed description ■Parameter Argument Description dataNo [in] Positioning data No.(1 to 600) positioningData [in] Pointer to positioning data structure ■Return value Value Description...
  • Page 65: Mmc_Axis::getblockstartdata

    MMC_Axis::GetBlockStartData Gets the block start data. unsigned long GetBlockStartData( unsigned long blockNo, unsigned long pointNo, MMST_BlockStartData *blockStartData Detailed description ■Parameter Argument Description blockNo [in] Block No. (0 to 4) pointNo [in] Point No.(1 to 50) blockStartData [in] Pointer to block start data structure ■Return value Value Description...
  • Page 66: Mmc_Axis::getblockconditiondata

    MMC_Axis::GetBlockConditionData Gets the condition data used by block start. unsigned long GetBlockConditionData( unsigned long blockNo, unsigned long conditionNo, MMST_BlockConditionData *blockConditionData Detailed description ■Parameter Argument Description blockNo [in] Block No. (0 to 4) conditionNo [in] Condition data No. (1 to 10) blockConditionData [in] Pointer to condition data structure ■Return value...
  • Page 67: Mmc_Axis::startpositioning

    MMC_Axis::StartPositioning Starts positioning control. unsigned long StartPositioning( unsigned short startNo Detailed description ■Parameter Argument Description startNo [in] Positioning start No. *1 Specify the following values for the positioning start No. Value Description 1 to 600 Positioning data No. MMC_STNO_HOMING Machine home position return MMC_STNO_FAST_HOMING High speed home position return MMC_STNO_CHANGE_VALUE...
  • Page 68: Mmc_Axis::startblockpositioning

    MMC_Axis::StartBlockPositioning Starts advanced positioning control. unsigned long StartBlockPositioning( unsigned short startBlock, unsigned short startPointNo Detailed description ■Parameter Argument Description startBlock [in] Start block (0 to 4) startPointNo [in] Positioning start point No. (1 to 50) ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called.
  • Page 69: Mmc_Axis::stoppositioning

    MMC_Axis::StopPositioning Stops axis. unsigned long StopPositioning( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. ■Point • This method uses "[Cd.180] Axis stop". In addition to positioning control, manual controls (JOG operation etc.), and expansion controls (speed-torque control etc.) can also use this method.
  • Page 70: Mmc_Axis::restartpositioning

    MMC_Axis::RestartPositioning Restarts stopped axis. unsigned long RestartPositioning( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_CONDITION_READY_SIGNAL_OFF The READY signal [X0] is OFF. MMERR_CONDITION_AXIS_OPERATION_STATUS "[Md.26] Axis operation status"...
  • Page 71: Mmc_Axis::waitpositioningdone

    MMC_Axis::WaitPositioningDone Waits until completion of positioning control. unsigned long WaitPositioningDone( unsigned long checkMethod, unsigned long timeout Detailed description ■Parameter Argument Description checkMethod [in] Positioning control complete judge condition timeout [in] Timeout time [ms] (0 to 65535) *1 Specify the following values for positioning control complete judge condition. Value Description MMC_POSITIONING_DONE_BUSY...
  • Page 72: Mmc_Axis::resetpositioningdoneintevent

    MMC_Axis::ResetPositioningDoneIntEvent Sets the positioning complete interrupt event to a nonsignaled state. This function is used if positioning complete interrupt events occurring prior to calling the WaitPositioningDoneIntEvent method are to be disabled. unsigned long ResetPositioningDoneIntEvent( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK...
  • Page 73: Mmc_Axis::setpositioningdoneintevent

    MMC_Axis::SetPositioningDoneIntEvent Sets the positioning complete interrupt event to a signaled state. This function is used to release the standby status with the WaitPositioningDoneIntEvent method at the timing of the user program, not the interrupt event of the Simple Motion board. unsigned long SetPositioningDoneIntEvent( void Detailed description...
  • Page 74: Mmc_Axis::waitpositioningdoneintevent

    MMC_Axis::WaitPositioningDoneIntEvent Waits until the positioning complete interrupt event is in a signaled state. This function is used to wait for the interrupt from the Simple Motion board for the designated interrupt factor. unsigned long WaitPositioningDoneIntEvent( unsigned long checkMethod, unsigned long timeout Detailed description ■Parameter Argument...
  • Page 75: Mmc_Axis::startjog

    MMC_Axis::StartJog Starts JOG operation. unsigned long StartJog( long speed Detailed description ■Parameter Argument Description speed [in] JOG speed ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location MMERR_CONDITION_READY_SIGNAL_OFF The READY signal [X0] is OFF.
  • Page 76: Mmc_Axis::stopjog

    MMC_Axis::StopJog Stops JOG operation. unsigned long StopJog( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. ■Point This method returns control immediately after writing "0" to "[Cd.181] Forward run JOG start" and "[Cd.182] Reverse run JOG start".
  • Page 77: Mmc_Axis::startinching

    MMC_Axis::StartInching Starts inching operation. unsigned long StartInching( long movementAmount Detailed description ■Parameter Argument Description movementAmount [in] Inching movement amount (-65535 to -1, 1 to 65535) ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_ARGUMENT_0...
  • Page 78: Mmc_Axis::enablempg

    MMC_Axis::EnableMPG Enables manual pulse generator operation. unsigned long EnableMPG( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (1 second) has elapsed. MMERR_AXIS_ERROR An axis error occurred.
  • Page 79: Mmc_Axis::disablempg

    MMC_Axis::DisableMPG Disables manual pulse generator operation. unsigned long DisableMPG( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (1 second) has elapsed. ■Point This method sets "0"...
  • Page 80: Mmc_Axis::changecontrolmode

    MMC_Axis::ChangeControlMode Changes control mode. unsigned long ChangeControlMode( unsigned short controlMode, unsigned long timeout Detailed description ■Parameter Argument Description controlMode [in] Control mode timeout [in] Timeout time [ms] (0 to 65535) *1 Specify the following values for control mode. Value Description MMC_CONTROL_POSITION Position control mode MMC_CONTROL_SPEED...
  • Page 81: Mmc_Axis::changespeed

    MMC_Axis::ChangeSpeed Changes speed and acceleration/deceleration time. unsigned long ChangeSpeed( unsigned long speed, unsigned long accTime, unsigned long decTime Detailed description ■Parameter Argument Description speed [in] [Cd.14] New speed value accTime [in] [Cd.10] New acceleration time value decTime [in] [Cd.11] New deceleration time value ■Return value Value Description...
  • Page 82: Mmc_Axis::changeposition

    MMC_Axis::ChangePosition Changes target position and command speed. unsigned long ChangePosition( long position, unsigned long speed, unsigned long timeout Detailed description ■Parameter Argument Description position [in] [Cd.27] Target position change value (New address) speed [in] [Cd.28] Target position change value (New speed) timeout [in] Timeout time [ms] (0 to 65535) ■Return value...
  • Page 83: Mmc_Axis::reseterror

    MMC_Axis::ResetError Performs error reset. unsigned long ResetError( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (1 second) has elapsed. ■Point After setting "1"...
  • Page 84: Mmc_Axis::setinterruptparameter

    MMC_Axis::SetInterruptParameter Sets the interrupt parameter. unsigned long SetInterruptParameter( unsigned long intNumber, MMC_Label &label, const MMST_InterruptParameter &interruptParameter Detailed description ■Parameter Argument Description intNumber [in] Interrupt factor No. (9 to 64) label [in] Interrupt factor label interruptParameter [in] Interrupt parameter structure interruptParameter.IntCondition [in] Interrupt condition interruptParameter.IntSensitivity [in] Interrupt detection timing...
  • Page 85 ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location ■Point • When a bool label is specified to an interrupt factor label, setting interrupt condition judge value 1 is not required because the API library automatically sets the mask value.
  • Page 86: Mmc_Axis::resetintevent

    MMC_Axis::ResetIntEvent Sets the interrupt event to a nonsignaled state. This function is used if interrupt events occurring prior to calling the WaitIntEvent method are to be disabled. unsigned long ResetIntEvent( unsigned long intNumber Detailed description ■Parameter Argument Value intNumber [in] Interrupt factor No.
  • Page 87: Mmc_Axis::setintevent

    MMC_Axis::SetIntEvent Sets the interrupt event to a signaled state. This function is used to release the standby status with the WaitIntEvent method at the timing of the user program, not the interrupt event of the Simple Motion board. unsigned long SetIntEvent( unsigned long intNumber Detailed description ■Parameter...
  • Page 88: Mmc_Axis::waitintevent

    MMC_Axis::WaitIntEvent Waits until the interrupt event is in a signaled state. This function is used to wait for the interrupt from the Simple Motion board for the designated interrupt factor. unsigned long WaitIntEvent( unsigned long intNumber, unsigned long timeout Detailed description ■Parameter Argument Description...
  • Page 89: Mmc_Io Class

    MMC_Io Class This class controls I/O modules. class MMC_Io: public MMC_Slave Member ■Public method There is no public method. ■Public data member Variable name Data type Initial value Description LastErrorNumber unsigned long MMERR_NONE Latest error code LastDetailErrorNumber unsigned long MMERR_NONE Latest detail error code StationNumber unsigned long...
  • Page 90: Link Device

    Link device Access the link devices allocated to I/O modules by using the labels automatically generated when getting objects. Simple Motion board I/O module I/O module (Station No. 0) (Station No. 17) (Station No. 18) RX[0] RX[0] 0000 0000 0000 000F RX[15] 0010 RX[16]...
  • Page 91: Mmc_Label Class

    MMC_Label Class This class provides a function for accessing the buffer memory of the Simple Motion board. The buffer memory of the Simple Motion board is given a name for each item which is registered as a label. By using labels, the buffer memory can be accessed in a way like using variables.
  • Page 92: Wait

    Wait Waits by polling until the value of the label satisfies the specified conditions. unsigned long MMC_LabelLongReadOnly::Wait( unsigned long condition, long value, unsigned long timeout unsigned long MMC_LabelULongReadOnly::Wait( unsigned long condition, unsigned long value, unsigned long timeout unsigned long MMC_LabelShortReadOnly::Wait( unsigned long condition, short value, unsigned long timeout...
  • Page 93 ■Example void WaitServoON(MMC_Axis *axis) /* Wait until servo ON of servo status 1 turns ON */ unsigned long returnCode; returnCode = axis->AxMntr.ServoStatus1_Servo.Wait( MMC_WAIT_EQUAL, MMC_ON, 10000 ); if( returnCode != MMC_OK ){ /* Error processing */ } ■Supported version API version Software version 1.00 ■Reference...
  • Page 94: 3.6 Mmc_Devicedriver Class

    MMC_DeviceDriver Class This class provides a function for accessing the Simple Motion board via a PCI Express connection. class MMC_DeviceDriver Member ■Public method Category Name Description Reference Delete/generate Delete Deletes object. Page 93 MMC_DeviceDriver::Delete object method Open and close Open Opens device.
  • Page 95: Mmc_Devicedriver::delete

    MMC_DeviceDriver::Delete Deletes object. void Delete( void Detailed description ■Parameter None. ■Return value None. ■Point None. ■Supported version API version Software version 1.00 ■Reference None. 3 API LIBRARY DETAILS (BASIC FUNCTIONS) 3.6 MMC_DeviceDriver Class...
  • Page 96: Mmc_Devicedriver::open

    MMC_DeviceDriver::Open Opens device. unsigned long Open( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_REOPEN The Open method is already called. MMERR_DEV_DEVICE_DRIVER An error occurred with a call of the device driver. Confirm that the device driver is installed. MMERR_DEV_NOT_FOUND_BOARD The Simple Motion board which has the designated board ID could not be found.
  • Page 97: Mmc_Devicedriver::close

    MMC_DeviceDriver::Close Closes device. unsigned long Close( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_DEV_DEVICE_DRIVER An error occurred with a call of the device driver. Confirm that the device driver is installed. ■Point Before ending the user program, call the Close method for Simple Motion boards that have been opened.
  • Page 98: Mmc_Devicedriver::startinterrupt

    MMC_DeviceDriver::StartInterrupt Starts interrupt driver. This function is used when interrupt event wait functions are used for interrupt monitoring. unsigned long StartInterrupt( long priority Detailed description ■Parameter Argument Description priority [in] Priority value ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called.
  • Page 99: Mmc_Devicedriver::endinterrupt

    MMC_DeviceDriver::EndInterrupt Ends interrupt driver. unsigned long EndInterrupt( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_INT_ALREADY_END_DRIVER The interrupt driver is already stopped. MMERR_DEV_DEVICE_DRIVER An error occurred with a call of the device driver.
  • Page 100: Mmc_Devicedriver::startdma

    MMC_DeviceDriver::StartDMA Starts DMA transmission driver. unsigned long StartDMA( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_DMA_ALREADY_START_DRIVER The DMA transmission driver is already started. MMERR_DEV_DEVICE_DRIVER An error occurred with a call of the device driver.
  • Page 101: Mmc_Devicedriver::enddma

    MMC_DeviceDriver::EndDMA Ends DMA transmission driver. unsigned long EndDMA( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_DMA_ALREADY_END_DRIVER The DMA transmission driver is already stopped. MMERR_DEV_DEVICE_DRIVER An error occurred with a call of the device driver.
  • Page 102: Mmc_Devicedriver::setbuffermemory

    MMC_DeviceDriver::SetBufferMemory Sets any given data to any given address of the buffer memory. unsigned long SetBufferMemory( unsigned long offset, unsigned long size, const void *data Detailed description ■Parameter Argument Description offset [in] Address offset (2-byte units) from the buffer memory top address size [in] Size (2-byte units) from the address offset data [in]...
  • Page 103: Mmc_Devicedriver::getbuffermemory

    MMC_DeviceDriver::GetBufferMemory Gets set data from any given address of the buffer memory. unsigned long GetBufferMemory( unsigned long offset, unsigned long size, void *data Detailed description ■Parameter Argument Description offset [in] Address offset (2-byte units) from the buffer memory top address size [in] Size (2-byte units) from the address offset data [out]...
  • Page 104: Object Generation Functions

    Object Generation Functions These functions generate the objects of the classes used by the API library. Use the object generation functions when generating objects. • For objects generated using the object generation functions, delete them with the Delete method. • Only one controller object and one device driver object can be generated per Simple Motion board. MmfCreateEM340GF (C++) Generates the objects of the MMC_EM340GF class.
  • Page 105: Mmfcreateem340Gf (C#)

    MmfCreateEM340GF (C#) Generates the objects of the MMC_EM340GF class. MMC_EM340GF^ MmfCreateEM340GF( MMC_DeviceDriver deviceDriver Detailed description ■Parameter Argument Description deviceDriver [in] Reference to the device driver class object ■Return value Value Description Reference to the controller class objects Function succeeded null Failed to generate object.
  • Page 106: Mmfcreatepcidevice (C++)

    MmfCreatePciDevice (C++) Generates the objects of the PCI Express device driver class. unsigned long MmfCreatePciDevice( unsigned long boardID, MMC_DeviceDriver **deviceDriver Detailed description ■Parameter Argument Description boardID [in] Board ID (0 to 3) deviceDriver [out] Pointer to the device driver class object pointer. ■Return value Value Description...
  • Page 107: Mmfcreatepcidevice (C#)

    MmfCreatePciDevice (C#) Generates the objects of the PCI Express device driver class. MMC_PciWindows^ MmfCreatePciDevice( uint boardID, Detailed description ■Parameter Argument Description boardID [in] Board ID (0 to 3) ■Return value Value Description Reference to the device driver class object Function succeeded null Failed to generate object.
  • Page 108: Basic Library Functions

    Basic Library Functions These functions are for using the basic functions provided by the operating system. MmfGetLastError Gets the error codes of Basic Library functions and object generation functions. unsigned long MmfGetLastError( void Detailed description ■Parameter None. ■Return value Value Description Latest error code Refer to error code list for details of error codes.
  • Page 109: Mmfcreatesemaphore

    MmfCreateSemaphore Creates or opens a named semaphore object. unsigned long MmfCreateSemaphore( const wchar_t *name, HANDLE *hSemaphore Detailed description ■Parameter Argument Description name [in] Name of object hSemaphore [out] Pointer to the variable that stores the handle of the semaphore object ■Return value Value Description...
  • Page 110: Mmfdeletesemaphore

    MmfDeleteSemaphore Closes the handle of an open semaphore object. unsigned long MmfDeleteSemaphore( HANDLE hSemaphore Detailed description ■Parameter Argument Description hSemaphore [in] Handle of the semaphore object ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location MMERR_WIN_CLOSE_HANDLE An error occurred in the CloseHandle function (Win32API).
  • Page 111: Mmfwaitsemaphore

    MmfWaitSemaphore Returns control when one of the following is established. • The semaphore object becomes a signaled state. • The timeout time elapses. unsigned long MmfWaitSemaphore( HANDLE hSemaphore, unsigned long timeout Detailed description ■Parameter Argument Description hSemaphore [in] Handle of the semaphore object timeout [in] Timeout time [ms] (0 to 65535) ■Return value...
  • Page 112: Mmfreleasesemaphore

    MmfReleaseSemaphore Increases the count of the specified semaphore object by one. unsigned long MmfReleaseSemaphore( HANDLE hSemaphore Detailed description ■Parameter Argument Description hSemaphore [in] Handle of the semaphore object ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location MMERR_WIN_RELEASE_SEMAPHORE An error occurred in the ReleaseSemaphore function (Win32API).
  • Page 113: Mmfcreateevent

    MmfCreateEvent Creates or opens a named event object. unsigned long MmfCreateEvent( const wchar_t *name, HANDLE *hEvent Detailed description ■Parameter Argument Description name [in] Name of object hEvent [out] Pointer to the variable that stores the handle of the event object ■Return value Value Description...
  • Page 114: Mmfdeleteevent

    MmfDeleteEvent Closes the handle of an open event object. unsigned long MmfDeleteEvent( HANDLE hEvent Detailed description ■Parameter Argument Description hEvent [in] Handle of the event object ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location MMERR_WIN_CLOSE_HANDLE An error occurred in the CloseHandle function (Win32API).
  • Page 115: Mmfresetevent

    MmfResetEvent Sets the event object to a nonsignaled state. unsigned long MmfResetEvent( HANDLE hEvent Detailed description ■Parameter Argument Description hEvent [in] Handle of the event object ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location MMERR_WIN_RESET_EVENT An error occurred in the ResetEvent function (Win32API).
  • Page 116: Mmfsetevent

    MmfSetEvent Sets the event object to a signaled state. unsigned long MmfSetEvent( HANDLE hEvent Detailed description ■Parameter Argument Description hEvent [in] Handle of the event object ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location MMERR_WIN_SET_EVENT An error occurred in the SetEvent function (Win32API).
  • Page 117: Mmfwaitevent

    MmfWaitEvent Returns control when one of the following is established. • The event object becomes a signaled state. • The timeout time elapses. unsigned long MmfWaitEvent( HANDLE hEvent, unsigned long timeout Detailed description ■Parameter Value Description hEvent [in] Handle of the event object timeout [in] Timeout time [ms] (0 to 65535) ■Return value...
  • Page 118: Mmfcreatethread

    MmfCreateThread Creates thread. unsigned long MmfCreateThread( long priority, unsigned long stackSize, void *startAddress, void *parameter, HANDLE *hThread Detailed description ■Parameter Argument Description priority [in] Thread priority value stackSize [in] Stack size [bytes] startAddress [in] Function of the thread parameter [in] Argument of the thread hThread [out] Pointer to the variable that stores the handle of the thread...
  • Page 119: Mmfdeletethread

    MmfDeleteThread Closes the handle of a thread. unsigned long MmfDeleteThread( HANDLE hThread Detailed description ■Parameter Argument Description hThread [in] Handle of the thread ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location MMERR_WIN_CLOSE_HANDLE An error occurred in the CloseHandle function (Win32API).
  • Page 120: Mmfwaitthread

    MmfWaitThread Returns control when one of the following is established. • The thread object becomes a signaled state. • The timeout time elapses. unsigned long MmfWaitThread ( HANDLE hThread, unsigned long timeout Detailed description ■Parameter Value Description hThread [in] Handle of the thread timeout [in] Timeout time [ms] (0 to 65535) ■Return value...
  • Page 121: Mmfsetthreadpriority

    MmfSetThreadPriority Sets the priority value of the thread. unsigned long MmfSetThreadPriority( HANDLE hThread, long priority Detailed description ■Parameter Argument Description hThread [in] Handle of the thread priority [in] Priority value of the thread ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0...
  • Page 122: Mmfresumethread

    MmfResumeThread Decrements the suspend count of the thread by one. unsigned long MmfResumeThread( HANDLE hThread Detailed description ■Parameter Argument Description hThread [in] Handle of the thread ■Return value Value Description MMC_OK Function succeeded MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location MMERR_WIN_RESUME_THREAD An error occurred in the ResumeThread function (Win32API).
  • Page 123: Mmfgetexitcodethread

    MmfGetExitCodeThread Gets the exit code of the thread. unsigned long MmfGetExitCodeThread( HANDLE hThread, unsigned long *exitCode Detailed description ■Parameter Argument Description hThread [in] Handle of the thread exitCode [out] Pointer to the variable that stores the exit code ■Return value Value Description MMC_OK...
  • Page 124: Mmfexitthread

    MmfExitThread Exits the thread. void MmfExitThread( unsigned long exitCode Detailed description ■Parameter Argument Description exitCode [in] Exit code ■Return value None. ■Point None. ■Supported version API version Software version 1.00 ■Reference None. 3 API LIBRARY DETAILS (BASIC FUNCTIONS) 3.8 Basic Library Functions...
  • Page 125: Mmfgetcurrenttime

    MmfGetCurrentTime Gets the time elapsed since system startup. unsigned long MmfGetCurrentTime( void Detailed description ■Parameter None. ■Return value Elapsed time [ms] since the system startup. ■Point None. ■Supported version API version Software version 1.00 ■Reference MmfCheckPassTime (Page 124 MmfCheckPassTime) MmfWaitDelayTime (Page 125 MmfWaitDelayTime) 3 API LIBRARY DETAILS (BASIC FUNCTIONS) 3.8 Basic Library Functions...
  • Page 126: Mmfcheckpasstime

    MmfCheckPassTime Checks the specified time has passed. unsigned long MmfCheckPassTime( unsigned long starttime, unsigned long delaytime Detailed description ■Parameter Argument Description starttime [in] Start time [ms] delaytime [in] Elapsed time [ms] ■Return value Value Description MMC_OK The specified time has elapsed. MMC_NG The specified time has not elapsed.
  • Page 127: Mmfwaitdelaytime

    MmfWaitDelayTime Cancels the execution of thread and specified time. void MmfWaitDelayTime( unsigned long delaytime Detailed description ■Parameter Argument Description delaytime [in] Cancel time [ms] ■Return value None. ■Point None. ■Supported version API version Software version 1.00 ■Reference MmfGetCurrentTime (Page 123 MmfGetCurrentTime) MmfCheckPassTime (Page 124 MmfCheckPassTime) 3 API LIBRARY DETAILS (BASIC FUNCTIONS) 3.8 Basic Library Functions...
  • Page 128: Chapter 4 Api Library Details (Advanced Synchronous Control)

    API LIBRARY DETAILS (ADVANCED SYNCHRONOUS CONTROL) This chapter describes the procedures for using advanced synchronous control, and the specifications of the relevant classes. Refer to the following for details of advanced synchronous control. Simple Motion Board User's Manual (Advanced Synchronous Control) Execution procedure The procedure for using the advanced synchronous control function is shown below.
  • Page 129: Mmc_Controller Class

    MMC_Controller Class This class controls the controller. class MMC_Controller: public MMC_Master Member ■Public method Category Name Description Reference Get object GetSyncEncoder Gets the object of the synchronous encoder axis Page 128 method class. MMC_Controller::GetSyncEncoder Synchronous CalcCamCommandPosition Calculates cam axis feed current value. Page 129 control method MMC_Controller::CalcCamCommandPosition...
  • Page 130: Mmc_Controller::getsyncencoder

    MMC_Controller::GetSyncEncoder Gets the object of the synchronous encoder axis class. unsigned long GetSyncEncoder( unsigned long axisNumber, MMC_SyncEncoder **syncEncoder Detailed description ■Parameter Argument Description axisNumber [in] Synchronous encoder axis No. (1 to 16) syncEncoder [out] Pointer to the synchronous encoder axis class object pointer ■Return value Value Description...
  • Page 131: Mmc_Controller::calccamcommandposition

    MMC_Controller::CalcCamCommandPosition Calculates cam axis feed current value. unsigned long CalcCamCommandPosition( const MMST_CamPositionData &camPositionData, long *result Detailed description ■Parameter Argument Description camPositionData [in] Cam position calculation data structure result [out] Pointer to the variable that stores cam position calculation result ■Return value Value Description MMC_OK...
  • Page 132: Mmc_Controller::calccamcommandpositionpercycle

    MMC_Controller::CalcCamCommandPositionPerCycle Calculates cam axis current value per cycle. unsigned long CalcCamCommandPositionPerCycle( const MMST_CamPositionData &camPositionData, long *result Detailed description ■Parameter Argument Description camPositionData [in] Cam position calculation data structure result [out] Pointer to the variable that stores cam position calculation result ■Return value Value Description...
  • Page 133: Mmc_Controller::makerotarycuttercam

    MMC_Controller::MakeRotaryCutterCam Auto-generates the cam (central reference) for rotary cutter. unsigned long MakeRotaryCutterCam( unsigned short camNo, const MMST_RotaryCutterCamData &rotaryCutterCamData, unsigned short *asynchronousSpeedResult Detailed description ■Parameter Argument Description camNo [in] Cam auto-generation cam No. (1 to 1024) rotaryCutterCamData [in] Data structure for auto-generation (rotary cutter cam (central reference)) asynchronousSpeedResult [out] Pointer to the asynchronous speed result ■Return value...
  • Page 134: Mmc_Controller::makeeasystrokeratiocam

    MMC_Controller::MakeEasyStrokeRatioCam Auto-generates the easy stroke ratio cam. unsigned long MakeEasyStrokeRatioCam( unsigned short camNo, const MMST_EasyStrokeRatioCamData &easyStrokeRatioCamData, const MMST_EasyStrokeRatioCamSectionData easyStrokeRatioCamSectionData[] Detailed description ■Parameter Argument Description camNo [in] Cam auto-generation cam No. (1 to 1024) easyStrokeRatioCamData [in] Data structure for easy stroke ratio cam easyStrokeRatioCamSectionData [in] Pointer to section data structure array for easy stroke ratio cam ■Return value...
  • Page 135: Mmc_Controller::makeadvancedstrokeratiocam

    MMC_Controller::MakeAdvancedStrokeRatioCam Auto-generates the advanced stroke ratio cam. unsigned long MakeAdvancedStrokeRatioCam( unsigned short camNo, const MMST_AdvancedStrokeRatioCamData &advancedStrokeRatioCamData, const MMST_AdvancedStrokeRatioCamSectionData advancedStrokeRatioCamSectionData[] Detailed description ■Parameter Argument Description camNo [in] Cam auto-generation cam No. (1 to 1024) advancedStrokeRatioCamData [in] Data structure for advanced stroke ratio cam advancedStrokeRatioCamSectionData [in] Pointer to section data structure array for advanced stroke ratio cam ■Return value...
  • Page 136: Mmc_Axis Class

    MMC_Axis Class This class controls the servo amplifier axis. class MMC_Axis: public MMC_Slave Member ■Public method Category Name Description Reference Synchronous StartSync Starts synchronous control. Page 135 MMC_Axis::StartSync control method StopSync Stops synchronous control. Page 136 MMC_Axis::StopSync ChangeSyncPosition Changes current value during synchronous control. Page 137 MMC_Axis::ChangeSyncPosition MoveCamPosition...
  • Page 137: Mmc_Axis::startsync

    MMC_Axis::StartSync Starts synchronous control. unsigned long StartSync( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (10 seconds) has elapsed. MMERR_AXIS_ERROR An axis error occurred.
  • Page 138: Mmc_Axis::stopsync

    MMC_Axis::StopSync Stops synchronous control. unsigned long StopSync( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (1 second) has elapsed. MMERR_AXIS_ERROR An axis error occurred.
  • Page 139: Mmc_Axis::changesyncposition

    MMC_Axis::ChangeSyncPosition Changes current value of cam axis current value per cycle, current value per cycle after main gear, and current value per cycle after auxiliary shaft gear during synchronous control. unsigned long ChangeSyncPosition( unsigned short target, long value Detailed description ■Parameter Argument Description...
  • Page 140: Mmc_Axis::movecamposition

    MMC_Axis::MoveCamPosition Moves cam axis current value per cycle, or cam reference position during synchronous control. unsigned long MoveCamPosition( unsigned short target, long value, unsigned short reflectionTime Detailed description ■Parameter Argument Description target [in] Change target value [in] [Cd.408] Synchronous control change value reflectionTime [in] [Cd.409] Synchronous control reflection time [ms] *1 Specify the following values for change target.
  • Page 141: 4.3 Mmc_Syncencoder Class

    MMC_SyncEncoder Class This class controls the synchronous encoder axis. class MMC_SyncEncoder: public MMC_Slave Member ■Public method Category Name Description Reference Error method ResetSyncEncoderError Performs error reset of the synchronous encoder Page 140 axis. MMC_SyncEncoder::ResetSyncEncoderErro Change method ChangeSyncEncoderPosition Changes current value of the synchronous encoder Page 141 axis.
  • Page 142: Mmc_Syncencoder::resetsyncencodererror

    MMC_SyncEncoder::ResetSyncEncoderError Performs error reset of the synchronous encoder axis. unsigned long ResetSyncEncoderError( void Detailed description ■Parameter None. ■Return value Value Description MMC_OK Function succeeded MMERR_DEV_UNOPEN The Open method of the device driver class has not been called. MMERR_TIMEOUT_01 The timeout time (1 second) has elapsed. ■Point This method waits inside the method until the error reset is completed.
  • Page 143: Mmc_Syncencoder::changesyncencoderposition

    MMC_SyncEncoder::ChangeSyncEncoderPosition Changes the synchronous encoder axis current value and synchronous encoder axis current value per cycle. unsigned long ChangeSyncEncoderPosition( unsigned short startType, long newPosition Detailed description ■Parameter Argument Description startType [in] Start method newPosition [in] [Cd.322] Synchronous encoder axis current value setting address *1 Specify the following values for start method.
  • Page 144: Mmc_Syncencoder::disablesyncencoder

    MMC_SyncEncoder::DisableSyncEncoder Disables input from the synchronous encoder axis. unsigned long DisableSyncEncoder( unsigned short startType Detailed description ■Parameter Argument Description startType [in] Start method *1 Specify the following values for start method. Value Description MMC_SYNC_ENC_START Starts synchronous encoder axis control. MMC_SYNC_ENC_LINKDEV_START Wait to receive start request from link device.
  • Page 145: Mmc_Syncencoder::enablesyncencoder

    MMC_SyncEncoder::EnableSyncEncoder Enables input from the synchronous encoder axis. unsigned long EnableSyncEncoder( unsigned short startType Detailed description ■Parameter Argument Description startType [in] Start method *1 Specify the following values for start method. Value Description MMC_SYNC_ENC_START Starts synchronous encoder axis control. MMC_SYNC_ENC_LINKDEV_START Wait to receive start request from link device.
  • Page 146: Chapter 5 Api Library Details (Function Block)

    API LIBRARY DETAILS (FUNCTION BLOCK) For the function block class, the MR-J4-GF which is set to not only the motion mode but also the I/O mode can be used as the control target servo amplifier. Refer to the servo amplifier instruction manual for details of the motion mode and the I/O mode. <Motion mode>...
  • Page 147 Name Description Motion I/O mode Reference mode MC_ReadStatus Returns the detailed state of the state diagram of the Page 179 MC_ReadStatus class   specified axis. MC_ReadAxisInfo Reads the axis information of the specified axis.   Page 181 MC_ReadAxisInfo class MC_ReadAxisError Reads the error No.
  • Page 148 Inheritance hierarchy MC_FunctionBlock Execution procedure The procedure for using the functions of the function block class is shown below. START Preparation Get axis information object MMC_Controller::GetFbAxisRef Set input data Function block class axis information etc. Update Update I/O data MC_FunctionBlock::Update data Check output data Function block class error codes etc.
  • Page 149: Axis Information Class State Diagram

    Axis information class state diagram The axis information class (AXIS_REF class) state diagram is shown below. The axis is always in one of the defined states. <Motion mode> SynchronizedMotion MC_MoveAbsolute MC_MoveRelative MC_MoveVelocity MC_MoveAdditive MC_TorqueControl DiscreteMotion ContinuousMotion MC_Stop Stopping Done Errorstop MCv_Home Done Homing...
  • Page 150 <I/O mode> MC_MoveAbsolute MC_MoveRelative DiscreteMotion MC_Stop Stopping Done Errorstop MCv_Home Done Homing Standstill Disabled : Transition by the function block being started : Axis command ending, or transition by system *1 When an error occurs in the axis, transition occurs from any state. *2 When Enable=OFF for MC_Power and there is no error in the axis.
  • Page 151: Function Block Units

    Function block units The following units are available in function block class. When a value is input with more digits after the decimal point than the valid amount of digits, the final valid digit is rounded to the nearest number. <Motion mode>...
  • Page 152: Function Blocks For Plcopen Motion Control

    Function blocks for PLCopen Motion control A compatibility chart of the function blocks for PLCopen Motion control is shown below. Function blocks for PLCopen Motion control Part Category Function block for PLCopen Motion control API library Name Description Part1&Part2 Control Single MC_Power Operable...
  • Page 153 Label access ■Motion mode Function block name for PLCopen Label name Description Motion control MC_ReadAxisError AxisErrorNo [Md.23] Axis error No. MC_ReadParameter CommandedPosition TargetPosition [Md.32] Target value SWLimitPos SoftwareStrokeUpperLimit [Pr.12] Software stroke limit upper limit value SWLimitNeg SoftwareStrokeLowerLimit [Pr.13] Software stroke limit lower limit value MaxVelocityAppl SpeedLimitValue [Pr.8] Speed limit value...
  • Page 154: Mc_Functionblock::update

    MC_FunctionBlock::Update Updates the I/O data of the function block. Repeat the calling of this method for the function block to be executed until processing finishes. void Update( void Detailed description ■Parameter None. ■Return value None. ■Point • Call this method after setting the input data to the member variable. •...
  • Page 155: Mc_Power Class

    MC_Power class Changes the servo amplifier of the specified axis to an operable state. class MC_Power : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Enable Enable bool...
  • Page 156 Point • When Enable turns ON, the function block initializes the information of the specified axis. Always use this function block when using the function blocks described in this manual. • While Enable input is ON, the selected axis switches to a servo ON state. •...
  • Page 157: Mcv_Home Class

    MCv_Home class Executes home position return for the specified axis. class MCv_Home : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Execute command Execute bool...
  • Page 158 Point • This function block executes the home position return of the specified axis based on the set home position return parameters. • When Execute=ON, the function block is executed. During home position operation Busy is ON. • When processing is completed normally, Done turns ON and Busy turns OFF. •...
  • Page 159: Mc_Stop Class

    MC_Stop class Stops the specified axis. class MC_Stop : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Execute command Execute bool Startup only ON/OFF...
  • Page 160 Point • This function block stops the control of the specified axis and transitions to the Stopping state. The operation function blocks being executed are cancelled. • When Execute=ON, the function block is executed. If processing starts normally, Busy turns ON. •...
  • Page 161: Mc_Moveabsolute Class

    MC_MoveAbsolute class Specifies the absolute target position of the specified axis and executes positioning. class MC_MoveAbsolute : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Execute command Execute bool...
  • Page 162 Timing chart ■Normal completion Execute Busy Done CommandAborted Error ErrorID ■Abnormal completion Execute Busy Done CommandAborted Error ErrorID Error code Error code Value Description MMERR_FB_AXIS_ERROR An error occurred. MMERR_FB_START_NOT_POSSIBLE Positioning can not be started. MMERR_FB_AXIS_STOPPED The axis is in a Stopping state, or the stop command for the axis is ON. MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No.
  • Page 163 Point • This function block executes positioning of the specified axis to the set absolute target position. • When Execute=ON, the function block is executed. If processing starts normally, Busy turns ON. • When processing is completed and the axis completes positioning, Done turns ON. •...
  • Page 164: Mc_Moverelative Class

    MC_MoveRelative class Moves the specified distance from the current position. class MC_MoveRelative : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF* Specifies the pointer to the axis information class object.  ...
  • Page 165 Timing chart ■Normal completion Execute Busy Done CommandAborted Error ErrorID ■Abnormal completion Execute Busy Done CommandAborted Error ErrorID Error code Error code Value Description MMERR_FB_AXIS_ERROR An error occurred. MMERR_FB_START_NOT_POSSIBLE Positioning can not be started. MMERR_FB_AXIS_STOPPED The axis is in a Stopping state, or the stop command for the axis is ON. MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No.
  • Page 166 Point • This function block moves the specified distance from the current command position of the specified axis. • When Execute=ON, the function block is executed. If processing starts normally, Busy turns ON. • When processing is completed and the axis completes positioning, Done turns ON. •...
  • Page 167: Mc_Reset Class

    MC_Reset class Cancels the errors of the specified axis. class MC_Reset : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Execute command Execute bool...
  • Page 168 Point • When Execute=ON, the function block is executed. If processing starts normally, Busy turns ON. • When the cancelling of errors of the axis is completed, Done turns ON. • When execute is turned ON with the error factor of the axis still remaining, the error is not cancelled. In this case Busy stays ON.
  • Page 169: Mc_Moveadditive Class

    MC_MoveAdditive class Adds the specified relative position to the most recent positioning command of the specified axis, and executes positioning. class MC_MoveAdditive : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF* ...
  • Page 170 Error code Value Description MMERR_FB_AXIS_ERROR An error occurred. MMERR_FB_START_NOT_POSSIBLE Positioning can not be started. MMERR_FB_AXIS_STOPPED The axis is in a Stopping state, or the stop command for the axis is ON. MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No. MMERR_FB_POSITIONIG_DATA_NUMBER A value outside the range is set to the positioning data No.
  • Page 171: Mc_Movevelocity Class

    MC_MoveVelocity class Executes speed control for the specified axis at the specified speed. class MC_MoveVelocity : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Execute command Execute bool...
  • Page 172 ■Abnormal completion Execute Busy Active InVelocity CommandAborted Error ErrorID Error code Error code Value Description MMERR_FB_AXIS_ERROR An error occurred. MMERR_FB_START_NOT_POSSIBLE Positioning can not be started. MMERR_FB_AXIS_STOPPED The axis is in a Stopping state, or the stop command for the axis is ON. MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No.
  • Page 173: Mc_Torquecontrol Class

    MC_TorqueControl class Executes torque control for the specified axis at the specified torque. class MC_TorqueControl : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Execute command Execute bool...
  • Page 174 ■Abnormal completion Execute Busy Active InTorque CommandAborted Error ErrorID Error code Error code Value Description MMERR_FB_AXIS_ERROR An error occurred. MMERR_FB_START_NOT_POSSIBLE Positioning can not be started. MMERR_FB_AXIS_STOPPED The axis is in a Stopping state, or the stop command for the axis is ON. MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No.
  • Page 175: Mc_Setposition Class

    MC_SetPosition class Changes the current position (command position and feedback position) of the specified axis. class MC_SetPosition : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Execute command Execute bool...
  • Page 176 Point • When Relative is ON, the current position is changed to a position that adds the target position (relative position) to the current position. • When Relative is OFF, the current position is changed to the target position (absolute position). •...
  • Page 177: Mc_Setoverride Class

    MC_SetOverride class Changes the target speed of the specified axis. class MC_SetOverride : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Enable Enable bool...
  • Page 178 Supported version API version Software version 1.00 Inheritance hierarchy MC_FunctionBlock MC_SetOverride 5 API LIBRARY DETAILS (FUNCTION BLOCK) 5.1 MC_FunctionBlock Class...
  • Page 179: Mc_Readactualposition Class

    MC_ReadActualPosition class Reads the current position of the specified axis. class MC_ReadActualPosition : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Enable Enable bool...
  • Page 180 Timing chart ■Normal completion Enable Reading of each Decimal current value Valid Error ErrorID ■Abnormal completion Enable Reading of each current value Valid Error ErrorID Error code Error code Value Description MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No. Point •...
  • Page 181: Mc_Readstatus Class

    MC_ReadStatus class Returns the detailed state of the state diagram of the specified axis. class MC_ReadStatus : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Enable Enable bool...
  • Page 182 Timing chart ■Normal completion Enable State of Any of signals turns ON AxisStatus Valid Error ErrorID ■Abnormal completion Enable State of AxisStatus Valid Error ErrorID Error code Error code Value Description MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No. Point •...
  • Page 183: Mc_Readaxisinfo Class

    MC_ReadAxisInfo class Reads the axis information of the specified axis. class MC_ReadAxisInfo : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Enable Enable bool...
  • Page 184 Timing chart ■Normal completion Enable State of Each signal state is output each signal Valid Error ErrorID ■Abnormal completion Enable State of each signal Valid Error Error code ErrorID Error code Value Description MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No. Point •...
  • Page 185: Mc_Readaxiserror Class

    MC_ReadAxisError class Reads the error No. of the specified axis. class MC_ReadAxisError : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Enable Enable bool...
  • Page 186 Point • This function block reads the error No. and warning No. of the specified axis. • The function block is executed when Enable=ON, and the error No. and warning No. of the specified axis are read. • Read data is always updated while Valid=ON. •...
  • Page 187: Mcv_Readservoparameter Class

    MCv_ReadServoParameter class Reads the parameter value of the servo parameter No. of the specified axis. class MCv_ReadServoParameter : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Execution Execute bool...
  • Page 188 Error code Value Description MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No. MMERR_FB_OBJECT_INDEX A value outside the range is set to the object index No. MMERR_FB_READ_OR_WRITE_PARAMETER Reading or writing the parameter failed. MMERR_FB_INSTRUCTION_RUNNING Another function block is executing the instruction code. MMERR_FB_LINK_DEVICE_INACCESSIBLE Access to the link devices is disabled.
  • Page 189: Mcv_Writeservoparameter Class

    MCv_WriteServoParameter class Changes the parameter value of the servo parameter No. of the specified axis. class MCv_WriteServoParameter : public MC_FunctionBlock Member ■Input Name Variable name Data type Fetch Valid range Description Axis information Axis AXIS_REF*   Specifies the pointer to the axis information class object. Execution Execute bool...
  • Page 190 Error code Value Description MMERR_FB_AXIS_NUMBER A value outside the range is set to the axis No. MMERR_FB_OBJECT_INDEX A value outside the range is set to the object index No. MMERR_FB_READ_OR_WRITE_PARAMETER Reading or writing the parameter failed. MMERR_FB_INSTRUCTION_RUNNING Another function block is executing the instruction code. MMERR_FB_LINK_DEVICE_INACCESSIBLE Access to the link devices is disabled.
  • Page 191: Mmc_Controller Class

    MMC_Controller Class This class controls the controller. class MMC_Controller: public MMC_Master Member ■Public method Category Name Description Reference Get object GetFbAxisRef Gets the object of the axis information class used in Page 190 method the function block class. MMC_Controller::GetFbAxisRef ■Public data member Variable name Data type Initial value...
  • Page 192: Mmc_Controller::getfbaxisref

    MMC_Controller::GetFbAxisRef Gets the object of the axis information class (Motion mode) used in the function block class. unsigned long GetFbAxisRef( unsigned long axisNumber, AXIS_REF **axisRef Detailed description ■Parameter Argument Description axisNumber [in] Axis No. (1 to 16) axisRef [out] Pointer to the axis information class object pointer. ■Return value Value Description...
  • Page 193: Mmc_Controller::getfbaxisrefio

    MMC_Controller::GetFbAxisRefIo Gets the object of the axis information class (I/O mode) used in the function block class. unsigned long GetFbAxisRefIo( unsigned long stationNumber, AXIS_REF **axisRef Detailed description ■Parameter Argument Description stationNumber [in] Station No. (1 to 120) axisRef [out] Pointer to the axis information class object pointer. ■Return value Value Description...
  • Page 194: Axis_Ref Class

    AXIS_REF Class This is the axis information class used in the function block class. class AXIS_REF : public MMC_Slave Member ■Public method There is no public method. ■Public data member Variable name Data type Initial value Description FbAxisStatus short MMC_FBST_DISABLED Outputs the axis state based on the PLCopen state diagram.
  • Page 195: Axis_Ref_Motion Class

    AXIS_REF_MOTION Class This is the axis information class used in the function block class. class AXIS_REF_MOTION : public AXIS_REF Member ■Public method There is no public method. ■Public data member There is no public data member. ■Label Refer to label list for labels. (Page 203 LABEL LIST) Point •...
  • Page 196: Axis_Ref_Io Class

    AXIS_REF_IO Class This is the axis information class used in the function block class. class AXIS_REF_IO : public AXIS_REF Member ■Public method There is no public method. ■Public data member Variable name Data type Initial value Description LinkDeviceUse bool Temporarily releases link devices used in the library. Use this label only when accessing the link devices with user programs.
  • Page 197: Object Generation Functions

    Object Generation Functions MmfCreateFunctionBlock Generates function block class objects. unsigned long MmfCreateFunctionBlock( unsigned long fbID, MC_FunctionBlock **functionBlock Detailed description ■Parameter Argument Description fbID [in] Function block ID functionBlock [out] Pointer to the function block class object pointer. *1 Specify the following values for function block ID. Value Description MMC_FBID_MC_Power...
  • Page 198: Chapter 6 Structure List

    STRUCTURE LIST Refer to the following for details of the data for each structure. Simple Motion Board User's Manual (Application) Simple Motion Board User's Manual (Advanced Synchronous Control) MMST_PositioningData Structure The following are the positioning data structures used by positioning data settings. Variable name Data type Name...
  • Page 199: Mmst_Interruptparameter Structure

    MMST_InterruptParameter Structure The following are the interrupt parameter structures used by interrupt parameter settings. Variable name Data type Name IntCondition unsigned long Interrupt condition IntSensitivity unsigned long Interrupt detection timing IntOutputDataSetting unsigned long Factor details output setting IntTimeSetting unsigned long Condition for condition completion continue IntJudgeValue1 unsigned long...
  • Page 200: Mmst_Easystrokeratiocamdata Structure

    MMST_EasyStrokeRatioCamData Structure The following are the auto-generation data structures used by cam auto-generation (easy stroke ratio cam). Variable name Data type Name Resolution unsigned long [Cd.611] Cam auto-generation data Resolution CamAxisLengthPerCycle unsigned long Cam axis length per cycle CamDataStartingPoint unsigned long Cam data starting point NumberOfSections unsigned short...
  • Page 201: Chapter 7 Error Code List

    ERROR CODE LIST Common Errors Value Constant definition Occurrence cause/Remedy FFFFFFFFH MMERR_NONE An error has not occurred once. 01000001H MMERR_ARGUMENT_0 The argument is outside the set range. =1 to 9: Argument location 01000002H 01000003H 01000004H 01000005H 01000006H 01000007H 01000008H 01000009H 01000011H MMERR_TIMEOUT_0...
  • Page 202: Device Related Errors

    Value Constant definition Occurrence cause/Remedy 01010010H MMERR_WIN_CREATE_EVENT An error occurred in the CreateEvent function (Win32API). Call the GetLastError function of Win32API and confirm the error details. 01010011H MMERR_WIN_RESET_EVENT An error occurred in the ResetEvent function (Win32API). Call the GetLastError function of Win32API and confirm the error details. 01010012H MMERR_WIN_SET_EVENT An error occurred in the SetEvent function (Win32API).
  • Page 203: Dma Transmission Related Errors

    DMA Transmission Related Errors Value Constant definition Occurrence cause/Remedy 03010000H MMERR_DMA_ALREADY_START_DRIVER The DMA transmission driver is already started. 03010001H MMERR_DMA_ALREADY_END_DRIVER The DMA transmission driver is already stopped. 03010010H MMERR_DMA_NOT_START_DRIVER The DMA transmission driver is stopped. Call the StartDMA method. 03010011H MMERR_DMA_INVALID_ADDRESS The DMA destination address in incorrect.
  • Page 204 Value Constant definition Occurrence cause/Remedy 1203H MMERR_FB_START_NOT_POSSIBLE Positioning can not be started. Execute the function block again after the control in execution is completed or turning OFF the start signal. 1204H MMERR_FB_AXIS_STOPPED The axis is in a Stopping state, or the stop command for the axis is ON. Execute the function block again after changing the axis status to Standstill or turning OFF the stop command.
  • Page 205: Chapter 8 Label List

    LABEL LIST The following is a list of labels. Category Label name Data type Name MMC_Controller AxPrm MMC_EM340AxPrm[16] Parameter (Page 208 MMC_EM340AxPrm) AxMntr MMC_EM340AxMntr[16] Axis monitor data (Page 209 MMC_EM340AxMntr) SysMntr1 MMC_EM340SysMntr1 System monitor data (Page 211 MMC_EM340SysMntr1) AxCtrl1 MMC_EM340AxCtrl1[16] Axis control data (Page 211 MMC_EM340AxCtrl1) SysCtrl...
  • Page 206 Category Label name Data type Name MMC_Controller StartHistory MMC_EM340StartHistory Start history (Page 221 MMC_EM340StartHistory) Interrupt MMC_EM340Interrupt Interrupt (Page 221 MMC_EM340Interrupt) OptionalBitMntr MMC_EM340OptionalBitMntr Optional bit monitor (Page 222 MMC_EM340OptionalBitMntr) AllAxMntr MMC_EM340AllAxMntr All axes monitor (Page 222 MMC_EM340AllAxMntr) DirectCtrl MMC_EM340DirectCtrl Direct control (Page 222 MMC_EM340DirectCtrl) CamOperation MMC_EM340CamOperation...
  • Page 207 Category Label name Data type Name MMC_Axis Ready bool R: READY SynchronizationFlag bool R: Synchronization flag Busy bool R: BUSY PositioningStart bool RW: Positioning start ControllerInPositionRange unsigned short RW: [Pr.1190] Controller in- position range ControllerInPositionFlag unsigned short R: [Md.1190] Controller in- position flag SynchronousControlStart bool...
  • Page 208 Category Label name Data type Name MMC_J4GF LinkDevCHGBit MMC_EM340LinkDevCHGBit Link device external signal (Page 228 MMC_EM340LinkDevCHGBit) assignment parameters (bit device) LinkDevCHGWord MMC_EM340LinkDevCHGWord Link device external signal (Page 232 MMC_EM340LinkDevCHGWord) assignment parameters (word device) ServoObject MMC_EM340ServoObject Servo object specification area (Page 232 MMC_EM340ServoObject) SlaveMonitor MMC_EM340SlaveMonitor Monitor data for slave device...
  • Page 209 Category Label name Data type Name AXIS_REF_MOTION SynchronousControlStart bool RW: [Cd.380] Synchronous control start SynchronousControlAnalysisMode bool RW: [Cd.381] Synchronous control analysis mode FLS_OperationDevice bool RW: [Cd.44] External input signal operation device: Upper limit signal (FLS) RLS_OperationDevice bool RW: [Cd.44] External input signal operation device: Lower limit signal (RLS) DOG_OperationDevice...
  • Page 210 MMC_EM340AxPrm Label name Data type Name Unit unsigned short RW: [Pr.1] Unit setting UnitMagnification unsigned short RW: [Pr.4] Unit magnification (AM) PulsesPerRotation unsigned long RW: [Pr.2] Number of pulses per rotation (AP) MovementAmountPerRotation unsigned long RW: [Pr.3] Movement amount per rotation (AL) BiasSpeed unsigned long RW: [Pr.7] Bias speed at start...
  • Page 211 Label name Data type Name SpdTrq_Operation unsigned short RW: [Pr.90] Operation setting for speed-torque control mode HomingMethod unsigned short RW: [Pr.43] Home position return method HomingDirection unsigned short RW: [Pr.44] Home position return direction HomePosition long RW: [Pr.45] Home position address HomingSpeed unsigned long RW: [Pr.46] Home position return speed...
  • Page 212 Label name Data type Name Status_PositioningStart bool R: [Md.31] Status Start complete Status_PositioningComplete bool R: [Md.31] Status Positioning complete TargetPosition bool R: [Md.32] Target value TargetSpeed unsigned long R: [Md.33] Target speed MPG_CarryoverMovementAmount long R: [Md.62] Manual pulse generator operation carry- over amount of movement ForwardTorqueLimit unsigned short...
  • Page 213 Label name Data type Name Statusword unsigned short R: [Md.117] Statusword SemiFullyClosedLoopStatus unsigned short R: [Md.113] Semi/Fully closed loop status ServoAlarm unsigned short R: [Md.114] Servo alarm ReverseTorqueLimit unsigned short R: [Md.120] Reverse torque limit stored value SpeedDuringCommand long R: [Md.122] Speed during command TorqueDuringCommand short R: [Md.123] Torque during command...
  • Page 214 Label name Data type Name PV_NewSpeed unsigned long RW: [Cd.25] Position-speed switching control speed change register EnablePV_Switching unsigned short RW: [Cd.26] Position-speed switching enable flag TargetNewPosition long RW: [Cd.27] Target position change value (New address) TargetNewSpeed unsigned long RW: [Cd.28] Target position change value (New speed) ChangeTargetPosition unsigned short...
  • Page 215 MMC_EM340SysCtrl Label name Data type Name WriteFlashRom unsigned short RW: [Cd.1] Flash ROM write request InitializeParameter unsigned short RW: [Cd.2] Parameter initialization request DecelerationFlagValid unsigned short RW: [Cd.41] Deceleration start flag valid DecelerationStopMode unsigned short RW: [Cd.42] Stop command processing for deceleration stop selection SwitchAmplifierLessMode unsigned short...
  • Page 216 Label name Data type Name Axis10_STOP bool RW: Axis 10 Stop signal (STOP) Axis11_FLS bool RW: Axis 11 Upper limit signal (FLS) Axis11_RLS bool RW: Axis 11 Lower limit signal (RLS) Axis11_DOG bool RW: Axis 11 Proximity dog signal (DOG) Axis11_STOP bool RW: Axis 11 Stop signal (STOP)
  • Page 217 MMC_EM340BlockStartData Label name Data type Name StartBlock MMC_EM340StartBlock[5] Start block (Page 215 MMC_EM340StartBlock) MMC_EM340StartBlock Label name Data type Name StartData MMC_EM340StartData Start data (Page 215 MMC_EM340StartData) ConditionData MMC_EM340ConditionData[10] Condition data (Page 215 MMC_EM340ConditionData) MMC_EM340StartData Label name Data type Name Shape_StartDataNo unsigned short[50] RW: [Da.11] Shape, [Da.12] Start data No.
  • Page 218 MMC_EM340SvInpAxMntr Label name Data type Name CommandPosition long R: [Md.300] Servo input axis current value Speed long R: [Md.301] Servo input axis speed PhaseCompensationAmount long R: [Md.302] Servo input axis phase compensation amount RotationRestrictionAmount long R: [Md.303] Servo input axis rotation direction restriction amount MMC_EM340SyncEncAxPrm Label name...
  • Page 219 Label name Data type Name Status_ConnectingValid bool R: [Md.325] Synchronous encoder axis status Connecting valid flag Status_CounterEnable bool R: [Md.325] Synchronous encoder axis status Counter enable flag Status_CurrentValueSetRequest bool R: [Md.325] Synchronous encoder axis status Current value setting request flag Status_Error bool R: [Md.325] Synchronous encoder axis status Error...
  • Page 220 Label name Data type Name AuxShaftClutchSmoothTimeConstant unsigned short RW: [Pr.429] Auxiliary shaft clutch smoothing time constant AuxShaftClutchOnSlipAmount unsigned long RW: [Pr.430] Slippage at auxiliary shaft clutch ON AuxShaftClutchOffSlipAmount unsigned long RW: [Pr.431] Slippage at auxiliary shaft clutch OFF SpeedChangeGear unsigned short RW: [Pr.434] Speed change gear SpeedChangeGearSmoothTimeConstant unsigned short...
  • Page 221 Label name Data type Name AuxShaftClutchAccumulativeSlippage long R: [Md.425] Auxiliary shaft clutch slippage (accumulative) MMC_EM340SyncAxCtrl Label name Data type Name CommandMainShaftClutch unsigned short RW: [Cd.400] Main shaft clutch command CommandMainShaftClutchInvalid unsigned short RW: [Cd.401] Main shaft clutch control invalid command CommandMainShaftClutchForcedOff unsigned short RW: [Cd.402] Main shaft clutch forced OFF command...
  • Page 222 MMC_EM340MarkSignalPrm Label name Data type Name CompensationTime short RW: [Pr.801] Mark detection signal compensation time Type short RW: [Pr.802] Mark detection data type AxisNo unsigned short RW: [Pr.803] Mark detection data axis No. BufferMemoryNo unsigned long RW: [Pr.804] Mark detection data buffer memory No. LatchDataRangeUpperLimit long RW: [Pr.805] Latch data range upper limit value...
  • Page 223 MMC_EM340PositDataEle2 Label name Data type Name InterpolationAxis unsigned long RW: Axis to be interpolated [Da.20] Axis to be interpolated No.1 [Da.21] Axis to be interpolated No.2 [Da.22] Axis to be interpolated No.3 MMC_EM340StartHistory Label name Data type Name Info MMC_EM340Info Start history information (Page 221 MMC_EM340Info) Data...
  • Page 224 MMC_EM340InterruptMntr Label name Data type Name IntFactorOut unsigned short[4] R: [Md.1100] During interrupt factor output IntFactor unsigned long[2] R: [Md.1101] Interrupt factor IntFactorDetail unsigned long[64] R: [Md.1102] Interrupt factor details MMC_EM340OptionalBitMntr Label name Data type Name OptionalBitMntrPrm MMC_EM340OptionalBitMntrPrm[2] Optional bit monitor output parameter (Page 222 MMC_EM340OptionalBitMntrPrm) OptionalBitMntrData MMC_EM340OptionalBitMntrData...
  • Page 225 MMC_EM340DirectCtrlPrm Label name Data type Name UseBufferNumber unsigned short RW: [Pr.1210] Direct control number of used buffers MMC_EM340DirectCtrlMntr Label name Data type Name OperationStatus short R: [Md.1210] Direct control operation status EnableFlag unsigned short R: [Md.1211] Direct control enable flag CurrentBufferNumberPos unsigned short R: [Md.1212] Direct control buffer No.
  • Page 226 MMC_EM340UserWatchDog Label name Data type Name StartCounter unsigned short RW: [Cd.1140] Watchdog timer start counter CheckCounter unsigned short RW: [Cd.1141] Watchdog check counter Timer unsigned short R: [Md.1140] Watchdog timer MMC_EM340ControllerInPosition Label name Data type Name Range unsigned short[16] RW: [Pr.1190] Controller in-position range Flag unsigned short[16] R: [Md.1190] Controller in-position flag...
  • Page 227 MMC_EM340TimeSetting Label name Data type Name StartupTime unsigned long RW: [Pr.1160] Startup time MMC_EM340SyncEncAxPrmViaLinkDev Label name Data type Name SyncEncAx MMC_EM340LinkDevCHGWordInfoSync Synchronous encoder axis (Page 225 MMC_EM340LinkDevCHGWordInfoSync) SyncEncStartReq MMC_EM340LinkDevInfoSyncEnc Synchronous encoder axis start request (Page 225 MMC_EM340LinkDevInfoSyncEnc) MMC_EM340LinkDevCHGWordInfoSync Label name Data type Name Type...
  • Page 228 MMC_EM340IEFieldInfo Label name Data type Name bool[16384] R: RX area bool[16384] RW: RY area unsigned short[1024] R: RX area (for word access) unsigned short[1024] RW: RY area (for word access) dwRX unsigned long[512] R: RX area (for double word access) dwRY unsigned long[512] RW: RY area (for double word access)
  • Page 229 MMC_EM340StationInfoOwn Label name Data type Name Val_CardInfo MMC_EM340CardInfoOwn Network card information (Page 227 MMC_EM340CardInfoOwn) Val_ControllerInfo MMC_EM340ControllerInfoOwn Controller information (Page 227 MMC_EM340ControllerInfoOwn) MMC_EM340CardInfoOwn Label name Data type Name Val_ManufacturerCode unsigned short R: Manufacturer code (Own station) Val_ModelType unsigned short R: Model type (Own station) Val_ModelCode unsigned short R: Model code (Own station)
  • Page 230 MMC_EM340LinkDevCHGBit Label name Data type Name MMC_EM340LinkDevInfoEMI Forced stop signal (EMI) (Page 228 MMC_EM340LinkDevInfoEMI) MMC_EM340LinkDevInfoFLS Upper limit signal (FLS) (Page 229 MMC_EM340LinkDevInfoFLS) MMC_EM340LinkDevInfoRLS Lower limit signal (RLS) (Page 229 MMC_EM340LinkDevInfoRLS) MMC_EM340LinkDevInfoDOG Proximity dog signal (DOG) (Page 229 MMC_EM340LinkDevInfoDOG) STOP MMC_EM340LinkDevInfoSTOP Stop signal (STOP) (Page 229 MMC_EM340LinkDevInfoSTOP) PositStartReq...
  • Page 231 MMC_EM340LinkDevInfoFLS Label name Data type Name Type unsigned short RW: [Pr.910] Upper limit signal (FLS): Link device type FirstNo unsigned short RW: [Pr.911] Upper limit signal (FLS): Link device start BitSpecification unsigned short RW: [Pr.912] Upper limit signal (FLS): Link device bit specification LogicSetting unsigned short...
  • Page 232 MMC_EM340LinkDevInfoChangeSpeed Label name Data type Name Type unsigned short RW: [Pr.960] External speed change request: Link device type FirstNo unsigned short RW: [Pr.961] External speed change request: Link device start No. BitSpecification unsigned short RW: [Pr.962] External speed change request: Link device bit specification LogicSetting unsigned short...
  • Page 233 MMC_EM340LinkDevInfoBlock7000 Label name Data type Name Type unsigned short RW: [Pr.1020] Block No.7000 start request: Link device type FirstNo unsigned short RW: [Pr.1021] Block No.7000 start request: Link device start No. BitSpecification unsigned short RW: [Pr.1022] Block No.7000 start request: Link device bit specification LogicSetting unsigned short...
  • Page 234 MMC_EM340LinkDevCHGWord Label name Data type Name MMC_EM340LinkDevCHGWordInfoMPG Manual pulse generator input (Page 232 MMC_EM340LinkDevCHGWordInfoMPG) MMC_EM340LinkDevCHGWordInfoMPG Label name Data type Name Type unsigned short RW: [Pr.700] Manual pulse generator input: Link device type FirstNo unsigned short RW: [Pr.701] Manual pulse generator input: Link device start No.
  • Page 235 MMC_EM340SlaveControl Label name Data type Name SvPrmReq unsigned short RW: [Cd.120] Servo parameter operation request Size unsigned short RW: [Cd.121] Parameter size Offset unsigned short RW: [Cd.122] Parameter offset ReqData unsigned short[1024] RW: [Cd.125] Request data RestorationReq unsigned short RW: [Cd.126] Controller current value restoration request ABSLostDesignation unsigned short...
  • Page 236 MMC_EM340RotaryCutter Label name Data type Name Resolution unsigned long RW: [Cd.607] Cam data value Resolution Option unsigned short RW: [Cd.607] Cam data value Auto-generation option SyncSectionAccelerationRatio short RW: [Cd.607] Cam data value Synchronous section acceleration ratio SheetLength unsigned long RW: [Cd.607] Cam data value Sheet length SheetSyncWidth unsigned long RW: [Cd.607] Cam data value Sheet synchronization...
  • Page 237 MMC_EM340DetailsSection Label name Data type Name CurveType unsigned short RW: [Cd.607] Cam data value Cam curve type EndPoint unsigned long RW: [Cd.607] Cam data value End point Stroke long RW: [Cd.607] Cam data value Stroke CurveScopeP1 unsigned short RW: [Cd.607] Cam data value Curve applicable range (P1) CurveScopeP2 unsigned short...
  • Page 238 MMC_EM340SimpleStrokeAuto Label name Data type Name Resolution unsigned long RW: [Cd.611] Cam auto-generation data Resolution CamAxisLengthPerCycle unsigned long RW: [Cd.611] Cam auto-generation data Cam axis length per cycle StartingPoint unsigned long RW: [Cd.611] Cam auto-generation data Cam data starting point SectionNum unsigned short RW: [Cd.611] Cam auto-generation data Number of...
  • Page 239 MMC_EM340Ethernet Label name Data type Name EthernetPrm MMC_EM340EthernetPrm Ethernet communication parameter (Page 237 MMC_EM340EthernetPrm) EthernetCmd MMC_EM340EthernetCmd Ethernet communication command (Page 237 MMC_EM340EthernetCmd) EthernetMntr MMC_EM340EthernetMntr Ethernet communication monitor (Page 237 MMC_EM340EthernetMntr) MMC_EM340EthernetPrm Label name Data type Name IP_Address unsigned long RW: [Pr.1170] IP address SubnetMask unsigned long RW: [Pr.1171] Subnet mask...
  • Page 240: Appendices

    APPENDICES Appendix 1 Hierarchy Charts for Each Class The hierarchy charts for the classes used by the API library are shown below. Network module class MMC_NetworkModule MMC_Master MMC_Controller MMC_CcieController MMC_EM340GF MMC_Slave MMC_Axis MMC_CcieSlaveAxis MMC_J4GF MMC_Io MMC_CcieSlaveIo MMC_SyncEncoder MMC_CcieSyncEncoder AXIS_REF AXIS_REF_MOTION AXIS_REF_IO APPX Appendix 1 Hierarchy Charts for Each Class...
  • Page 241 Function black class MC_FunctionBlock MC_Power MCv_Home MC_Stop MC_MoveAbsolute MC_MoveRelative MC_Reset MC_MoveAdditive MC_MoveVelocity MC_TorqueControl MC_SetPosition MC_SetOverride MC_ReadActualPosition MC_ReadStatus MC_ReadAxisInfo MC_ReadAxisError MCv_ReadServoParameter MCv_WriteServoParameter APPX Appendix 1 Hierarchy Charts for Each Class...
  • Page 242 Label class MMC_Label MMC_LabelLongReadOnly MMC_LabelLong MMC_LabelULongReadOnly MMC_LabelULong MMC_LabelShortReadOnly MMC_LabelShort MMC_LabelUShortReadOnly MMC_LabelUShort MMC_LabelCharReadOnly MMC_LabelChar MMC_LabelUCharReadOnly MMC_LabelUChar MMC_LabelBoolReadOnly MMC_LabelBool Device driver class MMC_DeviceDriver MMC_PciDevice MMC_PciWindows APPX Appendix 1 Hierarchy Charts for Each Class...
  • Page 243: Appendix 2 Restrictions By The Version

    Appendix 2 Restrictions by the version There is a restriction in the function that can be used by the API version. Function/Item Software version API version Description Function block  Ver.1.10 MR-J4-GF I/O mode Direct control Ver.02 Ver.1.10 Direct control is supported. SLMP communication function Ver.03 Ver.1.30...
  • Page 244: Index

    INDEX ..... . 192 ... . .133 AXIS_REF Class MakeAdvancedStrokeRatioCam .
  • Page 245 ....197 MMST_InterruptData ....197 MMST_InterruptParameter .
  • Page 246: Revisions

    Japanese manual number: IB-0300329-D 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 247: Warranty

    6. Failure caused by reasons unpredictable by scientific technology standards at time of shipment from Mitsubishi. 7. Any other failure found not to be the responsibility of Mitsubishi or that admitted not to be so by the user. 2. Onerous repair term after discontinuation of production (1) Mitsubishi shall accept onerous product repairs for seven (7) years after production of the product is discontinued.
  • Page 248: 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 Ethernet is a registered trademark of Fuji Xerox Co., Ltd. in Japan.
  • Page 250 IB(NA)-0300330-D(2401)MEE MODEL: EM340-U-API-E MODEL CODE: 1XB054 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