How to control a EtherCAT slave (IndraDrive CS) via REST API?

I have a hardware CtrlX core and have installed the ethercat_master app there. There are two IndraDrive CS MPE drive systems connected to the CtrlX via EtherCAT. Each drive system has a motor attached. The ethercat_master finds the drive systems with no issue; in principle, everything works.

Now my goal is to control the drive systems via REST API. I believe that I have understood the basic concepts of the API and of the data layer. For example, I can read real-time process data from the drive systems via REST. But I can't write realtime process data to the drive systems. For brevity, I'll focus on the master control word in the following description.

Whatever I do, there is no chance to change the master control word that the ethercat_master sends to the drive systems. This works neither via REST API nor via the web UI of the CtrlX. It is also not possible to change the master control word by writing S-0-0134 to the drive systems in the I/O engineering tool. In every case, the drive system seems to accept the written value for fractions of a second, but then the value changes back again.

I believe that the ethercat_master writes the master control word to the drives cyclically, and therefore it cannot be changed by writing S-0-0134 to the drive systems, or by writing values at the data layer IndraDrive nodes that are mapped below the ethercat_master node. Instead, the desired values must probably be written to the ethercat_master (which in turn sends them out to the drive systems). But I couldn't find out yet how to do it. Looking at the data layer, the ethercat_master does not seem to provide appropriate nodes.

Please see the attached screenshots for clarification.

Could somebody please explain what I have to do to be able to change the master control word that the ethercat_master sends to the drive systems?

Thank you very much in advance, and best regards!

 

Best reply by Yvonne

Hi Binarus,

It should be possible to write a value to the drive control word on the datalayer there. With a similar setup (ctrlX core OS V2.4 and MPE20 drive) I can write a value both from the datalayer in the webinterface and via a rest client, e.g. to set the drive from state Ab to AH with value 35840. 

Is the etherCAT master + slaves in state OP, and the drive in state Ab (visible on display) when you are sending the command? What response do you receive if you send a PUT request via restAPI? Does the drive receive the new control word value (can be checked with the parameter editor in Indraworks/ctrlX drive engineering)? 

 

 

 

View original
2 replies