01-12-2012 04:20 AM
Hello
I am using this (attached) vi to control Lakeshore temperature controller. I got the vi from NI website. I want to change the vi such that, for setpoint, it takes input from an excel sheet (could be any other form too). this Excel sheet contains a list of temperatures. The vi reads the first temperature and then sets that as setpoint of the PID controller. Once the setpoint is 'set' the vi waits for some time (say 1 hour) before reading the next setpoint entry from the excel sheet. The reason I want it to wait is because I have programed a gamma spectrum software such that it counts for 1 hour and then starts a new counting. The spectrum part is not very intelligent but its ok for now. The problem I am having is that when I run this vi (attached), the setpoint indicator on the temperature controller (the hardware) goes to zero and stays there. Can anyone help me by pointing out the mistake I am doing. This vi is Labview 6.0 based ( its a poor establishment!)
thank you
saurabh
Solved! Go to Solution.
01-12-2012 05:03 AM
Is xlsx a must or can you make do with a csv or a text file?
If yes you have made your life a bit easy
if not you will need to install a plugin or find an excel interface library such as https://decibel.ni.com/content/docs/DOC-2343
and then do the same as above.
hope this helps.
01-12-2012 05:51 AM
Thanks, Ace.
No, excel is not must. Text or csv is ok. I will give it a try.
saurabh
01-12-2012 07:33 AM
Ace,
I got couple of very stupid questions. The function pallette in my LABVIEW 6.0 does not show csv reader icon or the array icon (the one marked double and one after it). Can you please tell their names so that I would be able to find 'em. My labview experience is less than a week. Also the Lakeshore vi (I hope I am calling it correctly) goes in the FOR loop, correct?
So what does the 'array' at the end is doing?
saurabh
01-12-2012 08:31 AM - edited 01-12-2012 08:31 AM
I am not sure if 'read from spreadsheet file.vi' is present in LabVIEW 6.0.
However, I can see it in the vi you posted previously.
The array at the end is just to show you that all the values are read, you can safely ignore it.
01-12-2012 08:37 AM
Ace,
thanks for the reply. I got it - the first one is 'read from spreadsheet.vi'. I have that. What is the vi that is taking the output from it?
thanks
saurabh
01-12-2012 08:41 AM
That's just index array, which gives you the 1-d array that's relevant.
01-16-2012 04:15 AM
Hi Ace,
I am attaching a vi which i tried. What I want it to do is read the first setpoint, pass it to the output, then wait for some time (say 1 hr, which is adjustable) and then read the second setpoint and so on. would be able to help in this matter?
thanks
saurabh
01-16-2012 10:06 AM
Saurabh,
You could possibly have the step timing in the spreadsheet as well?
This would be a classic case where you could use state machines (or producer / consumer - events if user input is critical), search for this architecture and examples on ni.com. Also for timing purposes, search for functional global timer or try modify this example https://decibel.ni.com/content/docs/DOC-6523 to add 'time has expired' (as in the elapsed time express vi) functionality similar to this code.
You could have states such as:
Initialise: Initialise your front panel controls/graphs etc. Read the spreadsheet file. Ensure that comms exist between the software and the controller etc.
Set Temperature: Set the first value, start a timer (depending on what you set)
Check Status: Check the controller failure status etc. Check if the user has pressed stop button. Check if the timer set in the previous state has expired?
On error stop the timer and take the necessary steps to correct, report to the user
If user pressed the stop button, close all references, reset hardware etc and quit application.
If the timer has expired, obtain the next value and go to Set Temperature.
Hope this helps.