Benutzer-Werkzeuge

Webseiten-Werkzeuge


freesigs:start

Free Signals

Overview

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

  • First of all, Freesigs is distributed under the Eclipse Public License, that means it is freely available. No dongles, no licence fees. Neither for the runtime, nor for the development tool. – Open source for automation developers.
  • Freesigs PLC user programs are written in Lua. This is a powerful and easy to use scripting language. No more awkward Structured Text or Ladder Diagrams!
    Whats more, by using a scripting language, there is no intermediate compile cycle. You can try out your code directly.
  • Freesigs doesn't need a development environment. In fact, your web browser is the IDE. This works on every computer and operation system. No need to install anything. All you need is a network connection.
  • Freesigs works event based. Even though it is possible to write traditional cyclic code, it is not recommended . Events are more flexible and effective to work with, and are more CPU friendly. Have a look at the examples below and the Free Signals API.
  • Freesigs is extensible. To cope with the multitude of different fieldbusses around, the application is split into a core process and one or more IO processes (connectors). To add support for a certain fieldbus (or any other connector type), just the IO connector needs to be written. It is not necessary to modify the core. Currently Modbus/TCP is implemented. IO connectors can be written in any language.

Documentation

Requriements - What do I need?

Hardware

  • A Computer designed to run 24/7, e.g. a SheevaPlug. Of course you can also use a PC or laptop.
    SheevaPlug
  • At least one fieldbus coupler. Eg. Wago 750-341, 750-342 or B&R BC 0087.
    Fieldbus Coupler

Software

  • A unix-like operating system, e.g. Slackware. For the SheevaPlug I recommend ARMedslack.
  • C-Compiler (GCC) and Glib
  • Optionally Google Go for some test and development utilities and probably for the web interface (later)

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

  • Web programming interface
  • Tutorial and install instructions
  • Remove Glib dependencies. This allows Freesigs to run on an embedded Linux like the Wago 750-860. With this you can use Freesigs standalone. Or you can use the Bus controller itself as controller for other bus couplers.
  • We need a live demo in the Internet
  • Create a Lua user library
  • More extensibility:
    • Possibility to work with several APIs. For this, each connector gets an API identifier assigned. Commands from an unknown API are simply forwarded to a Lua user callback. Hence the user can create new commands without changing the core.
    • Allow Lua user code to start and stop connector child processes during runtime
Cookies helfen bei der Bereitstellung von Inhalten. Diese Website verwendet Cookies. Mit der Nutzung der Website erklären Sie sich damit einverstanden, dass Cookies auf Ihrem Computer gespeichert werden. Außerdem bestätigen Sie, dass Sie unsere Datenschutzerklärung gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website. Weitere Information
freesigs/start.txt · Zuletzt geändert: 2011-11-16 11:05 (Externe Bearbeitung)

Impressum - Datenschutzerklärung