05-24-2017 02:55 PM
I'll change around the Open and Close visas. I'm piggy backing on what someone had written previously before. But im not entirely sure how I should go about to get clean data from my device. The current setup is a laser with set wavelengths, and then a power meter that measures the power at that wavelength as it sweeps through each wavelength.
05-24-2017 02:59 PM
I'm using an Agilent 8164A lightwave multimeter, and I have it talking to a Power meter. Where 8164A will sweep through wavelengths and the power meter measures the power at those wavelengths. The environment is not terribly noisy but the laser makes it negligible to my understanding. I'm not really sure how to check if the messages are longer than 100 bytes / characters. I'm also not sure of how the data is coming from the instrument, but i know labview calls it a string of 1-d Array.
Sorry for being unable to answer some questions, again I'm super new to all this.
05-24-2017 03:03 PM
Hello,
just a thought: It seems you are opening your 'signal.csv' in Excel, which uses its own formatting style for numbers. How does 'signal.csv' look in a normal text editor (e.g. notepad) ?
UliB
05-24-2017 03:04 PM
I opened up the data in notepad and it still comes out with missing data. 234.56789E-
05-24-2017 03:12 PM
Did you use %s in this case?
05-24-2017 03:16 PM
When i replied the last time I had it as %.9s I reran it as %s and it gives the same issue as the issue in picture 1 where it skips rows.
05-24-2017 03:27 PM
I think the format specifier should be %s, which writes all characters from one string array element. %9s writes only 9 characters from the string, which truncates the numbers in your case.
An Empty row means that there is no string data in this array element. 'VISA Read' did not return a string in this loop iteration. Well I don't know why, but you could do this: Check if VISA Read returns an empty string in the loop and use a conditional autoindexing loop tunnel.
UliB
05-24-2017 03:29 PM
Does the data come in with a linefeed character? If so, that is going to show additional rows. Are you using a linefeed character as a termination character?
You are reading 100 bytes. How much data do you expect to get on every read? Is it ever longer than 100 bytes?
05-24-2017 03:36 PM - edited 05-24-2017 03:37 PM
No, I do not believe there is a linefeed character unless it comes standard with something.
As far as my data goes, this is what is happening.
*I'd like to note im still learning this system and how this process works so I could say some horribly inaccurate things*
First I measure the background noise which is about 200nano watts.
Then, i measure reference ( with the laser on) and it reads about 70 microwatts) (If i recall correctly)
Then I measure Signal (laser with some device) When the lasers wavelength matches up with the device, it only allows a small amount of light to pass through it. The light that is being passed through is being measured.
When the wavelengths match up, the value becomes lower and for some reason is causing my error.
The data is just fine when it is 0.0000116
but if it dips down to say, 0.00000855
It starts skipping lines. and i have no clue as to why its skipping a line when the value gets smaller.
As far as the bytes go, I'm not entirely sure. I'm gonna say yes.
05-24-2017 03:47 PM
I'm not sure if my last post went through.
No I do not believe there is a linefeed character. And no I do not believe there is a linefeed character at termination. I'm just putting an array of data into the write spreadsheet with commas as delimiters.
For some reason the data wont read past a certain value.
it will write 0.0000166
but not 0.00000855
This is just an example, not actual values.
Although you can see them in the pictures.
I'm not sure about the bytes, but I know the values can get pretty low so I'm gonna say it does go higher than 100 (if im already at 100 bytes)