01-26-2012 03:54 AM
Hi,
My problem is related to temp. control task from file. I have two heaters and LS336 temperature controller unit. I want a kind of temperature profile which should be loaded from the file. This will be very easy for me to control temperature and some other issues.
I added some 2 vi s. or one of them, arrray should be devided in to array. and the second one, I cannot read from the file correctly, why I couldn't get.
Thanks for helps and effords. Best.
Solved! Go to Solution.
01-26-2012 07:02 AM
Hello,
I guess the "loading task from file.vi" should load the untitled.txt? I recognized it also loads some zeros at the beginning. I guess this is not intended and needs some bug fixing.
I have no funny idea of what your "loading text file.vi" is supposed to do and what type of file it should read in. Please add a file that is ought to be used with this VI and describe the problem in detail. Please also add a description what from the file is supposed to be read in and how you want to retrieve those data for use in following code.
One comment on the VI right away: After klicking the clan up diagram, it looks like subarray, subarray3 and subarray5 show the same data, whats that supposed to be good for? It feels a bit messy (:
If you just want to read and write arrays of numbers into labview from files and you do not care too much about readability, you might want to try out the Labview XML. Or maybe use VIs like "Write to Spreadsheet.vi" and "Read from Spreadsheet.vi" as they just read and write blocks of numbers wich you can slice as needed afterwards.
Regards, Questionmarker
01-26-2012 07:34 AM
Thank yo uvery much for this comment. I have a vi which controls the temperature. There are two heaters. I need to control both heaters temperatures.
Heater 1=H1 and Heater 2=H2.
I want to set the temperatures of the heaters from the data file. Temperature values from the text file will be read by labview program and this program will apply the values from the file. This will make my job easy I guess.
So the file can be eather "*.txt or "*.dat". I can easyly write using notepad or excel.
For this reason each row and column shoul be seperated after it was read. I will send first value of the first line to H1 and the second value of the first line to H2 for once. When the "job need to be done by program" finishes, second line will be read with the same vay and values will be sent to H1 and H2.
I hope I could explain. If not please mention. Best.
01-26-2012 08:19 AM
ok, I guess I know what you want to do, I still do not understand how your VI could achieve that, though.
If you have LV2011, I attached an example that writes a file with some temperatures and reads it from the file afterwards.
If not, here is a picture of the whole code, so you can rewrite it:
note, its not fancy or something, but functional already. You can make a better one for your application.
I hope this solves your problem. Good luck with your experiment.
01-26-2012 08:30 AM - edited 01-26-2012 08:31 AM
I do not have 2011. but I will make this now and try is. thanks.
01-26-2012 08:32 AM
2010 version
01-26-2012 08:51 AM
I made the same-I guess made the same but didn't work. results is always "0". ?? But actually this is what I want. You understand wey well and solved actually. Could you please send me your vi for Labview2010. I attached vi to be checked. Best.
01-26-2012 10:07 AM
Hi,
I actually want to read complately from the file. I will write a data to a *.txt file and read from the file. But here, in your vi, I need to write data into the 2D array and this write to the txt file. This is not very useful because I have more than 100 lines. So what can we do for this.
01-28-2012 11:05 AM
Hello becidea,
Are you simply trying to display the text file data in an array, or are you trying to use this data to perform an action with it?
Regards,
Jeff L.
01-29-2012 06:41 AM
Yep;
I am trying to use this data to perform an action with it. This data will be a set of data to control the temperature