Inhaltsverzeichnis

Free Signals

Overview

Free Signals is a power logic control (PLC) in the works. It has some unique features:

Documentation

Requriements - What do I need?

Hardware

Software

Current State / Download

The Modbus IO connector and the core system is completed. We can connect an arbitrary number of bus couplers, register events on digital/analog inputs and control digital/analog outputs. Timer can be used. The code examples below are working.
The web programming interface needs yet to be done, but this is not vital anyway.

Code is available at Bitbucket. Bitbucket is also the place to get in contact.

Code Examples

A latching relay in Freesigs / Lua

-- First give the in- and outputs speaking names:
button1 = DI(0,0) -- digital input #0 on bus coupler #0
button2 = DI(0,1) -- digital input #1 on bus coupler #0
lamp    = DO(0,0) -- digital output #0 on bus coupler #0
-- A latching relay (impulse relay, Stromstoßschalter) with 2 inputs
 
-- Function to control the relay output:
function ctrl_latch_relay()
    lamp:toggle() -- just invert the output
end
 
-- Register the function to be called when button1 is pressed:
button1:on_rise(ctrl_latch_relay)
 
-- Register the function to be called when button2 is pressed:
button1:on_rise(ctrl_latch_relay)

The same, but shorter

button1:on_rise(function() lamp:toggle() end)
button2:on_rise(function() lamp:toggle() end)

As you can see, two lines of code are enough to implement a latching relay with Freesigs.

For comparison: Traditional PLC code

# Check if button 1 was pressed:
A  button1
AN button1_old
=  button1_pressed

# Check if button 2 was pressed:
A  button2
AN button2_old
=  button2_pressed

# Switch light on:
A  button1_pressed
O  button2_pressed
AN lamp
S  lamp

# Switch light off:
A  button1_pressed
O  button2_pressed
A  lamp
R  lamp

# Save current state of button1 for next cycle:
A  button1
=  button1_old

# Save current state of button2 for next cycle:
A  button2
=  button2_old

What comes next