LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

signal path (chart) from text file / Signalverlauf aus Textdatei

Solved!
Go to solution

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.

SignalpathFromText.PNG

 

Thank You very much!

Björn

0 Kudos
Message 1 of 5
(907 Views)
Solution
Accepted by topic author bjoern1111

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.

0 Kudos
Message 2 of 5
(878 Views)
0 Kudos
Message 3 of 5
(842 Views)

Hi Björn,

 

it might help other people more when you would attach a VI instead of an image!

  • It might help to cleanup the block diagram before posting…
  • It might help to use some nice fonts for labels instead of those 2pt/3pt labels on most terminals in your image…
  • You probably can use SpreadsheetStringToArray instead of that subVI.
  • No need to wire the index input of the StringToNum function.
  • "Running" should be an I32 indicator: why did you use DBL here?
  • The (file) error handling is completely missin in the image.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(832 Views)

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

0 Kudos
Message 5 of 5
(821 Views)