Function: The command establishes a brief connection to the hardware and determines the devices in the network. Then you can apply the devices found into the device tree of your project.
Call: Menu bar: “Project”; context menu of a device object in the device tree
Requirement: The communication settings to the controller are correct. The gateway and the PLC are started. The device supports the scan function.
The following devices provide the scan function: EtherCAT master, EtherNet/IP Scanner (IEC), Sercos master, CANopen Manager, CANopen Manager SIL2, PROFINET controller and PROFIBUS DP master.
You can perform the device scan immediately if the scan function is permanently implemented in the PLC. When scan function is implemented in a library, you have to log in only one time to download the library to the controller.
The command refers to the master controller selected in the device tree. For example, an already inserted PROFINET IO controller can be selected and the command used to determine the I/O devices and I/O modules assigned to it.
After performing the scan operation, the “Scan Devices” dialog opens and displays the found devices.
Dialog 'Scan Devices'
“Device name, Device type, Address, Station name, etc.” |
Data about the scanned device depending on network type. When you change a value in the list of scanned devices, the value is shown in italics. This indicates that the new value has been changed in the editor in CODESYS, but not in the device. When you download the value to the device, it is shown normally. Value that indicate differences between the project and the scanned device are shown in orange. If multiple device descriptions are available for the scanned device, then the name is displayed in bold. The selection of the matching device description is resolved differently for different fieldbuses. For more detailed information, see the corresponding fieldbus chapters. If a device description cannot be found, then the following message is shown: "Attention! The device was not found in the repository." Depending on the bus system, additional information is displayed, such as manufacturer number and product number. The device cannot be inserted into the project without the installed device description. |
“Show differences to project” |
|
“Scan for Devices” |
Starts a new search. |
“Copy All Devices to Project” |
The device that is selected in the table is inserted into the device tree in the project. If nothing is selected, then all scanned devices are shown. |




NOTICE

If you insert devices, which are available in the device tree, to the device tree with “Copy All Devices to Project”, then the following should be noted. The data of the “Process Data” and “<...> I/O Mapping” tabs of the existing devices can be overwritten with the data of the recently inserted devices.
This part of the dialog is visible only when you select the “Show differences to project” option. Differences between the scanned and configured devices are color-coded. Devices displayed in green are identical on both sides. Devices displayed in red are available only in the view of the scanned or configured devices. |
|
![]() |
If you have selected a device in both views, then the scanned devices are inserted above the selected configured device. |
![]() |
If you have selected a device in both views, then the scanned devices are inserted below the selected configured device. |
![]() |
If you have selected a device in both views, then the configured devices are replaced by the selected scanned device. |
![]() |
All scanned devices are copied to the project. |
![]() |
Deletes the selected configured device. |
Scanning an adapter can fail if the PLC is in RUN mode and a connection already exists from the scanning controller to the adapter. Then the scanning causes another connection to be established to the adapter, which interrupts the existing connection in some adapters. Then the scanner restarts the connection to the adapter, which causes the adapter to interrupt the connection to the scanning controller.
For this reason, it makes sense to perform a network scan in STOP mode after a "Reset". If RUN mode cannot be interrupted, then scanning is possible without an projected remote adapter (EtherNet/IP scanners in the device tree only).
For experts
When accepting the remote adapter by means of the “Copy to Project” command, the I/O dimensions with which the adapter responded are set for the first "exclusive owner"
connection. In order to log all of the detected assembly instances after scanning,
the definition IODRVETHERNETIP_PRINT_SCAN_RESULT
must be set. By default, it is scanned by the instance ID 100–199. This can be adapted
by means of the library parameters ParamScanStartOfInstanceAssem
and ParamScanLastOfInstanceAssem
from the library IoDrvEtherNetIP Library
. This might be necessary, for example to scan in another manufacturer-specific range
(assembly instance ID ranges).