PLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

 

 How to create a Blog Entry

Find user stories of interesting ideas and solutions in this blog.
Note: The Makers Blog shows applications and user stories of community members that are not tested or reviewed by Phoenix Contact.

For questions, please go to the FORUM section and create a new entry there.

Want to add your own solution here? Just login as a registered user and click the "Create Blog entry" button. Find a short intro video by clicking the "How to create a blog entry" button. If you experience any problems with editing or publishing please contact us at This email address is being protected from spambots. You need JavaScript enabled to view it..


This demo projects would like to be an easy way to implement an automatic startup of the Axioline configuration on the local bus of the PLC Next.

The project has been developed entirely in IEC 61131 to help developer who are not used to C++ or other HighLevel languages.

To do so I used the procedure for the bus startup found in Bus Conductor (https://github.com/PLCnext/BusConductor) and I trasposed it in IEC 61131.

Prerequisites

Libraries:

  • PLCnext Controller
    You should already find it in the default path for PLCNext Eng library (C:\Program Files\PHOENIX CONTACT\PLCnext Engineer 2020.0\Libraries) as it comes with the software installation.

The projects has been tested with:

  • PLCNext Engineer 2020.0.1
  • AXC F 2152 FW 2020

It is a normal PLCNext project, so you just need to know how to download a project with PLCNext Engineer ;)

Functionalites Description

In the project you will find 2 function blocks:

  • InitAxio
    It will simply startup the connected bus accepting the whole physical configuration.
  • InitAxio_AutoConfig
    It starts the configuration as the other block but it will give also the list of connected modules.

To get informations from the modules, I used PDI objects, please refer to the Axioline manual to get more informations about them.

The information given by InitAxio_AutoConfig are:

  • DeviceFamily  [STRING58] -> The module type (analog/digital, input/output, others)
  • OrderNumber  [STRING32] -> The order number of the module
  • ProductName [STRING32] -> The product name of the module
  • PD_Length  [UINT] -> The number of words of Input process data of the module (Please consider that axioline modules have the same dimension for PDIN and PDOUT)

This properties has been choosen because I thought they could be the minimum information you may need for an easy use of the bus, however it is possible to add (or remove) properties reading the desired PDI object.

Example

Project Description

The project's structure is quite simple

Project Structure

Software side, the project contains a single Cylic task (100ms) with the 2 available function blocks.
Please notice that both the blocks need to be used in a Cyclic Task.

Hardware side, you can see the dummy module AXL F physcial; this module is needed for the dynamic bus configuration.
It provides 2 arrays that contains all the process data produced and consumed by the modules.

Main Program

The Main program contains the two available function blocks

Main Program

 

As you can see, there is no need of particular configuration to use these FBs.

Please noticed that you can use just one of them at one time.

 

InitAxio

The function block follow different phases

InitAxioPhases :

  1. Init
  2. ResetDriver
  3. CreateConfiguration
  4. ReadLocal_IO
  5. GetNumberOf_IO
  6. ReadUserConfiguration
  7. Load_PD_Mapping
  8. StartDataTransfer
  9. End

As already mentioned I copied these steps from C++ Bus Conductor library, they are the necessary steps for the Axiobus startup.

InitAxio_AutoConfig

This function block is quite the same of the previous one but it introduces a step before the End step:

InitAxioPhases :

  1. Init
  2. ResetDriver
  3. CreateConfiguration
  4. ReadLocal_IO
  5. GetNumberOf_IO
  6. ReadUserConfiguration
  7. Load_PD_Mapping
  8. StartDataTransfer
  9. ReadPhysicalConfiguration
  10. End

During the Step 9 the function block reads the properties of every module found in the configuration using PDI read commands.
Also the Step 9 is developed in phases to make it easier to modify.

 

Possibilities

The demo project provides just few tools that might help you to develope more articulated dynamic configurations.

You can for example compare the list of modules read with a desired configuration (for example simply looking at the product numbers) and then choose to prevent the use of all process datas or use just a part of them.

You can implement routines for dynamic configuration of connected modules (specially for analog modules).

Or you can use the process data length to dynamically change the dimension of a module (e.g. if you replace a 16DI with a 32DI module).

Or it can just help you to implement a dynamic bus configuration in your IEC 61131 project.

 

Repository

https://github.com/griboldi/Dynamic-Axiobus-Configuration

 

 

 

 

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.

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.

I would like to describe two different ways to remote debug a .Net Core 3.0 application with VS Code on a PLCnext target. In this post I'm using Debian 9 on my development machine and an AXC F 2152 with version: PLCnext Linux 2020.0.

  1. Start and debug your remote application (Press "F5" and debug)
  2. Attaching to remote processes

Before we could start to remote debug at our target, we have to prepare two different things. The first one is to set up the remote debugger and the second one is to enable an SSH key based authentication to the controller. The tutorial is based of two posts in the Makers Blog.

How to access the PLCnext web server (HTTP) remotely using IXON Cloud

IXON developed Cloud Access so you can easily access your machine's HTTP(S) server without requiring a VPN connection. This enables you to access your machine's servers on any mobile and desktop device with an internet connection.

Access and control the PLCnext webserver directly and securely from your browser. No additional software needed. Because it runs via IXON's worldwide VPN network, a speedy and seamless connection is guaranteed.

Written by: Damian Bombeeck
Date: 10 januari 2020


Summary

In this tutorial I will show you how to connect to- and use a cloud-based database while on your PLCnext AXCF 2152 controller. We will use Microsoft Azure as the cloud-service provider and perform queries using HTTP requests. These requests will be performed in a thread so they won’t affect the real-time system. I’ll go through the different steps to take and explain why these steps are needed, furthermore I’ll include all used code and the side-notes concerning the use of Azure with PLCnext and HTTP requests in general. The tutorial is mainly focused on C++, IEC61131-3, JSON and SQL and will not include languages as C#, python or Java.

Page 1 of 10