LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot a waveform from a string

Solved!
Go to solution

Hi everyone, i've to plot a waverform from a string (like this : +1.328546E-13A,-003.1000,+6.898991E-14A,-003.0000,+4.529815E-14A,-002.9000,...) and then save the data into a file.txt.

The second value(-003.1000,-003.0000,-002.9000....) has to be the X axis and the first one(+1.328546E-13A,+6.898991E-14A,...) the Y axis.

The string comes from a picoammeter and i'm using a serial connection.

I'm working with labview SE 2012.

Does anyone could help me?

0 Kudos
Message 1 of 8
(4,456 Views)

Hi francesco,

 

in LabVIEW you would convert your string to an array using SpreadsheetStringToArray function. Afterwards you decimate your array into 2 arrays and use one for X values, the other for Y values.

 

When you use SignalExpress you should post in the SignalExpress forum!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(4,443 Views)

Hi Gerd, thank you for your help.
I think i'm in right forum, i don't use any kind of signal Smiley Wink

Hovever...now the problem is saving the data.
I found Write to Spreadsheet file  and Write to measurement file helpful for me but not for All.
The second one is almost perfect but i'm not able to rename the headers.

Wath i want is somenthing like this (see test2 attached file)

Thank you!! Smiley Happy

 

Download All
0 Kudos
Message 3 of 8
(4,388 Views)

That looks like a simple "write to text file to me". You could just use said function, use the "concatenate strings" with the headers you want, followed by the data separated by tab and carriage return.

0 Kudos
Message 4 of 8
(4,380 Views)

Hi Daikataro

thank you for the answer.

The problem in that case is how to format the incoming string. I receive data like this (+1.645710E-14,+000.0000,-4.144607E-15,+000.1000,-2.427935E-17,+000.2000,-1.650574E-14,+000.3000,-5.049865E-14,+000.4000,-3.504731E-14,+000.5000,-9.273024E-14,+000.6000,-1.174499E-13,+000.7000,-8.655032E-14,+000.8000,-8.552034E-14,+000.9000,-5.358891E-14,+001.0000,-1.081800E-13,+001.1000,-1.040601E-...)

and i'm not able to separate the data in two columns..then for the header i understood what to do.

0 Kudos
Message 5 of 8
(4,375 Views)
Use SpreadsheetStringToArray to convert your string to an array!
Best regards,
GerdW


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

@francescof4 wrote:

Hi Daikataro

thank you for the answer.

The problem in that case is how to format the incoming string. I receive data like this (+1.645710E-14,+000.0000,-4.144607E-15,+000.1000,-2.427935E-17,+000.2000,-1.650574E-14,+000.3000,-5.049865E-14,+000.4000,-3.504731E-14,+000.5000,-9.273024E-14,+000.6000,-1.174499E-13,+000.7000,-8.655032E-14,+000.8000,-8.552034E-14,+000.9000,-5.358891E-14,+001.0000,-1.081800E-13,+001.1000,-1.040601E-...)

and i'm not able to separate the data in two columns..then for the header i understood what to do.


Hi find the attached snippet which will log the input into the required format txt file.

 

 

Array to txt.png

 

 

Hope this helps 

 

Kudos Welcome 🙂

 

Certified-LabVIEW-Associate-Dev_rgb (2).jpg

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
Message 7 of 8
(4,336 Views)
Solution
Accepted by topic author francescof4

Thank you for the help

Here is my solution maybe someone could need it

 

0 Kudos
Message 8 of 8
(4,266 Views)