Welcome to PLC library!
Develop and collect PLC function blocks,verify them in actual engineering projects
1200/1500 Call MCDLL FB Ethernet Read and write Mitsubishi PLC
Source:PLC Library | Author:PLCLibrary | Published time: 2022-01-07 | 1618 Views | Share:

This function block is suitable for  TIA V15.0. programming. 1200/1500 PLC  call this function block can communicate with Mitsubishi q series, R series and fx5u PLC. This function block is similar to DLL library file of C#.

This function block implements MC 3E and SLmP protocols. 1200/1500 PLC  call this mcdll function block can freely read and write internal variables of Mitsubishi PLC.

After calling this function block, the gateway between Siemens PLC and Mitsubishi PLC will no longer be needed. Only the ethernet switch needs to connect the built-in Ethernet port of the PLC. The two PLCs need to be in the same network segment.

This mcdll function block is based on standard Ethernet,According the ISO / TCP IP model. It belongs to the same level as Modbus TCP, and its real-time performance and speed are equal to Modbus TCP. When the PLC scanning cycle is set to 2ms, the communication speed is about 4ms, but generally it does not need to be so fast. The default setting of the program is  10ms-20ms.

Siemens 1511-1pn and Mitsubishi q series built-in Ethernet CPU and fx5u are used for the test.

Using Siemens 1200 and 1500 integrated Ethernet interfaces CPU , you only need to set the IP address, no other settings need.


 FX5U named this protocol SLMP,It compatible with MC proprotocol,The parameter for FX5U set like below:


QCPU named this protocol MCwhen Q PLC connect the partner with MC protocol var the integrate ethernet port ,Parameter setting like below:

when you use Q PLC and the communication speed set in 3-4ms,you must set Q PLC coummnication time at least 30% of cycle time,otherwise,Q CPU will be too busy to lost the packet

In order to save resources, this function block supports polling communication. All input parameters can be changed during communication. For example, "ipaddressport" can be changed during communication, and  can be effected in the next scanning cycle.

The feedback pulse readdone after communication is completed, and writedone reports the read-write status. At this time, the fromnode information is the current communication node information.

Of course, this function block can also be called many times to communicate with multiple PLCs to ensure the fastest communication speed. when you want to do it like this the internal parameters need to be changed for multiple calls, please contact the author www.plclibrary.com

Although communication monitoring is conducted inside this function block and a warning signal is given, each application has different requirements for network connection. If some field communication is disturbed and loses packets once, it will be restored immediately. Only one refresh is missing, which will not affect the application at all. At this time, this warning can be ignored. To judge whether the network is on or off, it is recommended to monitor the heartbeat data with a watchdog and adjust the sensitivity according to the site requirements.

IN_out Description:


Start

ON=start communication,off=stop communication

IPAddressPort

mitsubishi PLC IP address and port,eg:192.168.3.30:6000

ReadDataType

readdata type and start address,Only support D,W,M,L,X,Y,eg:D100,Note: some of these address  are hexadecimal. Fill in 'W100' here, which actually is w64

ReadDataLen

Read data lenght,unit 16bit

INWriteCMD

Write data to Mitsubishi PLC,writing data has higher priority,when there is no writing, reading will start automatically

WriteDataType

Writedata type and start address,Only support D,W,M,L,X,Y,eg:D100,Note: some of these address  are hexadecimal. Fill in 'W100' here, which actually is w64

WriteDataLen

Write data lenght,unit 16bit

WriteDataArry

Byte array for writing data

Information

information for error ,normal is www.plclibrary.com

NetConnected

Port initialization succeeded

Error

Error status. If this error is on, the network or program fails

Warning

Warning status. If this warning is on, it indicates that the other PLC has fed back the error code, or the network has packet loss. When the network is restored, the communication will be restored automatically

Circuilttime

Estimated refresh cycle time

ReadDone

Reading PLC data of the partner is completed

WriteDone

Writing PLC data of the partner is completed

ReceiveData

Read PLC data storage pool

FromNode

partner's network information

In order to save PLC resources, the program almost does not make fool proof judgment on the pin input value. For example, please write the data type in strict accordance with the example style, such as D100 instead of D 100 or sd100. Although the compilation can pass, but nobody knows how the program will execute.


Free Download:

MCDLL File Free Download