Skip to content

Thorlabs TSP01B Python example code does not work when using 2 devices #14

Description

Python snippet : TSP01 - Rev B - using ctypes.py

When using 2 devices the code enters an else statement which handles multiple devices.

At Line 33
there is an print statement:

print('#' + str(i + 1) + " " + deviceName.value) This fails because deviceName.value must be decoded first.

Suggested change:
print('#' + str(i + 1) + " " + deviceName.value.decode())

Line 35:

lib.TLTSPB_getRsrcName(0, (device_num - 1), deviceName) fails because the user input is a string, not an integer to substract from.

Suggested change:
lib.TLTSPB_getRsrcName(0, (int(device_num) - 1), deviceName)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions