The K8056 interface board from Velleman on Linux

De MicElectroLinGenMet.

Sommaire

The K8056 interface board from Velleman on Linux

(Page en Anglais car accessible du site velleman.be)


The Velleman K8056 kit is a relay card can be used in several ways :
Stand alone card, addressed by switches or open collector outputs or remote controlled through RS232.
In option remote controlled using RF (radio frequency)

See k8056 manual on Velleman web site for details
http://www.velleman.be/fr/en/product/view/?id=351282

Image:k8056.jpg


Assembly manual: k8056_illustrated_assembly_manual.pdf



Specifications

  • 8 high quality relay contacts: 5A/230Vac max.
  • relay outputs are transient suppressed using VDRs
  • LED confirmation on each relay contact
  • 8 drive inputs to use with open collectors or regular switches
  • RS232 input to drive the card with computer or terminal: baud rate: 2400, no parity, 8 data bits, 1 stop bit, high or low impedance selection (10K or 1K)
  • optional RF driving possibility using RX433 type module (not simultaneous with RS232) together with K8058 eight channel RF remote control
  • power output: unregulated 12Vdc / 200mA
  • power supply: 12Vac / 500mA (including 12V output)
  • diagnostic software downloadable from our site (For Windows only)
  • dimensions: 160 x 107 x 30mm (6.3" x 4.2" x 1.2")


Linux version program

You can find on this page a simple programme to control The Velleman K8056 kit relay card on Linux machines.

  • The latest version of k8056 program (V20060928) is k8056_20060928.tgz (Some changes in the printing of usage was added by Mårten Persson / sm7syx).
  • The old version of k8056 program: k8056_20051007.tgz
  • In the other hand, Joerg Breitbart send me a little python class for easier access of the K8056 relay card. It works under Linux and under Windows as well, he has tested it on SuSE 9.3, SuSE 10.2, Debian unstable and WindowsXP: relaycard.zip


Usage of the program k8056:


$ ./k8056 -h

k8056  is a program for controlling the 'Velleman K8056' RS-232 I/O card

Usage:   k8056 [-h] [-v] [-a card_address] [-d device] [-S|-C|-T relay#] [-B relay_status] [-A new_address] [-E|-D|-F]

        -h                : this help
        -v                : verbose
        -d device         : Rs232 device, default /dev/k8056 (To do: ln -s /dev/ttyS0 /dev/k8056 for example)
        -a card_address   : Address of the card (1..255) in decimal
        -S|-C|-T relay#   : Instructions to set/clear/toggle a relay number ('1'..'9')
        -A new_address    : Set the new address of the card (1..255)
        -B relay_status   : Set the eight relay with relay_status byte (1..255)
        -E|-D|-F          : Emergency stop / Display address / Force address to 1

        ** Command examples **
        k8056 -v -E        : Emergency stop all relays cards (with verbose).
        k8056 -v -S6       : Set relay #6 (with verbose).
        k8056 -v -C5       : Clear relay #5 (with verbose).
        k8056 -v -T5       : Toggle relay#5 => set relay #5 (with verbose).
        k8056 -B 127       : Clear relay #1, Set relay #2..8
        k8056 -a 2 -d /dev/ttyS14 -S1      : Set relay #1 on card address 2 and device /dev/ttyS14.

if that does not work with long RS232 cable or in wireless operation, it is possible to increase the 'k8056_trame_number' variable in source code to get better use.


Technical Description

  • Port RS232 is configure with this setting: 2400/8/n/1
  • To control the k8056 card, the correct sequence needs to be send like this:
    • Ascii code 13
    • card address (1..255)
    • Instruction (see below)
    • Address (1..255), relay #('1'..'9') or 0 (for -E|-D|-F commands)
    • checkum, it is the 2-complement of the sum of the 4 previous bytes + 1.
  • Instructions:
    • 'E': Emergency stop all cards.
    • 'D': Display address of all cards in a binary fashion (LD1:MSB, LD8:LSB)
    • 'S': Set a relay, followed by relay # ('1'..'9' in ASCII), 9 for all relay.
    • 'C': Clear a relay, followed by relay # ('1'..'9' in ASCII), 9 for all relay.
    • 'T': Toggle a relay, followed by relay # ('1'..'8' in ASCII).
    • 'A': Change the current address of a card, followed by the address (1..255)
    • 'F': Force all cards address to 1 (default)
    • 'B': Send a byte, Allows to control the 8 relays in 1 byte (LD1:MSB, LD8:LSB)


Examples of command:

Program tested on Linux Debian testing and unstable

k8056 -v -E			: Emergency stop all relays cards (with verbose).
k8056 -v -S6			: Set relay #6 (with verbose).
k8056 -v -C5			: Clear relay #5 (with verbose).
k8056 -v -T5			: Toggle relay#5 => set relay #5 (with verbose).
k8056 -B 127			: Clear relay #1, Set relay #2..8
k8056 -a 2 -d /dev/ttyS14 -S1	: Set relay #1 on card address 2 and device /dev/ttyS14.


Comments

k8056 is under GPL
I'm not a professional programmer.
It is supplied 'as-is' i.e. no guarantees are made, no responsabilities are takes.
 !!!!! Use at your own risk !!!!!


Thanks to Velleman compagny for their programming examples.


PCB and shematic of the card





20 août 2005