LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parcing data from uC (2)

Solved!
Go to solution

I am sending this: "b,4.53783,4.10000,00:03:59" (confirmed with a terminal) from a microcontroller and would like to write this to a txt file.

The format should be something like this: 4.53783  4.10000  00:03:59.  

What i am actually getting is this: 4.538 4.100 0.000 3.000 59.000. 

Any ideas?

thanks

0 Kudos
Message 1 of 5
(2,002 Views)
Solution
Accepted by topic author gillettestm32

Hi gilette,

 

when you want to handle strings then you should handle strings (and not numerics!):

check.png

 

More recommendations:

  • use a format string of "%[^,],%f,%f,%s" to scan the received string
  • there are also format codes to scan timestamps…
  • don't use ExpressVIs (like MergeSignal) to handle your data!
  • it's called "to parse" when you analyze text…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 5
(1,991 Views)

@GerdW wrote:

check.png


You could just use Search/Replace String to replace all of the commas with tabs.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 5
(1,984 Views)

Hi crossrulz,

 

you still need to delete that first item in the list/vector/array…

Best regards,
GerdW


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

Doh...

thanks a lot

0 Kudos
Message 5 of 5
(1,960 Views)