WriteMC

The WriteMC function creates an SLMP connection to the Mitsubishi PLC and Motion Controller (MC), and sends a Batch Write command using a 3E QnA compatible or a 1E A compatible Binary frame to write data from the PLC/MC.

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.

WriteMCInputs

Syntax: WriteMC(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 to which data is written.

Port

Specifies the port number 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 PLC to which data is written.

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.

Buffer

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

Note: When iQ-R/Q/L Series, iQ-F Series, iQ-F/R/Q/L Series or CR800-D 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.

WriteMCOutputs

Returns

The number of elements written or #ERR if an input parameter is invalid.