-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't set the temperature on TC200 Thorlabs #331
Comments
try |
Looks to me like your device is sending back the string print(temperature_sensor.query("tset?"))
print(temperature_sensor.query("tact?")) Also: what version of |
That's definitely an issue as well! @scasagrande Looks like the error shows up at the response = (
self.query("tset?").replace(" C", "").replace(" F", "").replace(" K", "")
) The fact it complains about |
@trappitsch the print statement worked, you can see it just above the traceback in the screenshot We're trying to set a property, but we're calling the getter function, which is why this then gets called, https://github.com/Galvant/InstrumentKit/blob/v0.6.0/instruments/thorlabs/tc200.py#L186, which looks like has an error that @trappitsch you did correctly identify. I wonder if there is a device setting that is changing the data format coming back from the instrument |
Or maybe its just that |
Also this is likely 0.6 based on |
@scasagrande Good point, I missed that return in the output. Also about the version. So maybe @njrebelo could still run the two queries I posted and try to set the temperature as @scasagrande pointed out above. If it really sends back mixed messages ( |
@trappitsch agreed if I get a moment this weekend I'll take a look in the manual and see what it says |
So in typical Thorlabs fashion the manual is very unhelpful. It doesn't give example return values for the queries. |
That sounds about right... Hopefully @njrebelo can send some typical output for |
@njrebelo could you still try this for us? |
np @njrebelo , thank you for getting us that data! |
Hmm, this is interesting and weird. It really looks like |
See issue instrumentkit#331, it seems like `tset?` returns ` Celsius` as the unit.
See issue #331, it seems like `tset?` returns ` Celsius` as the unit.
Fixed in #333 |
I have written this code:
import instruments as ik
com='COM7'
baud_rate = 115200
temperature_sensor=ik.thorlabs.TC200.open_serial(com,baud_rate)
print(temperature_sensor.temperature)
temperature_sensor.temperature_set(35)
and no matter what I do the erros is always the same:
Traceback (most recent call last):
File "C:\Users\mc2\Desktop\TC200_automation.py", line 9, in
temperature_sensor.temperature_set(35)
File "C:\Users\mc2\AppData\Local\Programs\Python\Python36\lib\site-packages\instruments\thorlabs\tc200.py", line 198, in temperature_set
return float(response) * pq.degC
ValueError: could not convert string to float: ' 30.0elsius'
What can I do?
The text was updated successfully, but these errors were encountered: