Shop OBEX P1 Docs P2 Docs Learn Events
Been gone since 2018 — came back with a PLC runtime that runs on the P2 — Parallax Forums

Been gone since 2018 — came back with a PLC runtime that runs on the P2

fixmaxfixmax Posts: 97
edited 2026-04-04 20:07 in PASM2/Spin2 (P2)

Hey folks,
fixmax here.
Some of you may remember me — probably not — but I've been lurking around here since 2010, back when I was asking Parallax for more P2 YouTube videos before the chip even existed. 😄
Last post was 2018. Life happens.

Well, I've been heads down for the last several months on a project and I really think it's going to be a good thing — something I've been wanting for a long time. The P2 is a big part of what this will end up being — it became a very important part of what I built.
I should mention — I've been building this with Claude Code since November. 200k+ lines of Go in a few months. The AI age is real, folks.

That being said, I built a soft PLC runtime called GoPLC. It's a full IEC 61131-3 ST code runtime written in Go. Think CoDeSys but without the licensing headaches, running as a single binary under 60MB on basically anything. I've been messing with CoDeSys/Pi integrations with the Propeller for a LONG time — this is that idea, taken all the way.
I chose Go for a reason — single binary deployment, compiles in seconds, true concurrency built in from the ground up, and garbage collection that actually behaves. For a runtime that needs to be deterministic and deployable anywhere, it was the obvious choice for me.

The P2 HAL
The P2 HAL (hardware abstraction layer) uses a Firmata-style CMD byte architecture. You write Structured Text in GoPLC's web IDE and it drives P2 hardware directly — servos, OLEDs, sensors, whatever you've got.
I'm going to demo GoPLC on a little animatronic dachshund I built — 4 servos, OLED eyes with naturalistic blink patterns, all driven by ST code talking to a P2. Deterministic IO front end on the P2, full industrial PLC runtime behind it. Perfect storm and fun to play with. 😄

The Runtime

14 industrial protocols, 25 client/server implementations (Modbus TCP/RTU, EtherNet/IP, OPC UA, BACnet, DNP3, and more)
Native AI integration via MCP
Boss/minion clustering
Web IDE with Monaco editor
Single binary under 60MB — runs on Raspberry Pi up to enterprise hardware. My preferred is on Linux - but I've also run it a lot in Docker it runs great - especially with it built with the integrated Node Red

I just launched a crowdfunding campaign — officially starts Monday 4/6/26 but the prelaunch page is live now if you want to take a look.

Indiegogo link
https://indiegogo.com/en/projects/fixstuff555/goplc-the-plc-runtime-built-for-the-ai-age

GitHub Showcase
https://github.com/fixstuff/GOPLC-Showcase/tree/main

Happy to dig into the P2 HAL architecture, CMD byte design, or how ST maps to P2 hardware. Good to be back.

PS: I would love to buy some P2 FLIP modules — P2 Edge is good but bulky for me. 😄
fixmax (James Belcher)

Comments

  • fixmaxfixmax Posts: 97
    edited 2026-04-04 20:16

    PS: I also plan to support the P1 and even Stamps (I have to dig through some stuff to see if I have my old collection around) - I would use a $4 USB-C RP2040 as a bridge for this probably on the stamp for programming.

  • RossHRossH Posts: 5,739
    edited 2026-04-05 04:16

    @fixmax

    That being said, I built a soft PLC runtime called GoPLC. It's a full IEC 61131-3 ST code runtime written in Go. Think CoDeSys but without the licensing headaches, running as a single binary under 60MB on basically anything.

    A 60MB binary running on the Propeller2? How? Also, what is a P2 FLIP module?

    And you also want to support the Propeller 1? How?

    I guess I must be missing something here.

  • evanhevanh Posts: 17,178

    @RossH said:
    A 60MB binary running on the Propeller2? How? Also, what is a P2 FLIP module?

    I was a little gob smacked too, then I noticed it actually runs on a Raspberry Pi. The Prop2 is performing as a remote I/O module commanded by the Pi.

  • evanhevanh Posts: 17,178

    One thing I will say is that unless the programming environment is Ladder, you've already failed the primary job of a PLC. And that is to make the top level machine control logic readable for electricians.

  • A P2 flip may need to be a bit wider. I thought the P2 market was lacking a cheap, breadboard compatible board. It would be cool to make P2 flip and put it in the LameStation. Anything is possible with hand assembled pins. But it also should be usable for low volume production. I decided to target the pico form factor instead. The castellated edges are cheaper and likely more reliable than SMT pin headers. Not in production but designed to be a cheap 4 layer board without via-in-pad.
    https://forums.parallax.com/discussion/176194/sunnyside-the-flip-compatible-p2-module#latest The name is because the P2 will staring right back at you, aka sunny-side-up.

    These PLCC like modules are available.
    https://www.rayslogic.com/Store/P2Store.html

    A cool board, not sure on availability.
    https://forums.parallax.com/discussion/comment/1570028/#Comment_1570028

  • Yeah, the PLC comment about ladder is pretty true. Probably the bulk of PLC programmers are ladder or function block only. But there is a smaller group of higher level PLC guys that work only in ST. Its like anything else. I plan on adding ladder but getting the engine running was more important for me performance wise. There is an open source PLC project called Open PLC and it has ladder but performance is abysmal. My runtime right now supports 15-20 industrial protocols like S7, Modbus, Ethernet IP, bunch of others. Performance is my main goal right now since my eventual target is virtualized environments under Docker or Kubernetes. A couple good examples of performance is Ive run up to 7000 tasks at 50ms scan times, Ive run 400+ runtimes in a docker cluster, and as many as 5000 simultaneous Modbus server client connections. All different tests but thats the sort of performance Im shooting for until it breaks.
    For some perspective, that 7000 independant deterministic tasks with their own scan times. The 5000 modbus clients talking to another GoPLC instance with 5000 Modbus servers was 100 holding registers IN and 100 holding registers OUT.

    The P2 is a very complimentary piece to this. GoPLC is great at Linux RT kernal speeds say down to the hundreds of microsecond (sub millisecond) but not so go down below that at the hardware level. I push the compiled signed binary into the P2 at bootup so that means I can have multiple binaries (ie) with the GoPLC distribution, since its a small part. The idea is different behavior on demand. Its only about a second and then its running (3Mbaud). The protocol has a cyclic component if you just want dumb I/O and a acyclic component for the good stuff. I have that to handle 8 or 16? Servos coordinated, I can talk to 8 or 16 serial channels full duplex and have 2 independant i2c channel each connected to a oled display for the eyes. Of course i added a bunch of other cool features like encoders and freq measurement, pwm, di do, dac, adc. And to top it off i have a 2x16 lcd screen for status. I have tried it in a ton of builds now - I even have a SNAP build for Bosch Rexroth Ctrlx Core PLC running Ethercat and talking over the Bosch datalayer to other apps. This one I will be looking to expand on commercially hopefully. I was working on SFC language last week which is a graphic state machine language. Very cool. I built a bunch of machines with it on another PLC years ago and loved it. A cool feature I added this week is webhooks. Its event driven API endpoints that lets you debug events after they occurred up to 90 days. Added OPC Ua pub sub earlier this week. This protocol is very interesting. Of course its all in Go.

    https://youtube.com/shorts/hxJ3VOZ3-m0?si=sG6gwkusN0fd2k5p![] <- cant figure out youtube links on my iphone

    (https://forums.parallax.com/uploads/editor/ca/a4t3cklzeulq.jpeg "")

    I will be adding the flip. I love the package. Lots of folks still using P1. Im going to add my P1 developer board which should be fun. I might post on here again for that.

    Later,
    Jb

  • evanhevanh Posts: 17,178

    Then it's become an industrial controller that needs a specialist support team. Calling it a PLC is misguided. PLCs are intended for electricians.

    I've spent a lot of time on motion controllers, with expansion modules, that often have Basic is their programming language. No one claims those to be a PLC even though they can do all the same work.

  • evanhevanh Posts: 17,178

    I once programmed something that was named as PSC. Its design looked like a typical PLC and was indeed pushed as equivalent. But it also was built around an in-house coding team who weren't trying to make it electrician readable code. They just wanted to have something rugged and easy to maintain for their team. It did not support Ladder. The singular programming language was a custom state machine system with up to, I think, 64 tasks.

    My point being the naming distinction was a good thing.


  • I got the P1 board running with GoPLC as another target. Its been a couple years since I've touched a P1 and I was able to get it going without much effort. Its very similar to the P2 interface just without the smartpins and other cool stuff the P2 has. As in the P2 version, I can take a brand new board with no code on it right out of the bag - plug it in, software downloads and starts running. GoPLC is hosting a blob binary for this one as well.
    This testing was for the Alarming, Historian, and Webhook events integration. I had a Ping sensor being logged to the historian and had an Alarm to trigger when the sensor distance got too close, where it tripped the alarm and fired off the Webhook (which was an MQTT publish to a broker). Going to buy some FLIP modules now probably. I also ran it on a $23 Orange Pi Zero 3W SBC (1MB ram and im only at about 90MB). Right at 110ms scan, with a 2000ms startup downloading the firmware the first time.


  • I got the P1 board running with GoPLC as another target. Its been a couple years since I've touched a P1 and I was able to get it going without much effort. Its very similar to the P2 interface just without the smartpins and other cool stuff the P2 has. As in the P2 version, I can take a brand new board with no code on it right out of the bag - plug it in, software downloads and starts running. GoPLC is hosting a blob binary for this one as well.
    This testing was for the Alarming, Historian, and Webhook events integration. I had a Ping sensor being logged to the historian and had an Alarm to trigger when the sensor distance got too close, where it tripped the alarm and fired off the Webhook (which was an MQTT publish to a broker). Going to buy some FLIP modules now probably. I also ran it on a $23 Orange Pi Zero 3W SBC (1MB ram and im only at about 90MB). Right at 110ms scan, with a 2000ms startup downloading the firmware the first time.

  • Sorry for the double post! cant delete it i guess

  • TubularTubular Posts: 4,774

    This looks interesting fixmax. I'll sign up to the campaign in coming days.

    Out of interest what do you do if you need a SCADA style mimic/display?

Sign In or Register to comment.