Hello and In this tutorial I will show you how to Startup a Ethernet/IP Adapter in Beckhoff TwincAT TF6280, and build communication with Mitsubishi PLC with RJ71EIP91.Thanks for TF6280, Multicast and broadcast are supported and max of 8 adapter can be configured.
Reference Link
TwinCAT Side
Insert the Adapter
I/O>Devices>Add New Item.
Choose Ethernet/IP>Ethernet/IP Adapter(Slave),>OK.
EIP Adapter is inserted in your network.
Open the Adapter Tab, and configure the network card that you would like to connect.
Wireshark is used for network troubleshooting, please check on the Promiscuous Mode.
If Blue Screen..
Please reference this link if Blue screen is shown while installing the RT Driver.
Configure the Virtual Slave
we need to configuree the Virtual Slave now.
Select the EIP adapter>Right Click >Add New Item.
Choose TC EthernetNet/IP Salve>OK.
Virtual Slave is inserted.
IP Setup
An additional IP is necessary set in each Virtual Slave.Click the Virtual Slave that you inserted in the previous step.
Go to Setting>Index8000:0 , the IP and Network Mask can be set in the 8000:21 and 8000:22.
Insert IO Assembly
Right Click the Virtual Slave>Append IO Assembly to add a new IO Assembly.
Assembly 1 is inserted.
Insert the Instance
Let’s add the Input/Output Instance.
Right Click the Assembly>Add New Item.
Name:Variable name
Data Type:Variable data type
Multiple:How many variables that you would like to need.
And press Ok to confirm it.
Input variables are added.
Same as input, click the output item>Add New Item.
Name:Variable name
Data Type:Variable data type
Multiple:How many variables that you would like to need.
And press Ok to confirm it.
Link the variables
You need to link the IOs to your user-program.Right Click the Variable and Right Click it >Change link to assign it.
\
But also you can select all the variables and use “Change multi Link” function to assign all IOs in one time.
Please make sure you created the variables in the same size.
And just do the same thing in Output Variables.
Instance Information
Open the settings tab, the details can be viewed.
EDS File Export
Now we can export the EDS File.Right Click the Virtual Slave>Export EDS file.
Press Yes to create the EDS files that just for this Virtual Slave.
Press No to create the EDS files that can be used in any configuration.
In this Tutorial, we will choose yes.
Select the file location and save it.
Mitsubishi Side
Please reference this tutorial to play with the EIP Module of IQ-R.
We can create the EIP adapter by using EDS files or Generic EDS.Do not worry, both of these will be explained in here.
Method1 use the EDS Files
Install the EDS File
Open the EIP Tools and install the EDS file that was exported from TwinCAT.
Next>.
Browse.
Choose the EDS File>Open.
Next.
Done!
Beckhoff EIP Adapter is inserted in your EIP Tools Library.
Config the Scanner
Now your beckhoff EIP adapter is connected with the Mitsubishi EIP, Just download the configuration to the EIP Module.
Method2 Directly Enter the Instances
Now I will not use the EDS files but just input the instance number to configure the Beckhoff EIP Adapter in the network.
Method2.1 Configure the Generic EDS
Drop the Generic EDS object into your network.
enter the IP that you set in the Virtual Slave.
Open the Connections tab and enter the connect information.
Please reference to the color to find out the setting in both side.
Mitsubishi Side | Beckhoff Side |
Input Size | Input Size(T->O)=32 |
Intput Instance | Input Instance(T->O)=129 |
Output Size | Output Size(T->O)=32 |
Output Instance | Output Instance(T->O)=130 |
Configuration Instance | Configuration Instance=128 |
But?
The connection can not be established.
Let’s use wireshark to check the packets.
An Error message of Invaild O->T Priority is shown in the packet.
Download EZ-EDS Tools
Let’s see what the EDS Files are inside.
Download the EZ-EDS Tools from ODVA Web site.
Check EDS
Open the EDS file that was exported from TwinCAT and open the Connection1 – Assembly 1:Input and Outputs(Exclusive Owner).
Only Scheduled is supported in both O->T and T->O Side.
ES Tools can not implement this task by Generic EDS,something needs to be changed.
Method2.2 Configure the Advanced Generic EDS
Let’s configure the Network by Advanced Generic EDS Object.
As same as before, enter the IP of Virtual Slave.
Open the connection tab, Priority can be configured and set it as “Scheduled”.
But Also the instance number and exchange size in the configuration settings.
Program
Insert these 2 blocks (setInputData_00A and getInputData_00A).
VAR
VAR fbClass1GetInputData M+RJ71EIP91_Class1GetInputData_00A fbClass1SetOutputData M+RJ71EIP91_Class1SetOutputData_00A END_VAR |
Code
//Start the EIP Request IF NOT EIP_0010_StartReq THEN EIP_0010_StartReq:=TRUE; END_IF; //Read CIPIO From Conneciton1 fbClass1GetInputData( i_bEN:= TRUE ,i_stModule:= EIP91_1 ,i_uConnectionNo:= 1 ,o_bENO=> M0 ,o_bOK=> M1 , o_bErr=> M2 ,o_uErrId=> D0 ,o_uStatusId=>D2 ,o_uInputData=> D10 ); //Write CIPIO to Connection1 fbClass1SetOutputData( i_bEN:= TRUE ,i_stModule:= EIP91_1 ,i_uConnectionNo:= 1 ,i_uOutputData:=D100 ,o_bENO=> M3 ,o_bOK=> M4 ,o_bErr=> M5 ,o_uErrId=> D4 ,o_uStatusId=> D6 ); |
Result
Open the ConnState variables of Assembly in TwinCAT, 0=no error.
CIP I/O Package can be captured in Wireshark.
And also no error in the Mitsubishi side.
Data is exchanged between devices.
Finally
Please check your connection path setting if “Invalid produced or consumed application Path” error message is found in wireshark.