User guide
60
VTB USER GUIDE
variable type passed by pointer.
Example
Used variables:
value int
Ret char
value=100
Ret=pxco_sdodl(1,2000,0,2,value()) 'node=1, index=2000, subidx=0,
'len=2 byte, value=100
if Ret<>0 ‘test if error occurs
if Ret=2
read_sdoac()‘read eventual SDO ABORT CODE
...
endif
...
endif
PXCO_SDOUL
This function allows to read data from a node of the canopen net using the protocol SDO. It is supported only the SDO
EXPEDITED mode allowing to read up to 4byte of data length.
Hardware All
Syntax
PXCO_SDOUL(char node, unsigned index,unsigned char subidx,char *dati) 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
*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 int 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 use the variable passed by pointer of
the type corresponding to the length of the data to be read.
Example
Used variables:
value int
Ret char
Ret=pxco_sdoul(1,2000,0,value()) 'node=1, index=2000, subidx=0,
'value=data read
if Ret<>0 ‘test if error occurs
if Ret=2
read_sdoac()‘read eventual SDO ABORT CODE
...
endif
...
endif
READ_SDOAC
Reading of the SDO ABORT CODE sent by a node in the canopen net as answer to a request done with the function