Cx9020 + el6021

Luchian

Member
Join Date
Oct 2016
Location
Bucharest
Posts
19
Hi guys,
I have a little situation here. I try to connect a modbus RTU device to my CX9020 using EL6021. I did some research and I found out that I have to use this block: ModbusRtuMasterV2_KL6x22B. What any changes do I have to do ?
Thank you !
 
It's been several years, so I will try to do my best to recall how to use this library. The first thing you will need to do is go to the Library Manager and add a reference to the library. When you add the library, it will create 2 variables in the Global Variables->TwinCAT Configuration. These variables need to be linked through System Manager to your EL6021 card.
 
As promised here you have the project.

If your teminal boxes are different then you have to rescan and link the input and output of the EL6021 to the MBmaster FB. You can use multilink as shown.

EL6021_Config.png Multilink.jpg
 

Attachments

  • TwinCAT_EL6021_MB.zip
    27.1 KB · Views: 79
As promised here you have the project.

If your teminal boxes are different then you have to rescan and link the input and output of the EL6021 to the MBmaster FB. You can use multilink as shown.
One question. I tried to write my own code in Ladder Diagram. The problem is when I try to connect to my device it says it is always busy.
 
It will do that until execute is false. It scans so quickly you cant see it changing.

You can put a RTRIG in to detect when busy turns false and then turn execute off.

If the input or read register changes you should see the values continuously change in the array.
 
One question. I tried to write my own code in Ladder Diagram. The problem is when I try to connect to my device it says it is always busy.
I tried your code and the result it the same. Do you know what's the pinout for Beckhoff? I did my research and I found it that it is the same pinout as Siemens pinout, 3 and 8 pins.
 
If there is an error you should be able to see it under the FB for the MBMaster.

Also you need to connect the terminals as shown in the pic.

MBMaster.png EL6021.png
 
Last edited:
It will do that until execute is false. It scans so quickly you cant see it changing.

You can put a RTRIG in to detect when busy turns false and then turn execute off.

If the input or read register changes you should see the values continuously change in the array.

I know that, but i doesn't connect. The array si always empty. I try to connect to an ATR171. I did this connection with a Siemens PLC and I know what should happen, but it's now working. I think it could be a hardware problem. For Siemens I used pin 3 and 8 for Modbus RTU, but here, it seems it doesn't work.
 

Similar Topics

Hi guys, I have a PLC from Beckhoff (CX9020) and an IO Link module EL6224. I'm trying to read some data from a photoelectric senzor(IFM...
Replies
0
Views
2,124
Hi guys, I have a CX9020 Plc and some modules and I want to connect my PLC to CP6066 which is a HMI from Beckhoff. This HMI uses Twincat 2.11, my...
Replies
3
Views
2,951
Hi fellow programmers ! I just got put onto programming a Beckhoff cx9020 PLC with twincat 3. I have run into a problem creating and opening files...
Replies
1
Views
3,141
At our company we are using Beckhoff a lot of cx9010 en cx9020. On one of the cx9020, after the scan devices is done in the system manager, there...
Replies
3
Views
3,352
Dear Members: I am new at Twincat PLC System. I am working on a project. I have connected CX9020 with a PSI-9750 high voltage power supply via...
Replies
2
Views
1,800
Back
Top Bottom