hvl_ccb.dev.heinzinger.base

Inheritance diagram of hvl_ccb.dev.heinzinger.base

Base classes for Heinzinger Digital Interface I/II and Heinzinger PNC power supply.

The Heinzinger Digital Interface I/II is used for many Heinzinger power units. Interface Manual: https://www.heinzinger.com/assets/uploads/downloads/Handbuch_DigitalInterface_2021-12-14-V1.6.pdf

The Heinzinger PNC series is a series of high voltage direct current power supplies. The class HeinzingerPNC is tested with two PNChp 60000-1neg and a PNChp 1500-1neg. Check the code carefully before using it with other PNC devices, especially PNC3p or PNCcap. Manufacturer homepage: https://www.heinzinger.com/en/products/pnc-serie

class HeinzingerSerialCommunication(configuration)[source]

Bases: SerialCommunication, SyncCommunicationProtocol

Specific communication protocol implementation for Heinzinger power supplies. Already predefines device-specific protocol parameters in config.

static config_cls()[source]

Return the default configdataclass class.

Returns:

a reference to the default configdataclass class

class HeinzingerSerialCommunicationConfig(terminator: bytes = b'\n', encoding: str = 'utf-8', encoding_error_handling: str = 'strict', wait_sec_read_text_nonempty: Union[int, float] = 0.5, default_n_attempts_read_text_nonempty: int = 40, port: Optional[str] = None, baudrate: int = 9600, parity: Union[str, hvl_ccb.comm.serial.SerialCommunicationParity] = <SerialCommunicationParity.NONE: 'N'>, stopbits: Union[int, hvl_ccb.comm.serial.SerialCommunicationStopbits] = <SerialCommunicationStopbits.ONE: 1>, bytesize: Union[int, hvl_ccb.comm.serial.SerialCommunicationBytesize] = <SerialCommunicationBytesize.EIGHTBITS: 8>, timeout: Union[int, float] = 3)[source]

Bases: SerialCommunicationConfig

baudrate: int = 9600

Baudrate for Heinzinger power supplies is 9600 baud

bytesize: int | SerialCommunicationBytesize = 8

One byte is eight bits long

default_n_attempts_read_text_nonempty: int = 40

increased to 40 default number of attempts to read a non-empty text

force_value(fieldname, value)

Forces a value to a dataclass field despite the class being frozen.

NOTE: you can define post_force_value method with same signature as this method to do extra processing after value has been forced on fieldname.

Parameters:
  • fieldname – name of the field

  • value – value to assign

classmethod keys() Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns:

a list of strings containing all keys.

classmethod optional_defaults() dict[str, object]

Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.

Returns:

a list of strings containing all optional keys.

parity: str | SerialCommunicationParity = 'N'

Heinzinger does not use parity

classmethod required_keys() Sequence[str]

Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.

Returns:

a list of strings containing all required keys.

stopbits: int | SerialCommunicationStopbits = 1

Heinzinger uses one stop bit

terminator: bytes = b'\n'

The terminator is LF

timeout: int | float = 3

use 3 seconds timeout as default

wait_sec_read_text_nonempty: int | float = 0.5

default time to wait between attempts of reading a non-empty text