Function to read a SoE parameter (read stru.idn parameter on device identified by stru.rid and received information stored in destination).
The read can be done in pass-through mode or in blocking mode (usable only in tasks 1-:-8).
Pass-through mode means that the function must be continuously called and this returns the current state of the task.
Blocking mode means that the function is invoked and returns only when it has completed the read operation.
The function returns a result on the state of execution.
Syntax |
i32 soe_ridn (stru_soe_idn stru, destination) |
---|---|
stru |
Structure of type stru_soe_idn containing the information for reading a SoE parameter |
destination |
Contains the information received. destination must be an object compatible with the data being read (if reading a VISIBLE STRING, destination will be of type string, if reading an OCTET_STRING it will be a byte array or structure) When reading arrays only information whose length is <= to 256 bytes will be handled. Having to read larger information use OCTET_STRING as the data type and provide a sufficiently large destination buffer (obviously interpretation of the data is up to the application) |
Result |
Variable containing the result. See pass-through mode and/or blocking mode |
Validity |
Rule, Task |
System Requirements |
RTE 34.18.3 |
Note |
•Set stru.phase = 1 to initialize the read. •If the data type is not specified(stru.dataType=0), the data type reading is performed on remote device. The variable stru.phase is changed. •The read command is sent to the remote device and a response is expected. The variable stru.phase is changed. •Waiting for response. •Response is received with a positive result. The value read is written to destination. RTE changes stru.phase = 4. •Receive response with negative result. RTE changes stru.phase = 0. o-2, communication handler busy o-3, communication handler crash (restart) o-5, command to a device not present(stru.rid) o-6, no operation running. stru.phase not initialized o-12, illegal value of idn(alarm 9900 arg 12) o-13, illegal value of element/cmd (alarm 9900 arg 13) o-14, illegal value of datatype (alarm 9900 arg 4/arg 14) o-15, illegal value of datalen (alarm 9900 arg 5/arg 15) o-16, illegal value of phase (alarm 9900 arg 6) o-21, destination not specified (alarm 9900 arg 16) o-22, destination changed (alarm 9900 arg 32) o-23, software error o2, command already answered positively, value available in destination o>2, SDO error code, see table below |
•Set stru.phase = -1 to perform the read. •If the data type is not specified(stru.dataType=0), the read of data type on remote device is performed. The variable stru.phase is changed. •The read command is sent to the remote device and a response is expected. The variable stru.phase is changed. •Waiting for response. If the response does not arrive within a maximum of 3 seconds, the function exits with an error (timeout, returns -2). •Receiving response with a positive result. The value read is written to destination. RTE changes stru.phase = 4. •Receive response with negative result. RTE changes stru.phase = 0. o-2, communication handler busy o-3, communication handler crash (restart) o-4, blocking mode handling not allowed in current task(stru.phase = 1) (rule, ladder). Command not accepted o-5, command to a device not present(stru.rid) o-6, no task running. stru.phase not initialized o-12, illegal value of idn(alarm 9900 arg 12) o-13, illegal value of element/cmd (alarm 9900 arg 13) o-14, illegal value of datatype (alarm 9900 arg 4/arg 14) o-15, illegal value of datalen (alarm 9900 arg 5/arg 15) o-16, illegal value of phase (alarm 9900 arg 6) o-21, destination not specified (alarm 9900 arg 16) o-22, destination changed (alarm 9900 arg 32) o-23, software error o2, command already answered positively, value available in destination o>2, SDO error code, see table below |
Example of use:
|