Library Reference Revision Author Date + Support MX2_Control_Serial 2.1 JP Viskovic 26/03/2019 http://support-omron.fr/ OMRON OMRON ELECTRONICS S.A.S. 14 Rue de Lisbonne 93561 Rosny-sous-Bois cedex NX1P2 controlling MX2 invertor through Modbus RTU serial connection Function File Controller Symbol Principe Control up to 32 MX2 inverters through RS485 line MX2_Control_Serial.slr Sample program : Sample_MX2_Control_Serial.csm2 NX1P2 with serial option NX1W-CIF11/12 The MX2_Control_Serial Function block allow to control up to 32 MX2 inverters through RS-422 or RS-485 using Modbus RTU protocol. Structure MX2_Ctrl allow for each slave : - to specify the frequency reference, reverse direction - to execute RUN / STOP command individually or to every slave (broadcast) - to read/write parameters Structure MX2_Status return for each slave : - status RUN, ERR - Communication error - Output frequency and current - Default code Input STOP_ALL and RUN_ALL send one command to all slave using a broadcast request. The command STOP_ALL will interrupt any process to send the command. Instead of RUN_ALL the command MX2_Ctrl.RUN_Cmd will send the frequency and the reverse dir. Parameters before sending the RUN command to each slaves. Thus, invertor will not start at same time. MX2_Control_Serial library Controlling MX2 through Modbus RTU MX2_Ctrl.RUN_Cmd should be used every time when inverters are powered ON. The serial communication mode of NX1W-CIF should be set to Modbus-RTU Master The input variable DevicePort.OptBoard should be linked to the logical address of the NX1W-CIFbloc using the NodeLocationInformation provided by the I/O Mao. To obtain the NodeLocationInformation : - Right-click on NX1W-CIF12 item - Create a variable name (i.e. NodeLocationInfo) Then, specify following information in your project : JPV 26/03/2019 Page 2/9 MX2_Control_Serial library Configuration Controlling MX2 through Modbus RTU Dip switch on the back of the NX1W-CIF should be set according to your configuration. RS485 configuration Wiring MX2 Configuration Utilization Manual JPV Parameter A001 A002 C071 function Frequency source RUN command source speed C072 C074 Modbus slave N° Parity C075 C077 Stop Bit communications watchdog timer period value 03 : Modbus 03 : Modbus 03 : 2400 bps 04 : 4800 bps 05 : 9600 bps 06 : 19.2 kbps 07 : 38.4 kbps 08 : 57.6 kpbs 09 : 76.8 kpbs 10 : 115.2 kpbs 01 à 32 00 : one 01 : even 02 : odd 1 ou 2 Frequency, current and status information are refreshed only if the inverter slave number bit is set to ON in the ScanList (MX2Ctrl.Scanlist[slaveNo]) MX2 Inverter I570 User manual 26/03/2019 Page 3/9 MX2_Control_Serial library Controlling MX2 through Modbus RTU Function Block MX2_Control_Serial Input Variables Name Execute DevicePort MX2_Ctrl Timeout Type BOOL _sDEVICE_PORT DeviceType OptBoard PortNo _sMX2_Ctrl UINT Retry WaitTime values OFF-ON Function ON = FB execution _DeviceOptionBoard NodeLocationInfo 1 Device type designation Loc. information from I/O map Serial port (unique on NX1W-CIF) 0-9999 Delay before rising the MX2_Ctrl.COMM_Err flag ex : UINT#5 to UINT#20 (500ms to 2s) Max Retry number to read/write lecture/écriture max (in case of error) ex : UINT#2 Delay between requests Ex : T#20ms to T#30ms USINT 0-9999 TIME 0-9999 Note : It is advisable to allow a short delay between the exchanges (waitTime) to avoid that a request of the master is contiguous to the previous answer. In the same way, parameter C078 of the MX2 drives allows to add a delay before sending the response. The WaitTime delay is related to the chosen transmission rate. At 9600bps, select a delay between 20 and 30ms. Input/output Variable Nom MX2_Ctrl Type _sMX2_Ctrl _sMX2_Ctrl Structure ScanList BOOL[1-32] Rev_Direction BOOL[1-32] RUN_Cmd BOOL[1-32] STOP_Cmd BOOL[1-32] ClearErr_Cmd BOOL[1-32] Frequency UINT[1-32] Freq_Cmd BOOL[1-32] Acceleration UINT[1-32] ACC_Cmd BOOL[1-32] Deceleration UINT[1-32] DEC_Cmd BOOL[1-32] RUN_All BOOL STOP_All BOOL Timeout UINT Parameter UINT SetValue UINT WriteParam BOOL ReadParam BOOL SlaveTargeted UINT JPV value Structure Function MX2 Control Command Slave status to be read Reverse direction RUN command STOP command Error clear command Bit 1 = slave 1 Frequency Bit 32= slave 32 Frequency ref write command Acceleration Acc write command Deceleration Dec write command RUN all MX2 simultaneously (broadcast) STOP all MX2 simultaneously (broadcast) Timeout delay (all slaves) Parameter address to read/write Read/Write value Write command Read command Slave destination of the read/write command 26/03/2019 Page 4/9 MX2_Control_Serial library Controlling MX2 through Modbus RTU WARNING ! The command bits are reset when the command has been executed. Be careful not to force the bit continuously otherwise the status reading will no longer be performed. Example of Start/Stop command: Output Variables Nom ENO MX2_Status Error LastErrorID LastSlaveInErr LastMdb_Exception Type BOOL _sMX2_Status BOOL WORD UINT WORD _sMX2_Status Structure RUN BOOL[1-32] Comm_Err BOOL[1-32] ERR BOOL[1-32] StatusCode UINT[1-32] valeurs OFF-ON structure OFF-ON 0-FFFF 1-32 01-22 Fonction ON = FB execution Inverter status Execution error on R/W instruction Last execution error Last slave in error Last Modbus exception sent by the slave. 01, 02 : function not supported 03 : incorrect format 21 : Register address error 22 : no access in RUN or ERR mode Inverter in RUN mode Communication error Slave response error Inverter status Bit 1=slave 1 Bit 32=slave 32 FreqOutput FaultCode FaultStatus MultiFuncInput JPV UINT[1-32] UINT[1-32] UINT[1-32] UINT[1-32] Output frequency MX2 Default Code(see below) Status when fault occurred Status of Multifunction inputs 26/03/2019 Page 5/9 MX2_Control_Serial library Controlling MX2 through Modbus RTU List of inverter trip factors (FaultCode) JPV 26/03/2019 Page 6/9 MX2_Control_Serial library Controlling MX2 through Modbus RTU IAG MX2_Control_Serial Function File HMI Preview Condition of use Display the status of MX2 inverters (max 32) MX2_Control_Serial.iag Sample program : Sample_MX2_Control_Serial.csm2 NA5 series The IAG MX2_Console should be used with the function block provided in the NX library MX2_Control_Serial.slr IAG integration in the project : 1- In I/O mapping, create NA variables corresponding to NX variables 1- Allocate these variables to the l’IAG (in window Properties) Restrictions JPV MX2 status are displayed as soon as declared in the ScanList of MX2_Control_Serial. 26/03/2019 Page 7/9 MX2_Control_Serial library Controlling MX2 through Modbus RTU IAG MX2_Console Function File HMI Preview Display a monitoring console MX2_Control_Serial.iag NA5 series Condition of use The IAG MX2_Console_Serial should be used with the function block provided in the NX library MX2_Control_Serial.slr. IAG integration in the project : 2- In I/O mapping, create NA variables corresponding to NX variables 3- Allocate these variables to the l’IAG (in window Properties) JPV 26/03/2019 Page 8/9 MX2_Control_Serial library Restrictions Controlling MX2 through Modbus RTU Frequency, current, Multifunction input & status of the selected MX2 will be refresh as soon as it has been declared in the ScanList of MX2_Control_Serial. The All slaves option allow to start/stop all inverters at same time. Write parameter will also be applied to all slaves (broadcast). When All slaves is selected, the RUN command offer two options: - Write frequency and send RUN command to each MX2 inverter (after a power restart, frequency reference is cleared) - RUN all invertor (1 to 32) using a unique broadcasted command. IAG should have same main version number than the NX1P library. JPV 26/03/2019 Page 9/9