ECATDeviceAction

PLCopen motion icon Pipe Network motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Performs an action on an EtherCATClosed Ethernet ofr Control Automation Technology. EtherCAT® is an open, high-performance Ethernet-based fieldbus system. The development goal of EtherCAT is to apply Ethernet to automation applications which require short data update times (also called cycle times) with low communication jitter (for synchronization purposes) and low hardware costs. device.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

When Execute is set to TRUE, an action is performed.

DeviceAddress

INT

-32768 to +32767

N/A

No default

The address of the device to perform an action on.

  • The first node usually has the value 1001.
  • The second node usually has the value 1002.

  • Use the members of the EtherCAT structure to specify a device's address to Create Variables.
       

Action

INT

-32768 to +32767

N/A

No default

The action to be performed. Action can be one of these values:

  • DEVICE_ACTION_CONNECT
    • Connects a slave into the EtherCAT network.
    • This action can only be executed when the motion engine is stopped.
  • DEVICE_ACTION_DISCONNECT
    • Disconnects a slave from the EtherCAT network.
    • This action can only be executed when the motion engine is stopped.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

FALSE, TRUE

N/A

Indicates whether this functionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. block has completed without error.

Error

BOOL

FALSE, TRUE

N/A

Indicates whether this function block has completed with error.

ErrorID

DINT

No range

N/A

The ECATDeviceAction error result if Error is TRUE.

  • See Error Codes.
  • Upon success, Error is set to 0 (zero).

Remarks

  • This function returns immediately.
  • It can be called multiple times in one cycle.

Supported Actions

DEVICE_ACTION_DISCONNECT

DEVICE_ACTION_CONNECT

  • This action connects the already disconnected node to the EtherCAT Network.
  • The axis (or axes) that was acting as simulated axis becomes a normal axis when the drive node is connected.
  • The axis/axes position comes directlyClosed The orientation components of a vector in space. from the configured drive feedback.
    • The position is not automatically transferred from the simulated axis.

Usage

The EtherCAT network needs to be stopped to use this function block.

Error Codes

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

MLMotionStop(); 
MotionEngineStatus := MLMotionStatus(); 
On MotionEngineStatus = MLSTATUS_STOPPED Do 
   Inst_ECATDeviceAction(True, EtherCAT.AKD_3, DEVICE_ACTION_DISCONNECT); 
   If Inst_ECATDeviceAction.Error Then // Handle Error 
       // Error ID value is in Inst_ECATDeviceAction.ErrorEnd_If; 
End_Do;

See Also