Jump to content
OMRON Forums

EtherCAT structure - C language access


AnthonyLH

Recommended Posts

Hello all,

I am trying to get:

- ECAT[].MasterState

- ECAT[].LinkUp

- ECAT[].Slave[].State

From C applications (Capp, Cplcs..).

- pshm->ECAT[].MasterState need to be written in a "ec_master_state_t" structure and result are different from script:

- ec_master_state_t.al_states > 3 in C

- ECAT[].MasterState > 12 in Script..

- pshm->ECAT[].LinkUp is not recognised and "ec_master_state_t.link_up" give also different results:

- ec_master_state_t.link_up > 0 in C

- ECAT[].LinkUp > 1 in Script..

 

Does someone has a documentation or example of ECAT use in C environnement?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I do not think you are doing this because of speed issues. You just want access from C. In that case one way is to use the ASCII interface functions. GetResponse(), GetPmacVar(), SetPmacVar(), and Command() are all good options depending on exactly what you need.

 

Sometimes items that look like structures in the PPmac script language are really functions and therefore have no direct equivalent structure that can be pointed to from C. Sys.CPUTime is one example of this.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...