在基于Linux的WAGO PFC200 PLC上与CoDeSys程序通信 [英] Communicate with CoDeSys program on a Linux-based WAGO PFC200 PLC

查看:1853
本文介绍了在基于Linux的WAGO PFC200 PLC上与CoDeSys程序通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前熟悉PLC,特别是WAGO 750-8206 PLC。它提供了一个linux操作系统,可以运行CoDeSys程序。有一些I / O模块连接到控制器:750-530,750-430和750-600。我想知道的是:



是否可以编写一个在PLC上运行的C ++ linux应用程序并获取/设置数字输入和输出? p>

更好:我可以编写一个与I / O通信的CoDeSys程序,并处理所有逻辑,同时可以通过C ++ linux程序访问?这个想法是这样的:我想让CoDeSys程序检查两个数字输入。如果两者都为高,则应将变量设置为定义的值。 linux应用程序应该能够读取该变量并进行进一步处理(例如将JSon数据发送到服务器或类似的东西)。



此外,我需要能够当linux应用程序接收到触发命令的消息时,将命令从linux应用程序发送到CoDeSys程序以切换数字输出(或在模拟输出等上设置值)。



对这个主题的任何想法和评论都非常感谢,因为我是这个主题的全新。提前感谢!

解决方案

您可能需要的答案



实际情况已更改到上一个答案的相反



WAGO板支持包和文档积极支持您对PLC200线进行更改和扩展。特别是WAGO 750-8206和17(截至2016年3月)其他PLC:



wago.us - >产品 - >自动化组件 - >模块化WAGO -I / O-SYSTEM,IP 20(750/753系列)



您需要做的是与他们取得联系,用于PLC200线的板支持包(BSP)。



我引用上一个答案并标记更改,我的添加内容是粗体


剧情




  • 你可以攻击PFC200并获得自定义二进制文件吗? 可能 绝对是的。 只要程序是在Linux-3.6.11内核和glibc-2.16上运行的内容并且是为armhfAPI编译的,任何现有的ARM应用程序,只要你也复制它使用的库,

  • 这样容易还是快速? 是的,如果你没有对Linux命令行的恐惧。它与使用提供的C库的板支持包(BSP)提供的交叉编译器一样简单,然后运行此程序将您的程序传输到PFC的闪存并运行它:

     scp your-program root @ PFC200:/ usr / bin 
    ssh root @ FC200 / usr / bin / your-program

    当然,您可以使用Eclipse CDT与PFC200的交叉工具链,做远程运行和调试。


  • 将来会发生这种变化吗? 也许。请记住,PFC200在北美是相当新的。 它已经出现在2014年9月


公开HOWTO 建立FORTE Wago 描述了如何使用初始BSP来运行FORTE,它是 4DIAC (链接:sf.net/projects/fordiac)的IEC 61499运行时环境,这是开源PLC环境允许以供应商中立的方式实现工业控制解决方案。 4DIAC实现IEC 61499扩展IEC 61131-3,更好地支持控制器到控制器的通信和动态重新配置。



如果你想访问KBUS / Os),你必须知道目前只有一个应用程序可以负责KBUS。



因此,CODESYS或FORTE,或者你自己的KBUS应用程序可以



2015年的BSP有许多示例,演示如何使用PLC200的所有I / O(KBUS,CAN,MODBUS,PROFIBUS以及PFC200上的开关和LED)。内核以及所有内核驱动程序和其他开源组件的源代码在板级支持包(BSP)中提供和编译。



但是,库的源不提供由WAGO从头开发的,不基于GPL /开放源代码的工具:这些工具包括应用设备接口(ADI)/设备抽象层(DAL)库,它们使用CANopen,PROFIBUS-Slave和KBus使用连接到主PLC单元的所有PLC I / O模块)



虽然CANopen使用标准的Linux Socketcan API与内核通信, socketcan程序使用提供的libsocketcan,KBus API是一个WAGO特定的发明,如果你不想使用WAGO的DAL访问PLC的所有电气I / O,你必须做一些逆向工程



但是,如果你使用CODESYS,有一个codesys_lib_demo-0.1示例库显示如何提供一个库供CODESYS使用。


I'm currently getting familiar with PLC's, the WAGO 750-8206 PLC in particular. It offers a linux OS and can run CoDeSys programs. There are some I/O modules attached to the controller: 750-530, 750-430 and 750-600. What I would like to know is this:

Is it possible to write a C++ linux application that runs on the PLC and gets/sets the digital inputs and outputs?

Even better: can I write a CoDeSys program that "talks to the I/O's" and handles all the logic and at the same time can be accessed by a C++ linux program? THe idea is this: I would like the CoDeSys program to check for let's say two digital inputs. If both are high, a variable should be set to a defined value. The linux application should be able to read that variable and conduct further processing (such as sending JSon data to a server or similar).

Also, I would need to be able to send commands from the linux application to the CoDeSys program in order to switch digital outputs (or set values on analog outputs etc) when the linux application receives a message that triggers the command.

Any thoughts and comments on this topic are greatly appreciated as I am completely new to this topic. Thanks in advance!

解决方案

The answer you might want

The actual situation has changed into the opposite of the previous answer.

WAGO's recent Board Support Packages and Documentation actively support you in making changes and extensions to the PLC200 line. Specifically the WAGO 750-8206 and 17 (as of March 2016) other PLCs :

wago.us -> Products -> Components for Automation -> Modular WAGO-I/O-SYSTEM, IP 20 (750/753 Series)

What you have to do is get in touch with them and ask for their latest Board Support Package (BSP) for the PLC200 line.

I quote from the previous answer and mark the changes, my additions are in bold.

Synopsis

  • Could you hack a PFC200 and get custom binaries executed? Probably Absolutely yes. As long as the program is content to run on the Linux-3.6.11 kernel and glibc-2.16 and is compiled for the "armhf" API, any existing ARM application, provided you also copy the libraries it uses as well, will just run without even compiling it specifically for the PFC200.
  • Would it be easy or quick? No. Yes, if you have no fear of the Linux Command line. It is as easy as using the Cross Compiler provided by the Board Support Package (BSP) with the provided C-libraries and then run this to transfer your program to the PFC's flash and run it:

    scp your-program root@PFC200:/usr/bin
    ssh root@FC200 /usr/bin/your-program

    Of course, you can use Eclipse CDT with the Cross Toolchain for the PFC200 and configure Eclipse to do do remote run and debug.

  • Will this change in the future? Maybe. Remember that PFC200 is fairly new in North America.It has, PFC200 has appeared in September 2014

The public HOWTO Building FORTE for Wago describes how to use the initial BSP to run FORTE, which is the IEC 61499 run-time environment of 4DIAC (link: sf.net/projects/fordiac ), an open source PLC environment allowing to implement industrial control solutions in a vendor neutral way. 4DIAC implements IEC 61499 extending IEC 61131-3 with better support for controller to controller communication and dynamic reconfiguration.

In case you want to access the KBUS (which talks to the I/Os) directly, you have to know that currently only one application can be in charge of KBUS.

So either CODESYS, or FORTE, or your own KBUS application can be in charge of the KBUS.

The BSP from 2015 has many examples and demos how to use all the I/O of the PLC200 (KBUS, CAN, MODBUS, PROFIBUS as well as the Switches and LEDs on the PFC200 directly). Sources for the kernel and with all kernel drivers and the other Open Source components is provided and compiled in the Board Support Package (BSP).

But, the sources for the libraries and tools developed from scratch by WAGO and are not based on GPL/Open Source code are not provided: These include the Application Device Interface(ADI)/Device Abstraction Layer(DAL) libraries which do CANopen, PROFIBUS-Slave and KBus (which is used all PLC I/O modules connected to the main PLC unit)

While CANopen is using the standard Linux Socketcan API to talk to the kernel and you could just write a normal socketcan program using the provided libsocketcan, the KBus API is an WAGO-specific invention and there, you'd have to do some reverse-engineering if you'd not want to use WAGO's DAL for accessing all the electrical I/O of the PLC, but the DAL is documented and examples how to use it are provided in the BSP.

If you use CODESYS however, there is an "codesys_lib_demo-0.1" example library which shows how to provide a library for CODESYS to use.

这篇关于在基于Linux的WAGO PFC200 PLC上与CoDeSys程序通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆