04-28-2021 02:35 PM
Hello together,
i am a noobie in terms of labview. so hopefully sb. can help me out. i want to create a rising edge trigger for live sensor data. to develope this i want to simulate my sensor from already written data (text file), because my machine cannot run all the time. My data look like this:
11:28:35,904084 -4,456640E-3 6,983662E-1 4,079938E-4 1,346877E-1
11:28:35,904105 -3,790260E-3 6,978525E-1 4,026294E-4 1,199031E-1
11:28:35,904125 -3,775955E-3 6,969429E-1 2,975762E-4 1,170719E-1
So i have a timestamp and four signal channels. I just need to index/draw/simulate one channel. My samplingrate is 50 kHz as it can be calculated from time values. Amount of data is huge so i would prefer a linewise-reading approach. I guess that is not a complex task, but after hours trying, i do not get it.
Thank You very much!
Björn
Solved! Go to Solution.
04-28-2021 03:53 PM
You are reading a file all at once, building a waveform, and dumping it into a waveform chart, in a continuously running while loop as fast as your CPU can run.
Throw it all out.
Start over with this basic concept.
Open the file before the loop.
Inside the loop, use a Read from Text File function to read a single line.
Parse that line to get the data you want. (Be careful because that European comma instead of a decimal point might mess you up.)
Write the data to the chart.
Put in a wait function that is equivalent to whatever is your time interval between points.
Repeat until you hit the stop button or your file ends.
Exit the loop and close the file.
04-29-2021 09:46 AM
Thank you!
04-29-2021 09:59 AM
Hi Björn,
it might help other people more when you would attach a VI instead of an image!
04-29-2021 02:56 PM
Thanks Gerd. Your are totally right. Since I don't need do this for fun i d like to leave it like that. Attached my solution as v2019 VI. Hope it helps some others too.
Best regards
Björn