02-20-2019 01:08 AM - edited 02-20-2019 01:15 AM
Hi meetrajesh,
because you did something wrong with your format string!
Do you spot the difference in your format string and the "element" string?
Hint1: there is a difference between a SPACE and a TAB char…
Hint2: ALWAYS show the display style indicator for string controls/indicators/constants when you are not using the default style!
Hint3: Read the help for those format codes! There is a difference in using %m and %M in a timestamp!
Solution:
Did you even read my message #2 (carefully)?
02-20-2019 01:37 AM
Oops I am so sorry for the bad format feed. Now the vi is working correctly but as you can see, it is displaying the data values of first sample only. How can I get the values of all the samples so that I can plot them on a graph wrt the time?
And in your message #2 you mentioned that we can do this with Read Delimited Spreadsheet in string mode also. How can I do that?
02-20-2019 01:47 AM
Hi meetrajesh,
How can I get the values of all the samples so that I can plot them on a graph wrt the time?
When you want to repeat some piece of code several times you should use a loop.
This is very basic programming stuff, and not even related to LabVIEW alone…
we can do this with Read Delimited Spreadsheet in string mode also. How can I do that?
Convert your file into a 2D array of strings. Then parse each column with the required format string for that column. (You need a different format string for the timestamp than for the signal values.)
02-20-2019 03:38 AM
Yup everybody knows that a loop should be used to iterate the things, but this won't work here. 😞
Its the 'index' terminal of the 'Index Array' function which has the control of output. In the text file, the timestamped data points are saved at index 0, 2, 4 and so on (odd numbers are invalid because of the empty lines).
02-20-2019 04:24 AM - edited 02-20-2019 04:30 AM
Hi meetrajesh,
but this won't work here.
Why should it not work? Why so sad?
Its the 'index' terminal of the 'Index Array' function which has the control of output.
Yes, but loops can also use autoindexing in LabVIEW…
In the text file, the timestamped data points are saved at index 0, 2, 4 and so on (odd numbers are invalid because of the empty lines).
Yes - because of your "unoptimized" way of writing those data…
Well, in a loop you also can access the loop iterator. It will give you numbers starting from 0 and counting up: 0, 1, 2, …
What about a little magic commonly called "math" and double that iterator value to get 0, 2, 4… ???
Hey, with some more "math" you can even calculate how many iterations you need to process the full array!
All those questions aren't LabVIEW related, but show some lack of knowing how to develop an algorithm. I usually suggest to use a pen and paper for developing algorithms - before starting to code…
02-20-2019 05:42 AM
Hi meetrajesh,
please don't ask by PM for your problems in this thread. Just post here!
Hello Sir.. I am totally messed up with the things and I don't know why my mind has stopped working (maybe because of the pressure my boss has build up on me). Can you plz help me out with the vi to read and display that unoptimized text file on a graph. What things should I keep inside that loop? How that loop would work if 'Scan From String' is outputting only three single data values (and not a group of values). I am working on Labview 2017. I would be very thankful to you.
Use a loop:
Btw. you already got a suggestion in message #10! Why don't you use that?
02-20-2019 07:06 AM
@GerdW wrote:
Btw. you already got a suggestion in message #10! Why don't you use that?
I wonder that too. I think sometimes people don't bother reading the messages we take our time to write, and are narrowly focused on some detail of their code that is wrong and trying to fix that when they should be paying attention to the messages and fixing the overall architecture problems.
Very frustrating when people don't read and listen.