LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Write to File Formatting

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.

0 Kudos
Message 11 of 21
(668 Views)

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.

0 Kudos
Message 12 of 21
(667 Views)

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

0 Kudos
Message 13 of 21
(661 Views)

I opened up the data in notepad and it still comes out with missing data. 234.56789E-

0 Kudos
Message 14 of 21
(657 Views)

Did you use %s in this case?

0 Kudos
Message 15 of 21
(643 Views)

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.

0 Kudos
Message 16 of 21
(640 Views)

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

0 Kudos
Message 17 of 21
(623 Views)

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?

0 Kudos
Message 18 of 21
(620 Views)

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.

0 Kudos
Message 19 of 21
(599 Views)

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)

0 Kudos
Message 20 of 21
(605 Views)