Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

EtherCAT FPGA master-slave

Hello

I am using two NI9144 EtherCat chassis conncected to a RT desktop. I have one FPGA VI running on the master and  doing some acquisition. As far as I've understood from some NI documents, there is FGPA available in each chassis. However, I want to use also the modules which they are on the slave chassis. I tried and the I/O nodes can be dropped and work only in the FPGA that they belong to, which sounds logical. So my question is : Should I have separate VIs for the acquisition in FPGA mode at each chassis ? And if yes, how I can ensure synchronized measuremenets form the different I/O modules ?

Thanks

0 Kudos
Message 1 of 6
(5,298 Views)

There are two modes. If you put a module under the chassis you are in scan mode. Modules in scan mode are automatically synchronized (as well as they can be) across the ethercat network. If you put a module under the FPGA item its in FPGA mode, which means you program it directly. To ensure some level of synchronization you can monitor the scan clock I/O line and try to acquire your data such that when the scan line flips you can provide all your user-defined variables with fresh, current data. The scan line should switch at about the same time on all chassis.

 

If you don't need to do processing or filtering on the data, I'd just use scan mode.

0 Kudos
Message 2 of 6
(5,278 Views)

Yes I understand your point. I am already using the scan clock to send the updated data from the FPGA to Host, at every acquisition period (i.e 100ms). However, to start the acquisition each time, I use a digital signal as trigger which is produced in FPGA of the master device. Note here that I use the digital signal also as an output in my application and I need to programmed this in the FPGA because I care on usec accuracy. So, my problem is how to transfer that trigger also to the fpga of the slave device because I have input modules there too, which I want to be synchronized and acquire together with the modules on the master.

Just to mention , I 've seen to NI documents that two FPGAs can communitcate together with Peer-to-Peer Data but this function is not supported by NI9144. But he devices communicate via ehtercat. So, can it be one way for the two FPGAs to interact without involving the Scan Engine which limits me to 1ms period.

Hope it's explained well. 

Thanks.

0 Kudos
Message 3 of 6
(5,271 Views)

Peer to peer communication is not supported on ethercat, you are correct.

 

If I am reading this correctly you want to generate a digital pulse on the master and then use that to time acquisition on the slaves. The only way I can think of to accomplish this is to pass the digital signal directly using a module like the 9401/02.

 

Even then you'll have to be careful about what modules you use. SAR modules can be triggered on demand but DSA modules have their own sample clock which you don't have access to. Scan engine approximates synchronization by running all the modules as quickly as possible, grabbing the most recent sample from DSA modules (so dt = 0 to -1*sample period, I think) and reading SAR modules at the last possible moment (since they have a known sample conversion time). I might be off a bit, but thats the basic idea. You'll have to do something similar, which means if you need some low microsec accuracy number, you need to be careful about the modules you use.

 

Theres also a good chance I'm reading this incorrectly. Do you have a diagram that shows the various signals?

 

 

0 Kudos
Message 4 of 6
(5,265 Views)

Ok, I think I will try to pass it with another module. Thanks for the idea. I was trying to find a way to do it "internally". I will get back soon if it works. Thanks again.

0 Kudos
Message 5 of 6
(5,248 Views)

If you just need high usec resolution (~10 kHz) you may be able to run the ecat network that fast, depending on your host controller (ie a PXI should be able to hit that, a 9074 definitely wont). However this will be relatively poor synchronization compared to an actual signal based approach. 

 

If you have DSA modules the 9469 (http://sine.ni.com/nips/cds/view/p/lang/en/nid/210832) may be appropriate. Its still signal based synchronization but it will keep all of your DSA modules in sync together, which means that if they all have the same sample rate you could in theory keep a running counter on your host, latch the counter value when you see or generate the digital trigger (lets say you see the trigger at analog sample #58209), transmit that over ethercat and have a memory on the 9144 which holds N previous samples. With a bit of math you might be able to set it up to retrieve the AI value at a particular sample count.

 

But honestly this sounds pretty hard. There are probably better solutions out there. If you haven't already, I'd recommend talking to the sales rep for your area or calling into ni support to discuss your application in more depth and figure out the right platform for your needs.

0 Kudos
Message 6 of 6
(5,245 Views)