Only devices which support one of the pre-defined protocols are detected by the library.
Verify that the FC_Scan function was executed successfully before you use an instance of the function blocks FB_SendCommand/FB_ExtendedSendCommand or the function FC_GetPeerScanData.
Wait up to 5 seconds (depending on the number of connected network devices) after the execution of the FC_Scan function has completed before you execute any other function or function block.
The input i_udiSearchUniqueID of the function FC_GetPeerScanData must be 0 if you call this function after an execution of the function FC_ClearScanList and FC_Scan before executing the command.
There is no syntax verification available for FB_ExtendedSendCommand; therefore use FB_SendCommand defined by the enumeration ET_SendCommandType.
Depending on the command, the structure ST_SendCommand (input of FB_SendCommand) contains different parts which are mandatory. The correct MAC address is required.
The following examples are based on this network topology:
There are two detected devices stored in the internal database (M241 and M251 Logic Controllers).
Searching for a device by its model name:
Step |
Action |
---|---|
1 |
Set the inputs in the following way:
|
2 |
Execute the function. Result: The structure ST_PeerDeviceInfo provides the M241 related information. ![]()
NOTE: If there are several M241 Logic Controllers connected to your network, use the unique Id (1 in this example) as input for i_uiSearchUniqueID during the next execution. Repeat this procedure as long as FC_GetPeerScanData is executed successfully to get the information for the M241 Logic Controllers.
|
Searching for a device by its IPv4 address:
Step |
Action |
---|---|
1 |
Set the inputs in the following way:
|
2 |
Execute the function.
Result: The structure ST_PeerDeviceInfo provides the related information of the controller with this ![]() |
Locate
The execution of this function block makes LEDs on the connected M251 Logic Controller flash for about 10 seconds.
IPv4 address
Save = FALSE
), all elements of the input structure i_stSendCommand must be set.
FC_ClearScanList
FC_Scan
FC_GetPeerScanData
MAC address
There is a syntax verification implemented for any structure element, depending on the command.
Backup
There is only one input string defined where to enter the complete command, for example, for locate.