05-02-2019 07:11 AM
Hi,
the buffer reads my measurements and I want to convert the data to floats.
I only get integers, but I need more precise measurements.
I attached my VI.
Thanks!
05-02-2019 07:27 AM - edited 05-02-2019 07:27 AM
You should have used the phrase "serial port" buffer. I had no clue what you meant by just "buffer" until I opened your VI.
First, don't constantly reconfigure the Serial port in every iteration of the loop. The configure subVI should be before the while loop.
Next, you have to show us what the data looks like that you receive from the serial port. Is it raw binary bytes? Is it human readable, ASCII formatted characters?
You have two things in there, a fractional string to number and an octal string to number. Only the octal string to number is providing you an integer, and the use of octal strings is very, very rare. I doubt your device is providing something like that.
Attach a VI, that has been run, shows the data in the string indicator, stopped, Save Values as Default. Save the VI. Attach to your message.
05-02-2019 07:46 AM
thank you for your time.
the data from the serial port are decimal numbers (e.g. 0,15).
I just want to convert what Im reading in the serial port buffer into a float number.
Currently the box "Zahl" provides me only the natural number (e.g. 0 instead of 0,15).
Im trying to change the representation of "Zahl" but Im not getting what I need.
05-02-2019 07:50 AM - edited 05-02-2019 07:51 AM
Hi acouch,
why don't you read the LabVIEW help on string format codes when you use non-English locale/regional settings?
Btw. which weird device is sending numeric values over the serial port using "German" settings (comma as decimal separator)?
05-03-2019 06:02 AM
I don't understand what is wierd ?
05-03-2019 06:11 AM - edited 05-03-2019 06:12 AM
Hi achouch,
I don't understand what is wierd ?
It's weird to have an external device sending data in ASCII, but NOT using the typical point as decimal separator.
I had only one (1) device in the last 20 years that worked this way: it's manufacturer assured me "because a main customer had requested that behavior"…
05-03-2019 07:38 AM
@GerdW wrote:
Hi achouch,
I don't understand what is wierd ?
It's weird to have an external device sending data in ASCII, but NOT using the typical point as decimal separator.
I had only one (1) device in the last 20 years that worked this way: it's manufacturer assured me "because a main customer had requested that behavior"…
Several Keysight devices and some Rhode Schwarz gear have an option available for localizing numeric parameters. Seldom mentioned in English manuals but, discoverable from reverse engineering some drivers.
I never could figure out why Germany went use a dot radix point. But hey, I use feet and inches and confuse then with minutes and seconds of angle.',"