02-15-2022 09:20 AM
Hi Jay,
@JÞB wrote:
Gerd, what is the search and replace doing in there? Just use "%,%.6f" format string
I know about those formatting codes, but the OP apparently does not.
For simplicity and easier understanding of the OP I didn't change the OP's code for this specific code improvement…
Instead I want to improve the way the data is transferred from Arduino to LabVIEW.
02-15-2022 09:27 AM
Hey GerdW,
here is my code and the display on the front panel, here you can clearly see that i get the full data from the Arduino (or am i getting something completely wrong here?). The thing is that after the conversion to numbers i loose all of the digits except for the 3 after the comma. So i guess i have something wrong with either the conversion or so, so i will try to just save the string immediately and just convert to display the numbers even though the plot wont be 100% correct then. As you can see here i get all the data in LabVIEW just after the conversion and saving it it only Shows the 3 digits (also on the probes in LabVIEW itself as you can see in my first post).
Best regards and thanks again,
Mismatch
02-15-2022 09:40 AM
Hey crossrulz,
to 1: i know but i wasnt able to just put some time values into the file for a quick test so my solution was this i will try now to make it work with your point 2.
to 2: thank you the Write Text File VI worked just fine to get all the digits into the saved file 🙂
to 3: i will do that thank you.
to 4: Also everything is good in the csv then since i get a new column for every value.
to 5: i will try to clean my code up with all the unnecessary thing when i know what i need and what not, until now it is just the basic Programm so i can get started with some testing and when that works i would clean up my whole code to make it more user friendly.
Best regards,
Mismatch
02-15-2022 10:08 AM - edited 02-15-2022 10:25 AM
Two things to check.
First: how is the display formatting set in Excel for column B. The default is %.3f because.....well, it's a spreadsheet. BTW, Excel handles math a bit differently than the IEEE 754 standard for some cases.
Next: let's see the configuration inside the Express VI. One of the reasons they are so hated is that they hide what you told them to do and don't have a default that fits every use case..
Essentially, you are getting yourself confused. What you see in LabVIEW Front Panel Controls / Indicators and in Excel cells are text strings. Known as a object's Display.Text.Text property. A Value property is much different and is formatted into a display string by the owning application.
02-15-2022 10:18 AM
hey JÞB,
First: i tried to increase the commas and excel just adds 0 after the 3 digits, also LabVIEW already only Shows 3 digits with the probes.
next: here a screenshot of my configuration of the Express VI.
But since i already plan to do it with the string value and using the "write to text file" VI i don´t think this is necessary anymore.
I am just having struggles now with adding a time value for every string value i get into the file, but i guess this question was here somewhere already so i will look for a solution to this.
Best regards,
Mismatch
02-15-2022 10:22 AM - edited 02-15-2022 10:25 AM
Hi mismatch,
@Mísmatch wrote:
here is my code and the display on the front panel, here you can clearly see that i get the full data from the Arduino (or am i getting something completely wrong here?).
Then why did you present completely different data in your attached VI?
How should I know the data you show now?
@Mísmatch wrote:
The thing is that after the conversion to numbers i loose all of the digits except for the 3 after the comma. So i guess i have something wrong with either the conversion or so, so i will try to just save the string immediately
It could be so simple, once you get rid of ExpressVIs:
Why do you create a filepath with a ".csv" file suffix, but use the ExpressVI to create a XLSX file???
(Using the WriteTextFile function you can use a .csv file suffix.)
Edit: use the file reference coming from your FileOpen function instead of the file path to avoid overwriting the text file again and again!
02-15-2022 10:28 AM - edited 02-15-2022 10:47 AM
Hey,
i did not change anything i just saved the VI as an older version, I didn´t know that could change anything so i am sorry for that. (never had this kind of data you have in your screenshot or that is in the VI i posted)
Yes thank you i will work with the string and the VI i got suggested now.
EDIT: These values were set as default that´s why they are in there like that, i didn´t realize this since normally i just start the Programm with the Arduinos connected so i get my normal values nearly immediately. Sorry for the confusion.
Best regards,
Mismatch
02-15-2022 10:30 AM - edited 02-15-2022 10:36 AM
@Mísmatch wrote:
hey JÞB,
First: i tried to increase the commas and excel just adds 0 after the 3 digits, also LabVIEW already only Shows 3 digits with the probes.
next: here a screenshot of my configuration of the Express VI.
Mismatch
See that Advanced button?
That pulls up a page that configures formats.
Probes in LabVIEW (Actually "Smart Probes") have a default format too! Create new Probe with a %.20f specifier. Just right-click the orange wire to launch the wizard.
02-15-2022 10:35 AM
Here it will just let me configure the Timestamp so i dint look into this at all.