John Brock Posted December 13, 2022 Share Posted December 13, 2022 I have a USB-2001-TC. I don't use the packaged software but use the python API. How do I set the thermocouple type to Type K using python? I understand the type is stored on the device but can't find how to set it. Link to comment Share on other sites More sharing options...
0 Jeffrey Posted December 13, 2022 Share Posted December 13, 2022 14 minutes ago, John Brock said: I don't use the packaged software... So I'll assume Python on Windows OS. usb2001tc_t_in.py Link to comment Share on other sites More sharing options...
0 John Brock Posted December 13, 2022 Author Share Posted December 13, 2022 Thank you very much. It's on Linux (Raspberry Pi). Does that make any difference? Link to comment Share on other sites More sharing options...
0 Jeffrey Posted December 14, 2022 Share Posted December 14, 2022 Different enough🙂 (Linux Python version) USB2001TC_t_in.py Link to comment Share on other sites More sharing options...
0 John Brock Posted December 14, 2022 Author Share Posted December 14, 2022 Very helpful. Thank you. Can you please confirm that once set, the TcType.K is stored on the device and does not need to be reset? This is the way I read the manual. Link to comment Share on other sites More sharing options...
0 Jeffrey Posted December 14, 2022 Share Posted December 14, 2022 The TCType is not stored on the device. I know you are using Linux, but you can confirm this on Windows with InstaCal: With InstaCal installed and your USB-2001-TC attached. Run InstaCal, double click on the USB-2001-TC and configure the channel for your preferred TC type (not the default). Install InstaCal on another PC and attach your USB-2001-TC. Run InstaCal, you will see the TC type is now back to the default. Meaning the TC type is not stored on the device. As a data point, we do have some devices that do store their user configured settings internally in NVRAM, so when you move the device from one PC to another, InstaCal shows the stored configuration. That is not the case for the USB-2001-TC. There is no "InstaCal" for Linux so you must set the tc type programmatically anyway, so I don't see this as a problem. From the Linux example I posted: ai_config.set_chan_tc_type(0, TcType.K) I see where you found that, ULHELP hardware considerations for the USB-2001-TC, As stated, "Saving configuration settings InstaCal allows you to save configuration settings to a file or to load a configuration from a previously saved file. You can configure the USB-2001-TC to measure temperature data collected by one of eight thermocouple types — J, K, S, R, B, E, T, or N." "InstaCal allows you to save configuration settings to a file or to load a configuration from a previously saved file..." The file is cb.cfg, and is located in C:\ProgramData\Measurement Computing\DAQ. This is a text file created by InstaCal, and you can read it using Notepad.exe or similar. But you are running Linux so there is no cb.cfg file to read from. Link to comment Share on other sites More sharing options...
0 John Brock Posted December 14, 2022 Author Share Posted December 14, 2022 Thank you for clarifying that. I'll use the python code. I get this output, however, when I run the example code you sent " Found 1 DAQ device(s): Error: No USB-TC found. Can't debug why this is happening. Can you help me find just the minimum code to set the TcType. The example contains a lot of checking that may not be needed. Link to comment Share on other sites More sharing options...
0 John Brock Posted December 14, 2022 Author Share Posted December 14, 2022 I got it to work with just this: #daq_device.get_config() ai_device = daq_device.get_ai_device() ai_config = ai_device.get_config() ai_config.set_chan_tc_type(0, TcType.K) Link to comment Share on other sites More sharing options...
Question
John Brock
I have a USB-2001-TC. I don't use the packaged software but use the python API. How do I set the thermocouple type to Type K using python? I understand the type is stored on the device but can't find how to set it.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now