LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing and reading data from third party EtherCAT slave with NI-cRIO 9025

I am trying to send data over an EtherCAT connection using my NI-cRIO 9025 controller.  I have set up the 2nd port in MAX as EtherCAT, and have properly updated the software to have Industrial Communications for EtherCAT 14.0.  The 3rd party device is an Anybus X-gateway which is already configured, and has been proven to work with a different EtherCAT master.  When data is being sent to the EtherCAT port I am able to monitor it on Online Slave Device State - EtherCAT:Parameters - Input. 

The problem I am having is I am not familiar enough with LabView programming to find a command to directly write data to the EtherCAT slave.  Is there a function block that does this?  Or will I need to use soemthing like the EtherCAT Aquisition Library to access additional blocks?

If someone could give a detailed example of how to read from and write to a 3rd party EtherCAT slave that would be very helpful.

anybus_setup.JPG

Thank you,

Abram Smith

0 Kudos
Message 1 of 10
(7,283 Views)

Hey Abram,

 

Were you able to successfully import the XML device profile into your LabVIEW project? The steps for that can be found here:

http://digital.ni.com/public.nsf/allkb/FDA1318A8909D02C862574510060DB62?OpenDocument

Ty Prather
Technical Marketing Specialist
National Instruments
0 Kudos
Message 2 of 10
(7,165 Views)

Ty,

I did follow these instructions when importing the XML file, and I was able to detect the device and add it to the project.  I assume this means the XML file worked properly.  Another problem that may be causing none of my communications to go through is I cannot go into Operational Mode with the EtherCAT device I added.  Is this a problem with the XML or some other configuration?

I've tried using function blocks like Shared Variable -> Write Variable, and IndComECAT Slave -> WriteSDO but neither appears to be working when the program is running.


block_program.JPG

0 Kudos
Message 3 of 10
(7,152 Views)

Hey Abe,

 

When you import the device profile, it should give you some sort of "File Import Results" window afterwards. Could you try importing it again and taking a screenshot of that window?

 

Also, could you post the .XML file for your device in your reply so I can take a look at it?

Ty Prather
Technical Marketing Specialist
National Instruments
0 Kudos
Message 4 of 10
(7,104 Views)

Re-importing the .xml file seemed to work!  Now I have the individual input and output bytes listed in the project explorer.  Thank you for the help.

The xml files were here

http://www.anybus.com/support/support.asp?PID=390&ProdType=Anybus X-gateway

0 Kudos
Message 5 of 10
(7,090 Views)

Good to hear Abe! 

 

Glad reimporting that added the I/O!

Ty Prather
Technical Marketing Specialist
National Instruments
Message 6 of 10
(7,055 Views)

Hello Abe

I am a beginner of Ethercat,and I have the same question with you. If you could give a detailed example of how to read from and write to a 3rd party EtherCAT slave that would be very helpful.

0 Kudos
Message 7 of 10
(6,699 Views)

The first link is a good walkthrough of how to use a 9144 EtherCAT slave but it's the same workflow for any EtherCAT slave. The second link will tell you how to add a third-party slave so it shows up in LabVIEW

 

http://www.ni.com/white-paper/10555/en/

http://digital.ni.com/public.nsf/allkb/FDA1318A8909D02C862574510060DB62

Matt J | National Instruments | CLA
Message 8 of 10
(6,693 Views)

Hi,Jacobson

My third party ethercat slave connects successfully with NI cRIO 9039, then I try several examples supplied by lavbiew. When I  try the Read SDO.lvproj ,there is a mistake as shown below.QQ截图20161030225211.pngerror.pngI am searching answer of this problem. I would be appreciate if someone could give me the demo of how to write SDO/PDO to my slave.

0 Kudos
Message 9 of 10
(6,689 Views)

Hi,

 

I would use Highlight Execution to see what node is throwing the error. From the error text, I would suspect the ReadSDO Invoke Node. Make sure that the circled input reference coming out of the array function is valid.

Capture.JPG

Andrew T.
"His job is to shed light, and not to master" - Robert Hunter
Message 10 of 10
(6,671 Views)