From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use LabVIEW to collect Temperature vs Frequency data in a Tunnel Diode Reasonator experiment?

Hello fellow NI forum users. I am currently working on a Tunnel Diode Resonator experiment. We are currently using a Lake Shore 350 Temperature controller with Cernox thermometers and a BK Precision 1832A Frequency counter and are needing to put together a LabVIEW program to collect Temperature and Frequency data, give an output graph, and save the data list to a .txt file from this equipment. This program must also control the change in temperature. I am pretty new to LabVIEW and therefore do not know exactly how to go about either meshing the monitoring programs we are already running or to create a whole new program. My thought is put our current programs in a loop as sub VI’s and take the output values (T and F) to create the chart and collect the data. However, this program must control the T of the experiment as well. Currently we have to manually change and tune T by using a temperature controller program and the PID loops. So this change in T actually comes from the amount of heater power we are putting in. Therefore, the goal would be for example: to choose to collect 500 (frequency and temperature) data points along the way from say a chosen heater output value from 0-40% on Range 4 or 5. This data then would display in a graph as well as in a data list and after we could then save the information to a .txt file. If someone could give me guidance if I’m headed in the right direction on using some of what we already have as sub VI’s in some kind of loop or if I need to rethink the direction I’m headed. Also in the same program If someone could give me advice on how to control the temperature and store the entire data set and save it as a .txt file that would be much appreciated. I apologize for my lack of knowledge of LabVIEW but I guess we all have to start somewhere right?

0 Kudos
Message 1 of 12
(5,028 Views)

Some parts are not clear from your description. Just as few things to list:

 

  1. What is the required sampling frequency?
  2. You say you want to control the power output. This does not make too much sense. Since you want to measure the effect of the temperature, so you must control the temperature. I guess you have this device: http://www.lakeshore.com/products/Cryogenic-Temperature-Controllers/Model-350/Pages/Overview.aspx  ?  It has own PID controllers and power outputs, so you should communicate with this device using the available interface (RS232, Ethernet, GPIB, which one do you have?). LabVIEW driver is here for this: http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=21707
  3. For the Freq counter HW you can find the driver here: http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=74E8FF81FE1364B5E04400144F1EF8...

If you do not need too high DAQ rate, I could imagine a very simple State Machine pattern using some timing. It would have the following states:

  1. Initialise HWs
  2. Start temperature stabilization to required value, pick actual temperature from an array (you could use a preconfigured or user selected array as required temperature steps!)
  3. Wait until actual temp reached
  4. Take frequency and temp measurement, plot to a Chart, save data to TXT file
  5. Go back to point 2) if array is not finished yet, Go to point 6) if all temp levels done
  6. Release HW resources, close File reference

This should give you some idea. If you are a total beginner in LabVIEW, you cannot proceed with the above project without too much pain. So please try to spend a week or two just going through the available learning material (like Core 1, etc.). Good luck!

 

0 Kudos
Message 2 of 12
(5,010 Views)

1. The required sampling frequency is variable. I know that the standard sampling frequency in LabVIEW is 1/100 ms however we would like to be able to vary this sampling frequency if possible. Like have the option on the front panel to input or choose differnet sampling frequencies.

 

2. Yes that is the correct device and correct drivers that we already have. And we are currently interfacing with usb but have all of those capabilities if we need to change. I have not been running the programs myself but based on details from my advisor he has always done things in the past by taking data over a certain power output range and used a calibrated cernox thermometer to take the temperature measurents. If we are able to say control the temperature for example to go from 15K - 40K instead of using 0-40% output we would much rather do that as it would be easier for data collection and experimental control.

 

3. That is the current driver set that we are are using.

 

Thanks for the State Machine pattern information. I am not totally new to LabVIEW have worked through about the first 1/3 or so of the "LabVIEW For Everyone" book but by no means am I an expert. All I have is basic knowledge of LabVIEW. However, we are at the point in our research we need to get this program running so I am kind of diving right in to try and get it copleted as soon as possible so we can actually begin testing samples.

0 Kudos
Message 3 of 12
(4,996 Views)

@TDRMan2016 wrote:

1. The required sampling frequency is variable. I know that the standard sampling frequency in LabVIEW is 1/100 ms however we would like to be able to vary this sampling frequency if possible. Like have the option on the front panel to input or choose differnet sampling frequencies.

 

There is no such thing in LabVIEW as "standard sampling frequency" 🙂 I guess you mean the reading speed of your Temperature controller (10 Hz per channel regardless of the interface, as stated in the technical description)? Of course you can go slower, I would say a 1 Hz sampling rate sounds OK as you measure temperature. To get more statistics, you could sample like 10-20 data points at every temperature level (both freq and temp values).

 

2. Yes that is the correct device and correct drivers that we already have. And we are currently interfacing with usb but have all of those capabilities if we need to change. I have not been running the programs myself but based on details from my advisor he has always done things in the past by taking data over a certain power output range and used a calibrated cernox thermometer to take the temperature measurents. If we are able to say control the temperature for example to go from 15K - 40K instead of using 0-40% output we would much rather do that as it would be easier for data collection and experimental control.

 

So you have a USB interface for your Temperature controller (actually it emulates an RS232 serial interface) and RS232 also for the Frequency Counter as I see. If you want to sample both devices in the same while loop, I would just use a 1 Hz sampling rate to be sure it works (however you can check what is the maximum speed you can go up). So the first test VI you should develop would be a simple While loop where you sample frequency and a certain temperature channel. Also, use a "Wait until ms multiple" function first with a 1000 msec value, and you can go down for checking after. Also, measure the iteration time of the while loop whether you gave enough time to the RS232 interfaces to manage the communication. Of course before the While loop you need to initalize the instruments, and Close after the loop! This should be simple first step for you project, since you have ready made drivers and example VIs as I saw...

 

I just installed the Lakeshore drivers, and as I see it is an instrument where you actually set the heating power output and not the temperature as setpoint. So go in this way as the driver shows, as second step in your project, create a State Machine, where you can change the output power in a "Change output power" State, and also have a "Sampling" or "DAQ" State.

 

3. That is the current driver set that we are are using.

 

Thanks for the State Machine pattern information. I am not totally new to LabVIEW have worked through about the first 1/3 or so of the "LabVIEW For Everyone" book but by no means am I an expert. All I have is basic knowledge of LabVIEW. However, we are at the point in our research we need to get this program running so I am kind of diving right in to try and get it copleted as soon as possible so we can actually begin testing samples.

 

I do not think a book alone is a good way to learn LabVIEW. Have a look at my previous post which gives you some idea how to setup such State Machine. Also google for State Machine, and go through the Core 1 and Core 2 online training if you have access to these!


 

0 Kudos
Message 4 of 12
(4,962 Views)

Sorry for the miss information, yes you are right 10 Hz per channel. Thanks so much for all your help this has definitely gotten me started and headed in the right direction. Also thanks for your suggestions and information on specifics in regards to how to correctly interface with the program. I will look into your practice suggestions and and after I do some more practice and actual work on putting this together if i have more questions I will let you know. But again thanks for your time and guidance!!!

0 Kudos
Message 5 of 12
(4,945 Views)

Just post here your test VI(s) so we can have a look. The trick is to start with little functionality. As I wrote, first just try to set up a simple while loop where you succesfully read out values from the two devices with a rate of 1 Hz first.

0 Kudos
Message 6 of 12
(4,934 Views)

Hello Blokk and others,

 

First off I'd like to apologize for how long this set of post are going to be and for any confusion I caused earlier in this forum as I guess I was a little confused myself in exactly what we are needing for this project. I worked through several of the State Machine Tutorials online and through NI.com the last couple days. I then started working on the program we have discussed from my own perspective. Not really using this idea. I will attach several files for you to take a look at of my progress. After discussion with my advisor. I believe I need to look back through the VI's and possibly change the route I have taken so far in regards to the Temperature Control. But I'll just discuss my thought process with each of the VI's and you can decide what you think and where I need to go with it. Looks like my post is too long even though it says up to 10000 characters an I only had right about 7000 used according to word. So I will post this in several parts for you.

0 Kudos
Message 7 of 12
(4,891 Views)

1. Saving Data to (txt).vi

 

For this VI I started off with the assumption I needed to figure out first how to save the data to a .txt file once the experiment was complete. To accomplish this, I just used two sets of random number dice to represent the Frequency and Temperature data. After I figured out how to do that I added in a place that we can Input a title to our data and take a time stamp when we started our experiment. I then knew that we wanted a graph to appear to plot the data so that we could see what was going on during the experiment. So I wired in an XY Graph to keep this data during our run. Took me awhile but I got it all to "work."

 

Problems: The main glaring problem with this program is that data is "stored" in some sort of "memory" for the XY Graph. So on each run the old data is still there and the new data is just added directly on top of it. When clearing the graph, the data goes away but as soon as you run it again all of the old data plus the new data pops up again. I also tried changing the properties of the VI under the Execution tap to "Clear indicators when called" as someone on another forum had suggested was a troubleshoot for this problem. The only way I found that solves this problem is either completely closing and reopening the program or changing something on the Block Diagram and starting a new run. So on to attempt number 2.

 

 

0 Kudos
Message 8 of 12
(4,889 Views)

2. Saving Data to (txt)2.vi

 

This is the exact same VI as the first except for I removed the superfluous time stamp with each data set taken. And to fix the problem with the graph keeping all of the data. I just used an empty array with as Select function to clear the graph each time the program is stopped to eliminate the old data.

 

Problems: The main problem with this is that my advisor wants to still be able to see the data on the graph once we complete the run. Therefore, it is a problem that the data disappears after each run. Therefore, my main question is how to fix this problem so that the data still displays after the experiment is complete but disappears once the new experiment starts running.

 

0 Kudos
Message 9 of 12
(4,886 Views)

3. Frequency vs Temperature.vi

 

Alright so a big jump here. And this program shows that it would run but is actually untested for actual functionality since I have not had access to our lab equipment this week to test it. Anyway, I started putting in the ready-made VI's into the "Saving Data to (txt)" file I had put together. Functionally in my mind it seems that it should work, but again I am really new to this and still have a lot to learn so I am not sure that my ideas on data flow in LabVIEW are correct or not. Basically I exchanged the random number dice for the data outputs for frequency and temperature from the "Lake Shore 350 Configure Heater Output Control Parameters and Acquire Single Reading.vi" and the "BK Precision 1823A Monitor Frequency.vi" from the downloaded driver files. After working through some things I was finally able to work out "all the bugs" and the program shows that it would at least run anyway. Like I said earlier it is untested so the data flow may be totally wrong.

 

Problems: While I am happy about what I have put together and that it could potentially theoretically work I also know that most likely there are still some bugs in it. And it actually already needs changes I have not yet looked into. Main change, my advisor does not think that this program will provide an even rate of change to the temperature. He explained that this Lake Shore VII am using is mainly used to heat and then steady the temperature at a particular set point. So taking data continuously over this change will not give us a linear rate of change to the temperature of our sample. So instead of controlling how many data points are taken ever second and just continuously taking data from our base temperature to the set point, we want to be able to have control to say set the program to take 1000 data sets over a temperature from 0-1000K. So 1 data set every Kelvin as the Lakeshore gives the information to our heater to increase the temperature uniformly to our final temperature reading. He believes the VI's I need to look into are the "Ramp.vi" VI's contained in the driver’s folder.

 

0 Kudos
Message 10 of 12
(4,884 Views)