Archive for May, 2016

SoapBox Snap version 2016.05.15 Released

With more users come more bug reports (thanks Reza!) so this release includes two useful bug fixes:

  1. A few people have been complaining about an error when compiling the ArduinoFirmware.ino sketch about the timerISR function. It only showed up on some computers. This version fixes that bug.
  2. There’s a bug where, if you link an output to an internal coil, and then delete the internal coil, the saved file can’t be opened again. This version provides a work-around where it breaks the link upon opening it, which at least lets you get to your program and fix the problem.

I’ve also added a new Up/Down Counter instruction. This instruction works a bit differently than the Count Up and Down Down timers. It counts up on the rising edge of the rung-in condition. It has a separate Count Down input which causes the internal count to decrement by 1 with each rising edge. It also has a Reset input, which sets the internal count back to zero (and it’s reset-dominant, so as long as Reset is on, it ignores the Count Up and Count Down pulses). The rung-out (or output coil) is on when the internal counter is zero, and false otherwise.

You can download the new version over at the SoapBox Snap Project Page.

No Comments

Remembering a Number in SoapBox Snap

Traditional PLCs let you peek and poke at memory addresses directly with commands like MOVE, etc. In SoapBox Snap, the ladder language is designed around a more strict Functional Programming model, but that doesn’t mean you can’t conditionally latch a number into a memory location.

Let’s examine the case where you have an analog input (A0) and you want to capture the value of A0 on the rising edge of one of the discrete inputs (pin2). The Choose Number instruction acts like a memory register if you set the second numeric input to itself:

Choose Number instruction as Memory

Take a look at how the Choose Number instruction selects value A0 when the input turns on, but otherwise chooses its own value. This creates a form of internal state, similar to a sealed in coil.

No Comments