Makers Blog

How to use a Phoenix Contact SD Card to automatically deploy a project onto a AXC F 2152 controller

Dan Clark 13 March 2020 min. read
1,655 views 0 comments

This script has been developed to copy AXC F 2152’s filesystem from an external SD card to the internal SD card on a clean* AXC F 2152.

*A clean AXC F 2152 means there is no code on the controller. All code can be cleared from the controller with a Type 1 Reset.

IMPORTANT: If you have anything scheduled in cron under the root user, it will not be copied. You need to schedule scripts as admin in order for them to move to the other controller. If you need root rights for script, run this command: usermod -aG sudo admin

Pre-requisites:

To deploy this project, you MUST have a Phoenix Contact SD card (Part# 1043501 or 1061701), and your project must not exceed 400MB.

SD card configuration

  1. Go to the web based management (can be accessed by typing the IP address of the controller in a browser), and under Security and SD card ensure the Support external SD Card is selected. If it is not selected, select it and hit apply and reboot the controllerSDcard
  2. Once selected and rebooted (or if it was already selected), remove power from the AXC F 2152 (or remove it again if it was not selected). Once the AXC F 2152 is powered off, insert the SD card and turn on the AXC F 2152.
  3. Once online, deploy your entire project onto the controller (PLCnext Engineer and programs running in Linux if applicable).
  4. Once the entire project is deployed and functional with the external SD, download the zip file from http://www.github.com/plcnextusa/SDcardDeploy and extract it. A pdf of this guide is also located here for reference. (see Appendix 1 for more information, located on the PDF)
  5. Open up WinSCP and connect to the controller.
  6. Once connected, copy the PLC_move folder, the install.sh to the /opt/plcnext/ directory.
  7. Also copy over the .raucb file for the firmware of your project. This is needed to make sure the firmware of the new AXC F 2152 matches the project being deployed on the device. (see Appendix 2 for more information, located on the PDF) NOTE: If the .raucb file is not also copied onto the controller this will cause the transfer to fail if firmware does not match!sdcard2
  8.  Once all of the necessary files are on the controller, open a session in PuTTY and connect to the controller.
  9. Log into the root user, ensure you are in the /opt/plcnext/ directory. (see Appendix 3 for more information, located on the PDF)
  10. Run the below commands: chmod 777 install.sh./install.sh
  11. Now the AXC F 2152 will begin the copying process. The AXC F 2152 will reboot, and once the RUN LED is solid green the process is complete DO NOT disconnect from the AXC F 2152 until the controller reboots, and DO NOT remove the SD card until the AXC F 2152 is running after the reboot.
  12. Once this process is complete, power down the AXC F 2152 and remove the SD card.

Project deployment on a AXC F 2152:

  1. Now when you want to deploy your project on a brand new AXC F 2152, insert the SD card and power on the device. If the AXC F 2152 has been used previously, see Appendix 4 located on the PDF. The copying process can take up to 5 minutes and the AXC F 2152 will reboot once if FW is the same, and twice if the FW is different.NOTE: The AXC F 2152 must not have an existing project on it and the external SD support checkbox must be checked! (checked by default, see step 1 of SD Configuration for more details)
  2. The new AXC F 2152 will reboot on its own, and the project will automatically be deployed
  3. Once the AXC F 2152 is running after a reboot, power off the controller and remove the SD card.
  4. Once the SD card is removed, the AXC F 2152 can be powered back on and the project will be fully deployed.

Removing the automatic deploy from the SD card:

If you no longer need the deployment or have a new project revision, you will need to clear the SD card.

Read the entire process before executing

  1. To do so, ensure that the external SD card is supported. See step 1 of SD Configuration for more details
  2. Once the checkbox is checked and settings are applied, reboot the controller.
  3. Check the web based management to ensure that an external SD card is supported.
  4. Once that has been verified, power off the AXC F 2152.
  5. Insert the SD card, hold down the reset button, and turn on the AXC F 2152.
  6. Once the RUN and FAIL LED’s are solid, release the reset button. All LEDs will show yellow.
  7. Once the AXC F 2152 comes back online, the SD card is now cleared, and can be used for a new deployment.

Note:

The Makers Blog shows applications and user stories of community members that are not tested or reviewed by Phoenix Contact. Use them at your own risk.

Discussion

Please login/register to comment

Login/Register

Leave a Reply

Newsletter
Never miss a new article
Sign up for the newsletter
Never miss news about PLCnext Technology
Get interesting content via newsletter four times a year
Receive exclusive information before all other users