User guide

59
VTB USER GUIDE
Note
Keep in mind these rules:
AXIS MUST BE STOPPED
CHANGING INSTANTLY THE POSITION IT OCCURS A PARTICULAR SEQUENCE TO AVOID THE PHISICAL AXIS
MOVES ROUGHLY
For example WHEN USING THE CANOPEN AXIS IT NEEDS:
REMOVING THE CANOPEN FROM THE INTERPOLATION MODE
PRESETTING THE CANOPEN AXIS BY METHOD .HOME
PRESETTIN THE INTERPOLATOR WITH FUNCTION PRESET(pos())
SETTING AGAIN THE CANOPEN AXIS IN INTERPOLATION MODE
Example with the axis X as CanOpen (object name AxisCan)
Used variables:
PresetValue(3) as long
AxisCan.start=0 ' remove the start condition
AxisCan.modo=0 ' set the position mode (remove from interpolation mode)
AxisCan.home=1000 ' preset of axis at 1000
PresetValue (0)=1000 ' set the preset value in the position array for X
PresetValue (1)=OBJ.pc(1) ' value to not modify the Y position
PresetValue (2)=OBJ.pc(2) ' value to not modify the Z position
OBJ.PRESET(PresetValue ()) ' preset of the interpolator
AxisCan.modo=2 ' set the Interpolation Mode
AxisCan.start=1 ' start
In similar way the same problem can occur using the STEP/DIR axis. Refer to the chapter of STEP/DIR channels for a
correct preset of them.
11.5 CANOPEN FUNCTIONS
This group of functions allow the management of CANOPEN line at application level. A lot of library OBJECTS use these
functions to make it more simple but in some cases it is necessary using the primitive functions directly.
PXCO_SDODL
This function allows to send data to a node of the canopen net using the protocol SDO. It is supported only the SDO
EXPEDITED mode allowing to send up to 4byte of data length.
Hardware All
Syntax
PXCO_SDODL(char node, unsigned index,unsigned char subidx,long len,char *data) as char
Parameters
Node Node ID of the SLAVE to whch send data
Index, subindex Address in the Object-Dictionary of the data to be written
Len Number of bytes to send
*data Pointer to the data to send
Return value
char 0 No error
<>0 Communication error
=2 The node responded with a SDO ABORT CODE, calling the function read_sdoac in the
system variables _SYSTEM_SDOAC0 e _SYSTEM_SDOAC0 will be available the relative error code.
WARNING: Cause the different allocation of bytes inside variables be careful to set the length corresponding to the