Sercos3_IDNRead4 (FB)
FUNCTION_BLOCK Sercos3_IDNRead4
This function block could be used to read Sercos III slave parameter. In contrast to Sercos3_IDNRead only parameters not longer than 4 Bytes will be supported. The parameter to be read is specified by the IDN as used in the object dictionary.
- InOut:
Scope
Name
Type
Initial
Comment
Input
xExecuteBOOLOn a rising edge at this input the reading of the slave parameter will be started. In order to get the internal channel deallocated, the instance must be called at least once by “xExecute:= FALSE”.
xAbortBOOLFALSE
If this parameter is TRUE, the current read process will be aborted.
usiComUSINT1
Number of the Sercos III master: If only one Sercos III master is used, usiCom is ‘1’. In case of multiple masters use ‘1’ for the first, ‘2’ for the second, etc.
uiAddressUINTTopological address or Sercos address, depends on the parameter xIsSercosAddress
xIsSercosAddressBOOLFALSE
This input switches between topological address and Sercos address FALSE: uiAddress is the topological address TRUE: uiAddress is the Sercos address
usiChannelUSINT1
Reserved for future extensions. Currently not used.
dwIDNDWORDIDN (Identification Number) with 4 Bytes (SI (structure instance) and SE (structure element))
wElemWORDValue 1: Structure of the IDN
Value 2: Name of the parameters
Value 3: Data attributes
Value 4: Unit
Value 5: Minimal value
Value 6: Maximal value
Value 7: Data value
udiTimeOutUDINTHere you can set a timeout in milliseconds. If the reading of the parameter has not been finished within this time, an error message will be generated.
Output
xDoneBOOLThis output is TRUE as soon as the command has been finished successfully.
xBusyBOOLThis output is TRUE as long as the execution of the command has not been finished.
xErrorBOOLThis output is TRUE, if an error is detected. eError will show the cause.
eErrorThis output shows the cause of the detected error, which is indicated by xError. For example ‘SERCOS3_TIMEOUT’ in case of an timeout.
udiSercosErrorUDINTError code if the function block has not been finished successfully.
abyDataARRAY [1..4] OF BYTE
This is an array of 4 Bytes to which the read parameter data will be copied. If 1 Byte have been read, this will be stored in index 1 of the array. Values of 2 resp. 4 bytes will be copied to the array according to Intel byte order.
usiDataLengthUSINTNumber of read bytes (1,2,4).