Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
EtherCAT: Managing IO Assignments
#1
Hello,

I have successfully configured some Beckhoff EtherCAT IO using the IDE. I find the way it auto-assigns IO numbers to the ECAT[] structure to be difficult to organize.

Is there is a way to set up EtherCat IO assignment in a text file or something more amenable to change?

We have used 100's of digital IO on projects so you can see how having a logical layout of IO assignment can help to prevent errors!

BTW, the EtherCat IO is working good. I found that I had to set ECAT[0].Enable =1 before I saved. I don't believe this was in the manual for the IO setup.

Thank you,
KEJR
Reply
#2
What do you want changed?
Reply
#3
(06-02-2015, 11:53 AM)steve.milici Wrote: What do you want changed?

This reply is very late in the works but what I was wondering is if you could do the ethercat config in a similar way to how you do PMH files with M-vars (I'm not sure I *want* to do this but is it possible?).

I can live with the GUI assignment the way it is. I'm just trying to adjust to the difference from this method to what we are used to (Backplane based PLCs). It would be nice to have inputs start at one block of addresses and outputs at another, etc. (0-999 for input, 1000-1999 for outputs, etc). At the end of the day its not that important, more of a convenience/organization thing.

Thanks,
KEJR
Reply
#4
(07-09-2015, 07:39 AM)KEJR Wrote:
(06-02-2015, 11:53 AM)steve.milici Wrote: What do you want changed?

This reply is very late in the works but what I was wondering is if you could do the ethercat config in a similar way to how you do PMH files with M-vars (I'm not sure I *want* to do this but is it possible?).

...It would be nice to have inputs start at one block of addresses and outputs at another, etc. (0-999 for input, 1000-1999 for outputs, etc)...

You have a couple of options:
1) use the #defines as provided by the IDE (Rt Click on Master and select, "Export EtherCAT Variables").

OR,

2) use an M var PTR assignment similar to the example below, taken from the ACC-52ECx EtherCAT I/O Manual. This slave device has 16 inputs and 16 outputs mapped to EtherCAT digital I/O, and then bitwise addressed within a *.pmh, or the global includes.pmh file stored in the Global Includes Folder.

Input1, etc. can be M0-M999 and Output1, etc. can be M1000-M1999, or whatever best describes your application. You could even use descriptive assignments like: ESTOP, RESET, ERRACK, RUNSTOP, STO, and BRAKE, etc., or just leave it generic as Input1, Input2, etc..

Code:
// I/O DEFINITIONS
// INPUTS 1-16
PTR Input1->ECAT[0].IO[0].data.0.1; // Input #1
PTR Input2->ECAT[0].IO[0].data.1.1; // Input #2
PTR Input3->ECAT[0].IO[0].data.2.1; // Input #3
PTR Input4->ECAT[0].IO[0].data.3.1; // Input #4
PTR Input5->ECAT[0].IO[0].data.4.1; // Input #5
PTR Input6->ECAT[0].IO[0].data.5.1; // Input #6
PTR Input7->ECAT[0].IO[0].data.6.1; // Input #7
PTR Input8->ECAT[0].IO[0].data.7.1; // Input #8
PTR Input9->ECAT[0].IO[0].data.8.1; // Input #9
PTR Input10->ECAT[0].IO[0].data.9.1; // Input #10
PTR Input11->ECAT[0].IO[0].data.10.1; // Input #11
PTR Input12->ECAT[0].IO[0].data.11.1; // Input #12
PTR Input13->ECAT[0].IO[0].data.12.1; // Input #13
PTR Input14->ECAT[0].IO[0].data.13.1; // Input #14
PTR Input15->ECAT[0].IO[0].data.14.1; // Input #15
PTR Input16->ECAT[0].IO[0].data.15.1; // Input #16
// OUTPUTS 1-16
PTR Output1->ECAT[0].IO[1].data.0.1; // Output #1
PTR Output2->ECAT[0].IO[1].data.1.1; // Output #2
PTR Output3->ECAT[0].IO[1].data.2.1; // Output #3
PTR Output4->ECAT[0].IO[1].data.3.1; // Output #4
PTR Output5->ECAT[0].IO[1].data.4.1; // Output #5
PTR Output6->ECAT[0].IO[1].data.5.1; // Output #6
PTR Output7->ECAT[0].IO[1].data.6.1; // Output #7
PTR Output8->ECAT[0].IO[1].data.7.1; // Output #8
PTR Output9->ECAT[0].IO[1].data.8.1; // Output #9
PTR Output10->ECAT[0].IO[1].data.9.1; // Output #10
PTR Output11->ECAT[0].IO[1].data.10.1; // Output #11
PTR Output12->ECAT[0].IO[1].data.11.1; // Output #12
PTR Output13->ECAT[0].IO[1].data.12.1; // Output #13
PTR Output14->ECAT[0].IO[1].data.13.1; // Output #14
PTR Output15->ECAT[0].IO[1].data.14.1; // Output #15
PTR Output16->ECAT[0].IO[1].data.15.1; // Output #16
Reply
#5
I didn't know that you could assign the ethercat shm to pointer vars, that is kind of interesting but doesn't realy answer my original question.

How does the ethercat master know what IO module and IO bit to map to "ECAT[0].IO[0]". Is it possible to set this up with a text file or is the GUI screen of the IDE necessary for this initial step?

Thank you,

KEJR
Reply
#6
My apologies, I misunderstood your question.

I recommend using the System Setup utility, which enables you to create the necessary configuration files. Once you fully understand what files, and what file contents are required, then you can tweak, or even handle some simple setups from within those *.cfg, *.pmh, and *.h files.

Please see the attached files for examples which use the System Setup. One document covers the setup of an I/O slave and the other two Tech Notes cover Drive setups.


Attached Files
.pdf   Tech Note EtherCAT Setup Copley_r1_2.pdf (Size: 4.22 MB / Downloads: 50)
.pdf   ACC52ECx_Rev_0.pdf (Size: 2.59 MB / Downloads: 56)
.pdf   Tech Note EtherCAT Setup Yaskawa_r1_2.pdf (Size: 4.9 MB / Downloads: 34)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)