07-30-2024 03:42 PM - edited 07-30-2024 03:48 PM
Hello everyone, I am a student doing summer research at Temple University. We are using labview to collect data from Lock In Amplifiers, and I am currently working on integrating a Thorlabs TSP01 temperature probe into a VI that was made before I was here. I got a VI from Thorlabs which I have integrated into the VI we have for the lock ins, however it appears that the temperature probe crashes about 1 hour into collecting data.
I have made sure of the following according to the specs and advice from Thorlabs:
We only sample data from the probe about once every second.
We reinitialize and stop the driver session each time we collect data.
I have wrapped the temperature probe data collection in a sequence structure which I believe makes sure all those nodes occur in a sequence before the rest of the VI happens
Once the temperature probe crashes, we only read zeroes from the probe, and the rest of the VI slows down dramatically, lags and becomes unresponsive, collecting data every 5-6 seconds instead of once every second. I have time elapsed counter that usually updates once every 1/100 seconds but after the probe crashes it only updates at that once every 5-6 second rate.
There is a Thorlabs GUI that came with the software of the temperature probe, the GUI when run alone does not cause this crash, however if I run the VI and it crashes, the GUI cannot interface with the probe until it is unplugged and reconnected to the computer.
This is a screenshot of the sequence structure, which first starts with a node to get the device resource string. This device resource string is then fed into a node that initializes the device. The instrument handle from that is then passed onto two nodes that get the temperature and humidity data, and after that there is a node to stop the driver session. This sequence executes about once every second. I do not know what is causing this issue and thus any advice or fixes would be helpful as we try to take around 100hr runs, and that cannot be done if the temperature probe crashes.
Please find the VI I am using attached below (you need to download the Thorlabs device drivers found at Thorlabs - Your Source for Fiber Optics, Laser Diodes, Optical Instrumentation and Polarization Meas...) to have the Labview VI elements.
Thank you,
Dipto Provas
07-30-2024 09:40 PM
@DiptoP wrote:
We only sample data from the probe about once every second.
We reinitialize and stop the driver session each time we collect data.
I have wrapped the temperature probe data collection in a sequence structure which I believe makes sure all those nodes occur in a sequence before the rest of the VI happens
I cannot look at your VI, do not have the latest version on this computer. If you want more people to help, save it it in version 2020.
Typically you do not reinitialize and stop the driver in the loop. This is bad advice. Initialize the driver outside your loop, close it when your loop finishes. If you have an error in the loop, then you can always close it and reinitialize it.
Your sequence structure does nothing; it isolates the Thorlabs code but does not do anything else. Think data flow. One potential issue I see your code is that you are trying to do things in parallel; typically this can be problematic. Connect your VIs by their error out error in so they operate in a sequence.
Steps 2-4 should be in sequence, do not try to measure in parallel, do not think your sensor can support that.
07-30-2024 09:53 PM
Hi, Thank you for your help, I will try putting them in parallel. I actually do not know what error out and error in do, the VI thorlabs sent me had the errors connected so I tried replicating that when I added the get humidity. I found that the device crashes more frequently if I do not repeatedly initialize and exit, but I can try that. I will also try resaving the VI in 2020 and reuploading it tomorrow once I have access to the computer in the office that has LabView.
Warmest regards,
Dipto Provas
07-30-2024 10:08 PM
@DiptoP wrote:
I will try putting them in parallel.
NO!!, Put them in serial order. In your picture you have a wire branch and two VIs can operate in parallel. You do NOT want this, operate them serially.
The error in/error out, besides providing error information, can enforce execution order, that is, data flow. A VI can not operate until all its inputs are received.
07-31-2024 12:13 AM
My apologies, I mistyped parallel when I meant series.
Dipto Provas
09-09-2024 02:50 AM
I have the same hardware, but I was not able to detect it as USB on my DELL laptop. However, when I run the software from Thorlabs, it automatically detect and display temperature and humidity. I have the TSP01 revB version that does not need NI VISA to operate. I use Labview Full development 2024 Q1.
I usually have no difficulties to control 15 or 20 different instruments with Labview, I can usually see on NI MAX but this one does not appear. So there is no VISA ressource to input in the sub-vi. Some sub-vi can detect the correct serial number, but not the USB port ... something that I do not know what to do to be able to get a VISA resource.
Could you tell me how you proceeded to get a VISA resource name to operate the tabview library from Thorlabs ?
09-09-2024 09:30 AM
Most of the Thorlabs stuff uses a .NET interface. Check their website for drivers and examples.
09-09-2024 04:13 PM
thank you so much for your valuable comment. Indeed, I work with flippers, cameras, and so on from Thorlabs, and you are right, it is based on .NET containers to program it. I add that we have to copy the entire library of files provided by Thorlabs in double location : in the program folder, and also in the location of the Labview project in which the Labview main program is created. Anyway. This is to tell you that I KNOW very well Thorlabs product, but your comment does not answer my concern, sorry to say that.
09-09-2024 04:33 PM
@arienai wrote:
This is to tell you that I KNOW very well Thorlabs product, but your comment does not answer my concern, sorry to say that.
Sorry it did not help, but in my experience with Thorlabs I have never seen their instruments listed in MAX or needed a VISA resource for them. They all used a .NET control.
09-09-2024 04:53 PM
Yes me too. But the Labview library of TSP01 is based on "VISA resource name" input ... but as you said, and as I wrote, this does not appear in NI MAX or even in the Device Manager of Win11. That is why I am lost in translation ...