Difference between revisions of "EtherCAT:EC USER SAFEOP CONFIG"
(Created page with "{{Template:EtherCAT-Function |DESCRIPTION= EtherCAT slaves configuration is done carefully because some configurations must be carried out while the slaves are still in PREOP...") |
m |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{Languages|EtherCAT:EC_USER_SAFEOP_CONFIG}} | ||
{{Template:EtherCAT-Function | {{Template:EtherCAT-Function | ||
|DESCRIPTION= | |DESCRIPTION= | ||
− | EtherCAT slaves | + | Configuration of EtherCAT slaves must be performed carefully. Some configurations must be done while the slaves are still in PREOP mode, and some are done while the slaves are in SAFEOP mode. |
− | This function and its counterpart [[EtherCAT:EC USER PREOP CONFIG|EC_USER_PREOP_CONFIG]] and [[EtherCAT:EC USER OP CONFIG|EC_USER_OP_CONFIG]] are implemented in the library EC_USER.LIB. The purpose of these functions is to allow the user '''add his own code''' in order to | + | |
− | EC USER SAFEOP CONFIG(slave address) is invoked after [[EtherCAT:EC_STARTMASTER|EC_STARTMASTER]] has | + | This function and its counterpart [[EtherCAT:EC USER PREOP CONFIG|EC_USER_PREOP_CONFIG]] and [[EtherCAT:EC USER OP CONFIG|EC_USER_OP_CONFIG]] are implemented in the library EC_USER.LIB. The purpose of these functions is to allow the user to '''add his own code''' in order to perform specific configurations of EtherCAT slaves. |
+ | |||
+ | EC USER SAFEOP CONFIG(slave address) is invoked after [[EtherCAT:EC_STARTMASTER|EC_STARTMASTER]] has finished its work and all the slaves are in OP mode. It therefore starts by changing the slave's mode to SAFEOP, then performs the necessary configuration, and then raises the slave back to OP mode. | ||
<br/> | <br/> | ||
Line 20: | Line 23: | ||
|SYNTAX= | |SYNTAX= | ||
− | retVal = | + | retVal = EC_USER_SAFEOP_CONFIG(<Slave address>) |
|EXAMPLE= | |EXAMPLE= | ||
+ | <syntaxhighlight lang="vb"> | ||
for i = 1 to NUM_OF_SLAVES | for i = 1 to NUM_OF_SLAVES | ||
− | + | retVal = EC_USER_SAFEOP_CONFIG(i) | |
next | next | ||
+ | </syntaxhighlight> | ||
|SEE ALSO= | |SEE ALSO= |
Latest revision as of 08:53, 7 May 2017
Language: | English • 中文(简体) |
---|
Configuration of EtherCAT slaves must be performed carefully. Some configurations must be done while the slaves are still in PREOP mode, and some are done while the slaves are in SAFEOP mode.
This function and its counterpart EC_USER_PREOP_CONFIG and EC_USER_OP_CONFIG are implemented in the library EC_USER.LIB. The purpose of these functions is to allow the user to add his own code in order to perform specific configurations of EtherCAT slaves.
EC USER SAFEOP CONFIG(slave address) is invoked after EC_STARTMASTER has finished its work and all the slaves are in OP mode. It therefore starts by changing the slave's mode to SAFEOP, then performs the necessary configuration, and then raises the slave back to OP mode.
Input
Slave address
Output
None
Return Value
0 on success, -1 if failed. The user can change that.
Declaration
public function EC_USER_SAFEOP_CONFIG(byval slave_addr as long) as long
Syntax
retVal = EC_USER_SAFEOP_CONFIG(<Slave address>)
Examples
for i = 1 to NUM_OF_SLAVES
retVal = EC_USER_SAFEOP_CONFIG(i)
next