Difference between revisions of "EtherCAT:EC SLAVE SET STATE"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "{{Axystems:Template:EtherCAT-Function |DESCRIPTION= This function set the slave's operational state |INPUT= Axis' address (example: Ax.dAdd), new state as string |OUTPUT= N...")
 
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Axystems:Template:EtherCAT-Function
+
{{Languages|EtherCAT:EC_SLAVE_SET_STATE}}
 +
{{Template:EtherCAT-Function
  
 
|DESCRIPTION=
 
|DESCRIPTION=
This function set the slave's operational state
+
This function sets the slave's operational state. <br/>
 +
Use [[EtherCAT:EC SLAVE NMT STATESET|EC_SLAVE_NMT_STATESET]] to set a drive's opmode in an informative manner.
  
 
|INPUT=
 
|INPUT=
Axis' address (example: Ax.dAdd), new state as string
+
Axis address (example: Ax.dAdd), new state as long where:<br/>
 +
EC_STATE_INIT  - 0x01<br/>
 +
EC_STATE_PREOP  - 0x02<br/>
 +
EC_STATE_SAFEOP - 0x04<br/>
 +
EC_STATE_OP    - 0x08<br/>
  
 
|OUTPUT=
 
|OUTPUT=
Line 14: Line 20:
  
 
|DECLARATION=
 
|DECLARATION=
public function EC_SLAVE_SET_STATE(byval addr as long, byval stat as string) as long
+
public function EC_SLAVE_SET_STATE(byval addr as long, byval stat as long) as long
  
|LIMITATIONS=
 
Valid state strings are as follows:<br/>
 
"INIT"<br/>
 
"PREOP"<br/>
 
"SAFEOP"<br/>
 
"OP"<br/>
 
  
 
|EXAMPLE=
 
|EXAMPLE=
retVal = EC_SLAVE_SET_STATE(slave_addr[i], "SAFEOP")
+
retVal = EC_SLAVE_SET_STATE(slave_addr[i], EC_STATE_SAFEOP )
  
 +
|SEE ALSO=
 +
* [[EtherCAT:EC SLAVE GET STATE|EC_SLAVE_GET_STATE]]
 +
* [[EtherCAT:EC SLAVE NMT STATESET|EC_SLAVE_NMT_STATESET]]
 
}}
 
}}

Latest revision as of 07:09, 7 May 2017

Language: English  • 中文(简体)‎

This function sets the slave's operational state.
Use EC_SLAVE_NMT_STATESET to set a drive's opmode in an informative manner.

Input

Axis address (example: Ax.dAdd), new state as long where:
EC_STATE_INIT - 0x01
EC_STATE_PREOP - 0x02
EC_STATE_SAFEOP - 0x04
EC_STATE_OP - 0x08

Output

None

Return Value

0 if successful, -1 otherwise

Declaration

public function EC_SLAVE_SET_STATE(byval addr as long, byval stat as long) as long

Examples

retVal = EC_SLAVE_SET_STATE(slave_addr[i], EC_STATE_SAFEOP )

See Also