10-05-2021 03:43 AM
Hi
I would like to ask for helping me to store nicely results from power meter. What I get from digital meter is string of values into one line like below bold text:
234.19E+00,0.0809E+00,-18.95E+00,-0.9997E+00,0.00E+00,0.0000E+00,-0.00E+00,9.91E+37,9.91E+37,9.91E+37,50.013E+00
So after I will get info from meter I need to save all values into .txt file. Also I would like to add for each measured value a unit letter [V], [A]...
I prepared the program but i feel that is to complicated and more advanced LabView user can do this much more easier. Please for some advise 🙂 Thanks in advance > Dawid
Attachments:
gpib.vi - LabView 2020 32bit
results to save - printscreen ov vi above
Solved! Go to Solution.
10-05-2021 04:26 AM
@mrspock wrote:I prepared the program but i feel that is to complicated and more advanced LabView user can do this much more easier. Please for some advise 🙂 Thanks in advance > Dawid
That seems to be as simple as possible, given it's not finished. What you have is the way to go.
What you have now can be simplified, but to finish it will need to be this 'complicated'.
I'd recommend changing the format string ("%s"), as this is wrong. You're reading numbers, and you'd want to format them as numbers:"%f". This will fail on a computer that has commas as decimal separator. The text will be formatted with ",", like "2,5". Probably not what you want. So, to be safe always use "%.;%f".
Any specific problems with finishing?
10-05-2021 05:36 AM - edited 10-05-2021 05:39 AM
Way too many remaining questions to give a definite answer.
@mrspock wrote:
I prepared the program but i feel that is to complicated and more advanced LabView user can do this much more easier.
Once you learn how to spell LabVIEW with the correct letter case ("LabVIEW", not "LabView"), you'll graduate to be a slightly more "advanced" user automatically. 😄
10-05-2021 05:50 AM - edited 10-05-2021 05:59 AM
10-05-2021 06:00 AM
"%.4" is NOT a valid format!
10-05-2021 06:09 AM - edited 10-05-2021 06:13 AM
10-05-2021 06:11 AM
@mrspock wrote:
Thanks for the answer. On screenshot I am showing what kind of results I want to achieve and what kind way of working to avoid. I hope this is clear view of my way of thinking.
Dawid
Here, have a look at the attached example.
10-05-2021 06:33 AM
If you really only need the first four values, here's another alternative. No need to parse all these extra characters.
10-05-2021 06:46 AM
altenbach, Dobrinov - Thanks! This is what I am looking for. Now I will check how it works. Thanks once again 🙂
Dawid
10-05-2021 09:07 AM
I'd go for:
Note that these solutions are not simpler per se that your original post.
They are maybe (doubtfully, Spreadsheet String To Array is blazingly fast) a bit faster, but they leave out half the problem (storing to file).