12-19-2011 05:04 AM
Hi,
I am working on a project-reading data from gaussmeter. I can read the data, but when I am trying to write it back I get the numbers without decimals. I have to put my data in an array, because later I will write the position of the object in the same array...
Data is written with ˝dots˝ and read with ˝commas˝. Maybe there is a problem, I tried to fix this but I wasn't really successful.
Any idea?
Thanx to all!
12-19-2011 06:09 AM
Hi zwax,
writing strings with a format string of "%.6f" is rather senseless.
Reading them with a format string of "%.;%f" could be the solution. (Btw. they aren't read with a decimal delimiter of ",", they are only displayed and expected using the ","!)
12-19-2011 06:30 AM
Hi,
i tried few different formats, and this is not the solution. What about there where I use ˝Search 1D Array˝ for ˝.˝ and Replace Array Subset with ˝,˝-is this correct?
12-19-2011 08:11 AM
Your VI doesn't make much sense. You're taking the "RX buffer", which I assume is some string you're reading from an instrument and converting that to an array. Why? The output of the Build Array will be an array of 1 element. You're then searching that ... 1 element array ... for an empty string. Which doesn't exist. Thus, the rest of the array gymnastics don't make much sense.
What does your original string (i.e., the contents of "RX buffer") look like?
Also:
12-19-2011 09:05 AM
I am converting this to an array, because i will have to simulate magnetic field on a 3d surface of my object-cylinder. Later I will get position of a probe-x,y,z and my rx buffer-value of magnetic field there. I will build a 4d array and i will try to draw this... That 's my mission 🙂
Rx buffer is just a string read from serial port.
And a 1 sec delay is just a simulation of moving the probe-for now.
This vi will run on this computer and this os.
I am writing my data, beacause i will need them later... I also tried to write it directly to an array, but every string that came from gaussmeter overwrote the previous one...
I hope this explanes a few things 🙂
12-19-2011 12:51 PM
I don't think you understood what I had said. You are converting a string to an array of ONE element. The remaining array operations consequently make no sense. Why search an array of ONE element for an empty string? It won't be there unless the initial string is empty. And it if is, why do you need to convert it to an array to check it? It seems to me that you were intending to do what the Spreadsheet String to Array function does - it converts a delimited string to an array.
12-20-2011 08:38 AM - edited 12-20-2011 08:41 AM
Maybe the OP wants to develop Rube Goldberg Code.