The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Lab::Instrument::TLK43 - Electronic process controller TLKA41/42/43 (SIKA GmbH)

SYNOPSIS

    use Lab::Instrument::TLK43;
    
    my $tlk=new Lab::Instrument::TLK43({ Port => '/dev/ttyS0', slave_address => 1, Baudrate => 19200, Parity => 'none', Databits => 8, Stopbits => 1, Handshake => 'none'  });

        or

        my $Bus = new Lab::Bus::MODBUS({ Port => '/dev/ttyS0', Interface => 'RS232', slave_address => 1, Baudrate => 19200, Parity => 'none', Databits => 8, Stopbits => 1, Handshake => 'none' });
        my $tlk=new Lab::Instrument::TLK43({ Bus => $Bus });

    print $tlk->read_temperature();
        $tlk->set_setpoint(200);

DESCRIPTION

The Lab::Instrument::TLK43 class implements an interface to SIKA GmbH's TLK41/42/43 process controllers. The devices have to be equipped with the optional RS485 interface. The device can be fully programmed using RS232 and an interface converter (e.g. "GRS 485 ISO" RS232 - RS485 Converter).

The following parameter list configures the RS232 port correctly for a setup with the GRS485 converter and a speed of 19200 baud: Port => '/dev/ttyS0', Interface => 'RS232', Baudrate => 19200, Parity => 'none', Databits => 8, Stopbits => 1, Handshake => 'none'

CONSTRUCTOR

    my $tlk=new(\%options);

METHODS

read_temperature

    $temp = read_temperature();

Returns the currently measured temperature, or undef on errors.

set_setpoint

    $success=$tlk->set_setpoint({ Slot => $Slot, Value => $Value })

Set the value of setpoint slot $Slot.

$Slot

The TLK controllers provide 4 setpoint slots. $Slot has to be a number of (1..4) and may not exceed the nSP-parameter set in the device (set_setpoint return undef in this case)

$Value

Float value to set the setpoint to. Internally this is held by a 16bit number. set_setpoint() will cut off the decimal values according to the value of the "dP" parameter of the device. (dP=0..3 meaning 0..3 decimal points. only 0,1 work for temperature sensors)

set_active_setpoint

    $success=$tlk->set_active_setpoint($Value);

Set the value of the currently active setpoint slot.

$Value

Float value to set the setpoint to. Internally this is held by a 16bit number. set_setpoint() will cut off the decimal values according to the value of the "dP" parameter of the device. (dP=0..3 meaning 0..3 decimal points. only 0,1 work for temperature sensors)

read_range

    $value=$tlk->read_range({ mem_addresss => (0x0200..0xFFFF || Name), MemCount => (1..4) })

Read the values of $MemCount memory slots from $mem_address on. The Address may be specified as a 16bit Integer in the valid range, or as an address name (see TLK43.pm, %fields{'MemTable'}). $MemCount may be in the range 1..4. Returns the memory as an array (one byte per field)

read_address_int

    $value=$tlk->read_range({ mem_addresss => (0x0200..0xFFFF || Name), MemCount => (1..4) })

Read the value of the 16bit word at $mem_address on. The Address may be specified as a 16bit Integer in the valid range, or as an address name (see TLK43.pm, %fields{'MemTable'}). Returns the value as unsigned integer (internally (byte1 << 8) + byte2)

write_address

    $success=$tlk->write_address({ mem_address => (0x0200...0xFFFF || Name), mem_value => Value (16 bit word) });

Write $Value to the given address. The Address may be specified as a 16bit Integer in the valid range, or as an address name (see TLK43.pm, %fields{'MemTable'}).

set_setpoint_slot

    $success=$tlk->set_setpoint_slot({ Slot => $Slot })

Set the active setpoint to slot no. $Slot.

$Slot

The TLK controllers provide 4 setpoint slots. $Slot has to be a number of (1..4) and may not exceed the nSP-parameter set in the device (set_setpoint_slot return undef in this case)

CAVEATS/BUGS

probably many

SEE ALSO

Lab::Instrument

AUTHOR/COPYRIGHT

Copyright 2010 Florian Olbrich

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.