Application Note

Executing an MCode program over EtherNet/IP

Description

There are instances where it may be desirable to execute and MCode script over EtherNet/IP. This application note explains the process.

Topics

  • EtherNet/IP
  • Ethernet TCP/IP
  • MCode OS

Applicable Product

  • Lexium MDrive

Requirements

Resource Files

Details

Allowing resident MCode program scripts to function in protocol EtherNet/IP with Lexium MDrive Ethernet devices that include TCP/IP application version 2.3.0.3 and up, is now available.

Lexium MDrive Ethernet TCP/IP Configuration Utility contains an “E.I.P.” tab with a frame in the lower left-hand corner labeled “I/O Implicit connection test”. Two Boolean entities are described as follows on their function regarding the enabling of resident program operation with EIP.

To allow resident MCode program scripts to run:

  1. Turn off I/O implicit writes.
    • If ‘Halt Motion’ is ON, an ‘EX 1’ will be issued on every valid EIP implicit I/O connection and an ‘Esc’ will be issued on an I/O connection lost.
    • If ‘Halt Motion’ is OFF, then no ‘EX 1’ or ‘Esc’ commands are issued allowing an ‘SU’ label to be used in an MCode script.
  2. Observe the following closely in your MCode script to be executed via EIP:
    • Always use “H 1000” on the first line following all “SU” labels or methods residing @ address “1”.
    • Do not use or save any “PR”, “L” or “EM” mnemonics in resident programs or saved parameter statements.The following additions have been added to the explicit EIP class 0x64
  3. The following additions have been added to the explicit EIP class 0x64:
    Access Class Instance Attrib Data type Mnemonic
    WO 0x64 0x01 0x06 MDRV_STRING EX
    RO 0x64 0x01 0x07 MDRV_BIT BY
    RW  0x64 0x01 0x08 MDRV_I32 V1
    RW 0x64 0x01 0x09 MDRV_I32 V2
    RW 0x64 0x01 0x0A MDRV_I32 V3
    RW 0x64 0x01 0x0B MDRV_I32 V4
    RW  0x64 0x01 0x0C MDRV_I32 V5
    RW 0x64 0x01  0x0D  DRV_I32 V6
    RW 0x64 0x01  0x0E MDRV_I32  V7
    RW 0x64 0x01 0x0F MDRV_I32 V8

    Note variables V1 through V8 need to be defined as user variables in order to be utilized.