ReadMC
The ReadMC function creates an SLMP connection to the Mitsubishi PLC and Motion Controller (MC), and sends a Batch Read command using a 3E QnA compatible or a 1E A compatible Binary frame to receive data from the PLC/MC.
ReadMCInputs
Syntax: ReadMC(Event,Host Name,Port,PLC Series,Device Address,Timeout,Buffer)
Parameter | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Specifies the update event on which to readdata. This parameter must be a reference to one of the following:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the IP address of the Mitsubishi PLC/MC from which data is read. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the TCP port number, in hexadecimal, of the SLMP server which is open on the MELSEC EtherNet module. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the message frame that the data packet will be encapsulated.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the memory location of the Mitsubishi PLC/MC from which data is read.The available Device Addresses and the Formats vary, depending on the PLC Series type (iQ-F/R/Q/L Series or FX Series) specified in the PLC Series input.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies the amount of time, in milliseconds(5 to 30000; default = 1000ms), that the functionwill attempt to transmit data before execution is halted and an #ERRis 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.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Specifies a referenced Buffer structurecreated 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 or iQ-F/R/Q/L 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 containingthe data sent by the Mitsubishi PLC/MC; or #ERR if any input parameters are invalidor a connection from the Mitsubishi PLC/MC has not been established. |
Results |
Data in the structure isaccessed using the GetBufferDatafunction.For more information, see Input/Output. |