04-03-2019 01:28 AM
I'm working on a project and I try to complete the following task.
I have torque sensors which are connected to a etherCAT module. This etherCAT module is connected to one of the ethernet port on cRIO 9047.
How is it possible to get the data from the EtherCAT module and into the labview FPGA project. I don't know how to set up the communication inside labview.
04-03-2019 01:55 AM
Hi mkstech,
the Ethernet port of the cRIO is handled by the RT part of the software stack.
So you need to read those sensor values in your RT host VI.
(The last time I used an EtherCAT chassis I used SharedVariables to do that.)
Then you implement some data communication between RT and FPGA: this is explained in all those example VIs and projects coming with LabVIEW (and the RT and FPGA module)…
04-03-2019 02:11 AM
Okay.
I guess that RT stands for Real-Time module 🙂
I need to sample with a frequency of 20 kHz. Is the RT-module capable of doing this and sending this to the FPGA target??
04-03-2019 02:21 AM
Hi mkstech,
I need to sample with a frequency of 20 kHz. Is the RT-module capable of doing this and sending this to the FPGA target??
Is your EtherCAT chassis (and module) able to sample at 20kHz sample rate?
The RT surely cannot sample at 20kHz using a "single sample by sample" approach. Once you can read/transfer blocks of samples that might be possible in the RT.
Sending data from RT to FPGA at 20kHz is possible using FIFOs.
04-03-2019 06:59 PM
Hi mkstech,
If you need a faster scan rate, I suggest that you could use the Raw data mode. The detailed please refer to the following link:https://niweb.natinst.com/confluence/display/TWikiIndustrialcomm/Faster+Scan+Rate.
04-03-2019 10:25 PM - edited 04-03-2019 10:26 PM
@zhengchen wrote:
Hi mkstech,
If you need a faster scan rate, I suggest that you could use the Raw data mode. The detailed please refer to the following link:https://niweb.natinst.com/confluence/display/TWikiIndustrialcomm/Faster+Scan+Rate.
Your link is not available to anyone outside of NI.
04-09-2019 01:48 AM
Hi GerdW
Please see my attached picture which is my setup..
I have the cRIO 9047 and this is connected to the etherCAT sensor modules. Is this possible?
I don't have an EtherCAT chassis..
04-09-2019 02:37 AM
Hi
In EtherCAT you typically need an EtherCAT Master e.g. TwinCAT from Beckhoff or some other EtherCAT master e.g. NI. In case of NI you would need the EtherCAT chassis for implementation.
There are many approaches possible.
One would be to turn your PC into an EtherCAT master (I only can talk from the TwinCAT point of view) and read the data via TwinCAT ADS to your LabVIEW application. (20kHz will not be possible without a few buffering "tricks")
An other option is to write a minimal EtherCAT master on your own. This is very tricky because you need to implement the EtherCAT protocol into your LabVIEW application and will also not help to overcome the speed problem without many tricks.
So from my point of view it is a hard task to achive the result you want to have.
04-09-2019 04:17 AM
@nottilie wrote:
Hi
In EtherCAT you typically need an EtherCAT Master e.g. TwinCAT from Beckhoff or some other EtherCAT master e.g. NI. In case of NI you would need the EtherCAT chassis for implementation.
There are many approaches possible.
One would be to turn your PC into an EtherCAT master (I only can talk from the TwinCAT point of view) and read the data via TwinCAT ADS to your LabVIEW application. (20kHz will not be possible without a few buffering "tricks")
An other option is to write a minimal EtherCAT master on your own. This is very tricky because you need to implement the EtherCAT protocol into your LabVIEW application and will also not help to overcome the speed problem without many tricks.
So from my point of view it is a hard task to achive the result you want to have.
It is also a very difficult task from my point of view... I have a Beckhoff PLC which I could use for this EtherCAT master. But how do I read the data to twincat and from there to labview by using buffering tricks??
04-09-2019 04:30 AM
That is the point.
The problem is the PLC cycle time. If you want to read 2khz data you need a cycle time of at least 500µs. At every cycle the PLC writes the EtherCAT terminals hardware value into a Buffer in the PLC e.g. for a simple proove of principal a Data Array with position information.
If you create e.g. an array of 4000 entries you just need to be sure to poll the data via ADS at least every two seconds.