Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
embedded_systems:cx2020:start [2020-01-17 13:31] – angelegt mlammerichembedded_systems:cx2020:start [2022-05-24 16:25] (aktuell) Moritz Lammerich
Zeile 2: Zeile 2:
  
 The [[ https://www.beckhoff.com/CX2020/ | Beckhoff CX2020 ]] is a PLC based on a x86_64 PC. The [[ https://www.beckhoff.com/CX2020/ | Beckhoff CX2020 ]] is a PLC based on a x86_64 PC.
-It's I/O modules are controlled using EtherCAT called "Beckhoff CCAT".+It's I/O modules are controlled using [[ embedded_systems:ethercat:start | EtherCAT]] called "Beckhoff CCAT".
 By default it runs Windows Embedded 7 but is also capable of running Linux. By default it runs Windows Embedded 7 but is also capable of running Linux.
  
-NTB provides a [[software:linux:yocto:start | yocto ]] configuration for building images for this machine. 
-The NTB [[software:linux:yocto:layers | layer for yocto]] is currently a work in progress and can be found at [[https://github.com/zechenturm/meta-ntb | github.com/zechenturm/meta-ntb ]]. The ''MACHINE'' name for [[software:linux:yocto:start | yocto ]] is ''cx2020'' which will build an image with a 64 bit 4.4 kernel. 
  
-See [[software:linux:yocto:setup Yocto Setup ]] for how to build an image.+**Create a backup of the preinstalled Windows image before overwriting it with the linux image!** 
 +Windows is required to run Beckhoff's TwinCAT software to read the [[ embedded_systems:ethercat:create_eni_fileEtherCAT configuration and generate the ENI file]].
  
 +
 +===== Scanning the EtherCAT bus / Generating the ENI file =====
 +
 +==== Download TwinCAT 3 ====
 +
 +To scan the [[ embedded_systems:ethercat:start | EtherCAT ]] bus on the CX2020, 2 pieces of software are needed: 
 +The TwinCAT Extended Automation Engineering environment and the TwinCAT extended Automation Runtime.
 +The download for the runtime should include both and can be obtained here: [[https://www.beckhoff.com/twincat/]]
 +
 +**Note that the runtime needs to be installed on the CX2020 while the engineering environment should be installed on your normal work (Windows) PC**, from hereon out referred to as the ''host''.
 +
 +==== Connecting the host to the CX2020 ====
 +
 +Once both pieces of software are installed, both the host and cx2020 should have TwinCAT running in the background.
 +There should now be a TwinCAT tray icon in the taskbar:
 +
 +{{:embedded_systems:cx2020:twincat_tray.png?100|}}
 +
 +**On the host**: right click the tray icon and select ''router''->''edit routes''.
 +This will bring up a new window showing the configured routes.
 +On the bottom left, click ''add''
 +
 +{{:embedded_systems:cx2020:twincat_routes.png?400|}}
 +
 +Now a ''broadcast search'' should find the CX2020.
 +
 +{{:embedded_systems:cx2020:twincat_add_route.png?400|}}
 +
 +The CX2020 should now show up in the list with an ''x'' in the ''connected'' column.
 +
 +{{:embedded_systems:cx2020:twincat_route_added.png?400|}}
 +
 +==== Create a new TwinCAT XAR project and scan the bus ====
 +
 +Unfortunately, the TwinCAT engineering environment does not seem to have the option to just read the EtherCAT configuration and generate the [[ embedded_systems:ethercat:create_eni_file| ENI file ]].
 +It is only possible from within a project.
 +
 +To create a new project, open the TwinCAT XAE environment on the host. It may also be called ''TwinCAT XAE Shell''.
 +
 +At the top, there should be a toolbar looking like this:
 +
 +{{:embedded_systems:cx2020:twincat_toolbar.png?400|}}
 +
 +If it says ''TwinCAT RT (x64)'', change it to ''TwinCAT RT (x86)'' using the drop down menu (the little triangle to the right).
 +
 +Change ''<Local>'' to the CX2020. Since it was added to the routes in the previous step, it should be available in the drop down menu. 
 +The end result should look similar to this:
 +
 +{{:embedded_systems:cx2020:twincat_toolbar2.png?400|}}
 +
 +In the solution explorer (on the left), right click on ''Devices'' and then click ''Scan''.
 +
 +{{:embedded_systems:cx2020:twincat_devices.png?300|}}
 +
 +You will get a warning that not all devices can be automatically detected, simply click ''OK''.
 +
 +Once it is finished, a dialog box will show the network devices found. 
 +Click ok once more.
 +When asked to scan boxes, click ''Yes'', and then ''No'' when asked whether to active free run mode.
 +The conncted devices should now be listed under ''I/O''.
 +
 +{{:embedded_systems:cx2020:twincat_device_list.png?200|}}
 +
 +==== Generate the ENI file ====
 +
 +Double click on ''Device 1 (EtherCAT)'' and in the main window, go to the ''EtherCAT'' tab.
 +
 +{{:embedded_systems:cx2020:twincat_ethercat.png?400|}}
 +
 +To generate the [[ embedded_systems:ethercat:create_eni_file| ENI file ]], click on ''Export Configuration File''.