The Synchronous High Level API

The main advantage of using the high level APIs over their low level counterparts is the support of automatic parameter name completion in Python IDEs. With the high level APIs parameter name typing errors are a thing of the past.

The Python classes and modules needed for this feature are autogenerated from the parameter models of the supported laser types. A separate Python module is provided for each software release.

Client Access to Parameters

Reading or writing parameter values works as follows:

from toptica.lasersdk.dlcpro.v1_6_3 import DLCpro, NetworkConnection

with DLCpro(NetworkConnection('My Laser')) as dlcpro:
    dlcpro.system_label.set('Please do not touch!')

The separator character (‘:’) used within full parameter names is replaced by the Python dot operator (‘.’). Hyphens (‘-’) are replaced by underscores (‘_’).

Invoking events works as expected:


The same applies for events with extensions (aka commands):

# Execute command with two arguments that returns a bytes object
result =, 100)

# Execute command with binary output stream and no return value
output_stream = dlcpro.system_service_report.service_report()

# Execute command with one argument, binary input stream, string-type
# output stream, and no return value
with open('DLCpro-archive.fw', 'rb') as f:
    data =

output_stream = dlcpro.fw_update.upload(input_stream=data,

Parameter Subscription

Parameter value subscription is also possible. Change notifications are delivered via a callback function:

from toptica.lasersdk.dlcpro.v2_6_0 import DLCpro, NetworkConnection, Subscription, Timestamp, SubscriptionValue

def callback(subscription: Subscription, timestamp: Timestamp, value: SubscriptionValue):
    print("{}: Parameter '{}' changed its value to {}".format(timestamp.time(),, value.get()))

with DLCpro(NetworkConnection('')) as dlc:


See Synchronous API Example.