07-16-2021 12:56 AM
Hi,
I want to stream data from wavelength meter software to LABVIEW ,is it possible?
07-16-2021 01:07 AM
Hi kitt,
@analog_kitt wrote:
I want to stream data from wavelength meter software to LABVIEW ,is it possible?
Ask the manufacturer of that "wavelength meter software" about the capabilities of its product!
07-16-2021 07:34 AM
@analog_kitt wrote:
Hi,
I want to stream data from wavelength meter software to LABVIEW ,is it possible?
You're going to have to give us a lot more information that his in order to receive an answer. What is the wavelength meter that you're using? Does the software have the ability to output data? Does the manufacturer perhaps offer LabVIEW drivers for the wavelength meter which allows you to avoid their software altogether? Does the wavelength meter have a simple communication protocol that would allow you to develop your own drivers in LabVIEW? The short answer is that LabVIEW would be capable of capturing the data, but whether it can be streamed from the existing software or the level of effort to capture the data is dependent upon these answers.
07-25-2021 11:29 PM
thanks for reply. I have consulted with manufacturer .Yes it is possible by using Library Call function ,the manufacturer providing .
07-26-2021 05:22 AM
Hi,
Here I am attaching LabVIEW code used to access the wavelength meter . I am facing one issue during writing the data to a file.
sample rate of data from wavelength meter 400 Hz .I am saving the data inside the case structure or inside the while loop. Sample rate is 400 Hz when not writing the data to a file but sample rate is significantly reducing when writing the data to a file using ''write to measurement file vi'' .
I also noticed some data loss in the saved file. Can you suggest any better way of writing data very fast on the file so that sample rate is not effected by the writing on a file.
07-26-2021 08:21 AM
@analog_kitt wrote:
Hi,
Here I am attaching LabVIEW code used to access the wavelength meter . I am facing one issue during writing the data to a file.
sample rate of data from wavelength meter 400 Hz .I am saving the data inside the case structure or inside the while loop. Sample rate is 400 Hz when not writing the data to a file but sample rate is significantly reducing when writing the data to a file using ''write to measurement file vi'' .
I also
noticed some data loss in the saved file. Can you suggest any better way of writing data very fast on the file so that sample rate is not effected by the writing on a file.
First of all you did not attach your LabVIEW code - you attached a picture of your LabVIEW code. It's usually a good idea to attach actual code.
There are a few of things that I would recommend. First, get away from using that "write to measurement file.vi." You should instead open the file outside the loop, write inside the loop, and then close after the loop ends.
Next, I would separate the data logging from the acquisition loop. You do this using a queue - you put the data in the queue in the data acquisition loop and read it in the data logging loop. (Channel wires can also be used for this). Check out the Producer/Consumer template to get an idea for how this works.
Finally, you might also consider saving the data in a binary format. LabVIEW has native functions to write in TDMS format. There is also a plug-in for Excel to read TDMS files.
07-27-2021 11:47 PM
Hi Johntrich1971,
Sorry for not uploading vi file. I have attached the vi file of my program.Producer loop create 400 data per second and I tried to save the data in consumer loop .In both the loop I put waveform graph to monitor the data.When the program is running ,I could see that both waveform graph showing same kind of data ,but when I tried to save the data in TDMS format it is saving huge amount of data .For example ,if the producer loop runs for 10 second ,it generates 4000 data .But data saved in the tdms file contains 1048576 data which is the last row of .xlsx file .
07-28-2021 01:37 AM
Hi kitt,
@analog_kitt wrote:
but when I tried to save the data in TDMS format it is saving huge amount of data .For example ,if the producer loop runs for 10 second ,it generates 4000 data .But data saved in the tdms file contains 1048576 data which is the last row of .xlsx file .
Because YOU have it programmed this way!
You can easily calculate how many samples will be saved after 4000 iterations…
Simple solution: save to file just once after reading those 4000 samples!
07-28-2021 08:06 AM
@GerdW wrote:
Hi kitt,
@analog_kitt wrote:
but when I tried to save the data in TDMS format it is saving huge amount of data .For example ,if the producer loop runs for 10 second ,it generates 4000 data .But data saved in the tdms file contains 1048576 data which is the last row of .xlsx file .
Because YOU have it programmed this way!
- You are reading single samples from your data source.
- You build an array from those samples.
- You save that array to your file!
- In the first iteration you save just one sample to the file, in the 100th iteration you save 100 samples to your file. After 100 iterations the file already contains (1+100)*50=5050 samples!
You can easily calculate how many samples will be saved after 4000 iterations…
Simple solution: save to file just once after reading those 4000 samples!
I agree with GerdW. You keep building up your data and resending the same data over and over with more data added to it. You should either wait until the test is complete or track the number of samples and send the data when a specified number of samples is reached (being sure to clear the sample buffer when doing so). You should also be able to send the individual sample to write to TDMS. Just do your division on the data as it comes in and send that to your queue (change your queue to single element instead of array).
A few other observations:
1. Why are you using a local variable to write to the "wavelength / nm 2" indicator? The indicator is there. Use it.
2. Why do you have this piece of code that creates a constant on every iteration of the loop:
Do this instead:
3. Consider getting rid of Waveform Graph and only using Waveform Graph 2. You could then move your calculation into the consumer loop. You would also have no need for the shift registers in the producer loop, though you would need to add one in the consumer loop.