AnthonyMujic

AnthonyMujic

ladder_parser - ladder logic parsing with Nx

ladder_parser

I don’t have a computer science background, so I’m not sure if there is a better way of doing this, but I had a great time parsing ladder logic using Nx.

Ladder logic is a graphical programming language for PLCs (programmable logic controllers) that was designed to mimic electrical schematics. Ladder logic is popular in industrial settings and has been for decades. I thought it would be useful to be able to transform ladder logic into Elixir.

The solution I settled on was to convert the text that represents a rung to a matrix, then scan the matrix looking for certain symbols.

Not sure if there are many control systems engineers in the elixir community, but hopefully someone finds this approach useful.

First Post!

cmo

cmo

Hi @AnthonyMujic. I’m a control systems engineer too :smiley:. I’ve seen some talks on creating a web based IDE and IEC 61499 implementation.

Question: what PLCs use this ACSII format for ladder logic? I’m used to Rockwell stuff, i.e writing XIC XIO OTE etc. Do you know if IEC 61131 defines a standard for the textual representation?

Last Post!

AnthonyMujic

AnthonyMujic

Hi @cmo, I’m not sure if IEC 61131 defines a standard for the textual representation. The ASCII format used in the example is from a Siemens Simatic 505 PLC. Rather than saving as text or XML as can be done with Allen Bradley PLCs, the only option close on a 505 is to ‘output as text’.

Where Next?

Popular in Announcing Top

Crowdhailer
Raxx is an alternative to Plug and is inspired by projects such as Rack(Ruby) and Ring(Clojure). 1.0-rc.1 is now available. To use it re...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 19834 141
New
devonestes
Introducing assertions, the library that helps you write really great test assertions! GitHub: GitHub - devonestes/assertions: Helpful a...
New
kevinlang
Hey all, We have made an Ecto3 Adapter for SQLite3, ecto_sqlite3! We have successfully on-boarded the full suite of integration tests (...
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 10719 134
New
bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
384 14553 119
New

Other popular topics Top

hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement