Ladder Logic Compiler
This node.js package provides methods for compiling and decompiling ladder logic programs.
Table of Contents
Installation
To install this application using the node.js package manager, issue the following commands:
npm install git+https://github.com/bakerface/ll.git
ll.compile
Below is an example of how to use the compiler.
var ll = ;var program = ll;console;/*[ [ 'in', 'ESTOP' ],[ 'not' ],[ 'in', 'STOP' ],[ 'not' ],[ 'and' ],[ 'in', 'START' ],[ 'in', 'RUN' ],[ 'or' ],[ 'and' ],[ 'out', 'RUN' ],[ 'in', 'RUN' ],[ 'out', 'MOTOR' ] ]*/
ll.decompile
Below is an example of how to use the decompiler.
var ll = ;var program ='in' 'ESTOP''not''in' 'STOP''not''and''in' 'START''in' 'RUN''or''and''out' 'RUN''in' 'RUN''out' 'MOTOR';console;/*|| ||||--[/ESTOP]----[/STOP]----+--[START]--+----(RUN)--|||| | | |||| +--[RUN]----+ |||| ||||--[RUN]----(MOTOR)-------------------------------|||| ||*/