Giter VIP home page Giter VIP logo

ladder-parser's Introduction

ladder-parser

Library for parse and simplify ladder diagram

BUILD

LIMITATIONS

  • An output must be the end of line or have only ORs
  • Node in first line must be the most left

TODO

EXAMPLE

- rung -
    +-------------{ton%4_in}                               
 A--+             {ton%4_q}---------+---C---+------+--Y--Q 
    |     [10ms]--{ton%4_pt}        |       |      |       
 D--+                               +--/E---+      |       
    |                               |       |      |       
 F--+                               +---G---+      |       
    |                               |              |       
    |              /{mux%1_out}-----+              |       
    +---------------{mux%1_in0}                    |       
 /I---------P-------{mux%1_in1}                    |       
 $a1----------------{mux%1_in2}                    |       
 T------------------{mux%1_in3}                    |       
 _Q-----------------{mux%1_S1}                     |       
                                                   |       
 K-----L---M---/N--------------------+-----/X------+       
                                     |             |       
 $b-----{gt%2_in0}                   |             |       
 $c--+--{gt%2_in1}                   |             |       
     |  {gt%2_out}---+               |             |       
     |               |               |             |       
     |               +-{eq%3_en}     |             |       
 V---+-----------------{eq%3_in1}    |             |       
                                     |             |       
 W---+-----------------{eq%3_in2}    |             |       
     |                 {eq%3_eno}----+----$b       |       
     |                 {eq%3_out}------------------+       
 R---+-----{mux%1_S0}                                      
                                                           
    NODE: _N_1 = A | D | F 
          postfix: A D or F or 
    NODE: _N_6 = $c | V 
          postfix: $c V or 
FUNCTION: ton%4 = in::_N_1 pt::[10ms] 
FUNCTION: gt%2 = in0::$b in1::_N_6 
    NODE: _N_8 = W | R 
          postfix: W R or 
FUNCTION: mux%1 = in0::_N_1 in1::(!I & P) in2::$a1 in3::T S1::_Q S0::_N_8 
FUNCTION: eq%3 = en::{gt%2_out} in1::_N_6 in2::_N_8 
    NODE: _N_5 = (K & L & M & !N) | {eq%3_eno} 
          postfix: K L and M and N not and {eq%3_eno} or 
    NODE: _N_4 = ((({ton%4_q} | !{mux%1_out}) & C) | (({ton%4_q} | !{mux%1_out}) & !E) | (({ton%4_q} | !{mux%1_out}) & G)) | (_N_5 & !X) | {eq%3_out} 
          postfix: {ton%4_q} {mux%1_out} not or C and {ton%4_q} {mux%1_out} not or E not and or {ton%4_q} {mux%1_out} not or G and or _N_5 X not and or {eq%3_out} or 
  OUTPUT: $b = _N_5 
          postfix: _N_5 
  OUTPUT: Q = (_N_4 & Y) 
          postfix: _N_4 Y and 

ladder-parser's People

Contributors

hiperiondev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.