Permette di inviare messaggi SDO (Service Data Object)
Sintassi |
CO_SDO nws objCode subIndex [nbyte data] [-F] |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
nws |
Numero di workstation. |
||||||||||||||||||||||
objCode |
Oggetto. |
||||||||||||||||||||||
subIndex |
subIndex. Se EtherCAT (SoE):
|
||||||||||||||||||||||
nbyte |
Lunghezza dei dati da trasmettere. Può assumere i seguenti valori: (opzionale) 0 = No object. 1 = Unsigned 8 bits. 2 = Unsigned 16 bits. 3 = Unsigned 24 bits. 4 = Unsigned 32 bits. 5 = Real 32 bit. -1 = Signed 8 bits. -2 = Signed 16 bits. -3 = Signed 24 bits. -4 = Signed 32 bits. |
||||||||||||||||||||||
data |
Valore da trasmettere. (opzionale) |
||||||||||||||||||||||
-F |
Da utilizzare per la lettura di dati floating point. (opzionale) |
||||||||||||||||||||||
Annotazioni |
Nel caso in cui venga dato un comando illegale si avrà una risposta del tipo: ERROR on SDO : 0x<code> dove <code> potrà assumere i seguenti lavori: 0503 0000 = Toggle bit not aternated. 0504 0000 = SDO protocol timed out. 0504 0001 = Client / Server command specifier not valid or unknown. 0504 0002 = Invalid block size (block mode only). 0504 0003 = Invalid sequence number (block mode only). 0504 0004 = CRC error (block mode only). 0504 0005 = Out of memory. 0601 0000 = Unsupported access to an object. 0601 0001 = Attempt to read a write only object. 0601 0002 = Attempt to write a read only object. 0602 0000 = Object does not exist in the object dictionary. 0604 0041 = Object cannot be mapped to the PDO. 0604 0042 = The number and lenght of the objects to be mapped would exceed PDO lenght. 0604 0043 = General parameter incompatibility reason. 0604 0047 = General internal incompatibility in the device. 0606 0000 = Access failed due to an hardware error. 0607 0010 = Data type does not match, length of service parameter does not match. 0607 0012 = Data type does not match, length of service parameter too high. 0607 0013 = Data type does not match, length of service parameter too low. 0609 0011 = Sub-index does not exist. 0609 0030 = Value range of parameter exceed (only for write access). 0609 0031 = Value of parameter written too high. 0609 0032 = Value of parameter written too low. 0609 0036 = Maximum value is less than minimum value. 0800 0000 = General error. 0800 0020 = Data cannot be transferred or stored to the application. 0800 0021 = Data cannot be transferred or stored to the application because of local control. 0800 0022 = Data cannot be transferred or stored to the application because of the present device state. 0800 0023 = Object dictionary dynamic generation fails or no object dictionary is present (e.g. object dictionary is generated from file and generation fails because of an file error). |
Nota: Se vengono omessi i parametri nbyte e data diventerà un comando di lettura.
Esempio
;lettura status word ws 1 [comando] CO_SDO 1 0x6041 0 [risposta] 16960 0x00004240
;lettura guadagno proporzionale anello di velocità [comando] CO_SDO 1 0x60F9 1 [risposta] 69 0x00000045
;Impostazione guadagno proporzionale anello di velocità a 70 [comando] CO_SDO 1 0x60F9 1 4 70 ;se ok non da risposta |