Delta Elektronika Interface

Only the features of the available that are required by Zahner-Elektrik have been implemented.

TCP/IP Interface

class DeltaConnection

Class to handle the connection to the Delta Elektronika power supply connection.

connect(ip, port)

Connect to Delta Elektronika power supply.

Parameters
  • ip – The hostname or ip-address of the Delta Elektronika power supply.

  • port – The port.

Returns

True on success, False if failed.

Return type

bool

disconnect()

Close the connection.

isConnected()

Check if the connection to the Delta Elektronika is open.

Returns

True if connected, False if not.

Return type

bool

sendTelegram(payload, timeout=None)

Send a telegram/data.

Parameters
  • payload – The actual data which is being sent. This can be a string or an bytearray.

  • timeout – The timeout for sending data in seconds, blocking at None.

waitForBinaryTelegram(timeout=None)

Block infinitely until the next Telegram is arriving.

If some Telegram has already arrived it will just return the last one from the queue.

Parameters

timeout – The timeout for sending data in seconds, blocking at None

Returns

The response from the device or an empty bytearray if someting went wrong.

Return type

bytearray

waitForStringTelegram(timeout=None)

Block infinitely until the next Telegram is arriving.

If some Telegram has already arrived it will just return the last one from the queue.

Parameters

timeout – The timeout for sending data in seconds, blocking at None

Returns

The last received telegram or an empty string if someting went wrong.

Return type

string

sendStringAndWaitForReplyString(payload, timeout=None)

Convenience function: Send a telegram and wait for it’s reply.

If a timeout or a socket error occurs an exception is thrown.

Parameters
  • payload – The actual data which is being sent. This can be a string or an bytearray.

  • timeout – The timeout for sending data in seconds, blocking at None.

Returns

The last received telegram or an empty string if someting went wrong.

Return type

string

_telegramListenerJob()

The method running in a separate thread, pushing the incomming packets into the queues.

_startTelegramListener()

Starts the thread handling the asyncronously incoming data.

_stopTelegramListener()

Stops the thread handling the incoming data gracefully.

_readTelegramFromSocket()

Reads the raw telegram structure from the socket stream.

When a socket exception occurs, None and an empty byte array are returned. The caller of the function then passes the None to the queue to raise an exception in the threads waiting at the queue.

_closeSocket()

Close the socket.

SCPI Commands Wrapper

class DeltaSCPIWrapper(connection)

Class containing the SCPI commands for the Delta Elektronika power supply.

This class wraps the SCPI commands in getter and setter methods.

Parameters

connection (DeltaConnection) – The connection object to the Delta power supply.

setDefaultTimout(time)

Set the default timeout.

The command sets the default timeout that is used.

Parameters

time – Timout in seconds.

IDN()

Querying the device identification.

This is the standard SCPI command for requesting the identification.

Returns

The response string from the device.

setTargetVoltage(value)

Set the target output voltage.

Parameters

value – The output voltage.

setTargetCurrent(value)

Set the target output current.

Parameters

value – The output current.

getTargetVoltage()

Read the target output voltage.

Returns

The value.

getTargetCurrent()

Read the target output current.

Returns

The value.

getMeasuredVoltage()

Measure the actual output voltage.

Returns

The value.

getMeasuredCurrent()

Measure the actual output current.

Returns

The value.

getMeasuredPower()

Measure the actual output power.

Returns

The value.

setProgSourceVoltage(source: DeltaSources)

Set the voltage source option.

Defines which interface defines the voltage to be applied.

Parameters

source (DeltaSources) – The source option.

setProgSourceCurrent(source: DeltaSources)

Set the current source option.

Defines which interface defines the current to be applied.

Parameters

source (DeltaSources) – The source option.

enableOutput(enable=True)

Enable the output of the supply.

Parameters

enable – True to turn the output on.

disableOutput()

Disable the output of the supply.

executeCommand(command, timeout=None)

Executes a command.

Parameters
  • command – The command.

  • timeout – The timeout for sending data in seconds, blocking at None.

executeCommandAndWaitForReply(command, timeout=None)

Executes a command and waits for the reply from the device.

Parameters
  • command – The command.

  • timeout – The timeout for sending data in seconds, blocking at None.

Source Options

enum DeltaSources(value)

Delta Elektronika power supply source options.

The class manages the possible sources to be used for setting the target voltage and current.

Valid values are as follows:

front = <DeltaSources.front: 'front'>
web = <DeltaSources.web: 'web'>
seq = <DeltaSources.seq: 'seq'>
eth = <DeltaSources.eth: 'eth'>
slot1 = <DeltaSources.slot1: 'slot1'>
slot2 = <DeltaSources.slot2: 'slot2'>
slot3 = <DeltaSources.slot3: 'slot3'>
slot4 = <DeltaSources.slot4: 'slot4'>
loc = <DeltaSources.loc: 'loc'>
rem = <DeltaSources.rem: 'rem'>

Exceptions

class DeltaConnectionError(message)

Delta Connection Exception Class

This exception is thrown when an error occurs with the term communication, which has not yet been thrown by a socket exception.

After this error the connection must be completely rebuilt.

class DeltaSCPIError(message)

Delta Connection Exception Class

This exception is thrown when an error occurs with the communication, which has not yet been thrown by a socket exception.

After this error the connection must be completely rebuilt.