LDMicro简介

15 篇文章 1 订阅

为了提供可梯形图和Basic语音编程的物联网模块,研究了PLC,重点是解析型梯形图,LDMicro估计是可以重点参考的。本文先简要记录一下,后续再仔细分析。

LDmicro: Ladder Logic for PIC and AVRicon-default.png?t=LA92https://cq.cx/ladder.plGitHub - LDmicro/LDmicro: This is LDmicro support repositoryicon-default.png?t=LA92https://github.com/LDmicro/LDmicro/

openplc 与 plcopen这两个不是一个东西,差别还挺大

(1)PLCopen

PLCopen | for efficiency in automationicon-default.png?t=LA92https://www.plcopen.org/

PLCopen是独立于生产商和产品的全球性协会。其宗旨是成为一个领导协会来解决该领域中有关控制编程的问题从而支持使用国际标准。PLCopen为此下设了技术和推广委员会。PLCopen的主要经济来源是会费。PLCopen支持从供应商到大专院校各个层次的会员单位。PLCopen大力支持各个领域的用户,为此它创建了附加的会员种类。PLCopen成立于1992年,总部设在荷兰。

有官网,上面还有一大推文件可下载。

(2)OpenPLC---开源实体,包括硬件和软件

感觉有两套架构

第一套--AVR,Ardunio

THE OPENPLC PROJECT | openplcproject.comAn open source alternative to automationhttps://www.openplcproject.com/

AVR OPENPLC硬件架构
OpenPLC是根据市场上实际plc的架构创建的。它是一个模块化的系统,具有扩展功能,是一个RS-485总线,用于模块之间的通信和硬件保护。
为了创建第一个OpenPLC原型,我们构建了四个板:

  • 总线板
  • CPU板
  • 输入板
  • 输出板
    在这里插入图片描述

AVR OpenPLC Firmware--提供了Ardunio工程文件,PC机端LDMicro,这个软件可以出C文件作为编译型PLC,也可以出可解析的字节码,还提供可一个解析器c程序作为参考。LDMicro还可以仿真。

这个PLC循环过程如下,其中 PlcCycle(); //run the ladder program once就是LDMicro

void OpenPLCcycle()
{
    readPLCSwitch(); //read the switch to determine the PLC status
    setStatusLeds(); //set the leds according to PLC status
    if (PLCstatus==RUN)
    {
        updateInput(); //read the state of each input card connected
        ModbusCycle(); //check modbus messages
        PlcCycle(); //run the ladder program once
        updateOutput(); //update output state of each output card connected according to the internal output buffer
    }
    else if (PLCstatus==STOP)
    {
        clearOutputs(); //certify that all outputs are turned off
        CheckSerial(); //check to see if there are any serial messages received
        ProcessMessage(); //if there are messages at the serial buffer, process them
    }
    else if (PLCstatus==HALTED)
    {
        clearOutputs(); //certify that all outputs are turned off
    }
    //verify if it's possible to clear errors
    if (errorCount > 0 && PLCstatus != HALTED)
    {
        if (millis()-lastError > ERROR_TIMEOUT)
        {
            errorCount=0;
        }
    }
    countTimers(); //special function timers
}
 

-----------------------------------------------------------------

第二套,如下,资源需求较多,暂时用不上,先不分析了。

OPENPLC软件架构

 这个runtime对资源需求应该不少,ardunio好像只能作为slave设备,不能运行完整runtime。对吧?

 

Editor---这个应该是最新的,

 

The Windows installer was created using source code from OpenPLC Editor repository in April 17, 2019

 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值