ReadMC

The ReadMC function creates an SLMP connection to the Mitsubishi Automation Controller, and sends a Batch Read command using a 3E QnA compatible or a 1E A compatible Binary frame to receive data from the Automation Controller.

Note:
  • In this topic, PLC/MC and Robot Controllers are referred as "Automation Controller".
  • The In-Sight 2000 series vision sensor does not support robot controllers.
  • When an In-Sight vision system is configured to communicate with a Automation Controller over SLMP, the protocol only supports the transfer of data between the vision system and the Automation Controller.

ReadMCInputs

Syntax: ReadMC(Event,Host Name,Port,PLC Series,Device Address,Timeout,Buffer)

Parameter Description

Event

Specifies the update event on which to read data. This parameter must be a reference to one of the following:

  • The Image data structure in cell A0, containing the AcquireImage function. For more information, see AcquireImage.
  • A cell containing an Event function. For more information, see Event.
  • A cell containing a Button function. For more information, see Button.

Host Name

Specifies the IP address of the Mitsubishi Automation Controller from which data is read.

Port

Specifies the TCP port number, in hexadecimal, of the SLMP server which is open on the MELSEC EtherNet module.

PLC Series

Specifies the message frame that the data packet will be encapsulated.

Note: The In-Sight 2000 series vision sensor does not support CR800-D Series (3E Frame).
  • In-Sight Firmware Version 5.x.x:

    0 = iQ-R/Q/L Series (3E Frame)

    Uses the QnA compatible 3E frame to send a Batch Read command.

    1 = FX Series (1E Frame)

    Uses the A compatible 1E frame to send a Batch Read command.

    2 = iQ-F Series (3E Frame) Uses the QnA compatible 3E frame to send a Batch Read command.
    3 = CR800-D Series (3E Frame) Uses the QnA compatible 3E frame to send a Batch Read command.
  • In-Sight Firmware Version 4.x.x

    0 = iQ-F/R/Q/L Series (3E Frame)

    Uses the QnA compatible 3E frame to send a Batch Read command.

    1 = FX Series (1E Frame)

    Uses the A compatible 1E frame to send a Batch Read command.

Device Address

Specifies the memory location of the Mitsubishi Automation Controller from which data is read. The available Device Addresses and the Formats vary, depending on the Automtion Controller Series type (iQ-F/R/Q/L Series, FX Series or CR-80D Series) specified in the PLC Series input.

  • iQ-R/Q/L Series, iQ-F Series or iQ-F/R/Q/L Series (3E Frame):

    Note: The ZR (File Register) device type is not supported on the iQ-F Series.
    Device Address Description Format
    Xhhhhhh* Input Relay Bit
    Yhhhhhh Output Relay Bit
    Mdddddd* Internal Relay Bit
    Ldddddd Latch Relay Bit
    Fdddddd Annunciator Bit
    Bhhhhhh Link Relay Bit
    Ddddddd Data Register Word
    Whhhhhh Link Register Word
    Rdddddd File Block Register Word
    ZRhhhhhh File Register Word
    TNdddddd Timer Value Word
    CNdddddd Counter Value Word
    * "hhhhhh" = hex address and "dddddd" = decimal address.
  • FX Series (1E Frame)

    Device Address Description Format
    Xoooooo* Input Relay Bit
    Yoooooo Output Relay Bit
    Mdddddd* Internal Relay Bit
    Ddddddd Data Register Word
    Rdddddd Extension Register Word
    Sdddddd State Relay Bit
    * "oooooo" = oct address and "dddddd" = decimal address.
  • CR-800D Series

    Device Address Description Format
    Ddddddd* Data Register Word
    * "dddddd" = decimal address.

Timeout

Specifies the amount of time, in milliseconds(5 to 30000; default = 1000ms), that the function will attempt to transmit data before execution is halted and an #ERR is returned.

Note: The Timeout may potentially add time to the job; in the event that both the read and write operations were to fail, the amount of time added to the job would be twice the Timeout value, since both operations Timeout value would aggregate.

Buffer

Specifies a referenced Buffer structure created by the FormatInputBuffer function, which defines how the received data is interpreted. For more information, see FormatInputBuffer.

Note: When iQ-R/Q/L Series, iQ-F Series, iQ-F/R/Q/L Series or CR-800D Series is the selected PLC Series, the total maximum length for input data is 1920 bytes. .When FX Series is the selected PLC Series, the total maximum length for input data is 128 bytes.

ReadMCOutputs

Returns

A data structure containing the data sent by the Mitsubishi Automation Controller; or #ERR if any input parameters are invalid or a connection from the Mitsubishi Automation Controller has not been established.

Results

Data in the structure is accessed using the GetBufferData function. For more information, see Input/Output.