LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

labview code to trigger and scan spectra from HR4000 spectrometer?

has anyone used labview code to trigger and scan spectra from HR4000 spectrometer? When I use one of the device drivers (Spectral Acquisition.vi), i miss lots of trigger when I run it for more than 100 iterations?
I was wandering if anyone is working with it or had in the past and if you could share your insight.
 
Thanks
0 Kudos
Message 1 of 15
(5,873 Views)
I don't have an experience with this instrument and cannot look at the LV drivers, but if triggers' loss starts after a certain number of iterations of an acquisition loop, it does not sound like a problem with the driver to me. Does this happen both with and without storing the data? Do you display the data through LV in real time? Can you post a sample operating VI, please?

Daniel
0 Kudos
Message 2 of 15
(5,847 Views)

Thank you for your interest. I actually have two forms of the VI (both storing data and the one where I just display the spectrum on the screen in real time and no storage).

I am attaching the VI where I have no storage just display as this is the simplest of all.

Thanks once again. 

0 Kudos
Message 3 of 15
(5,840 Views)
I apologize, but I realized you use LV7.1, while the latest I can access is LV7.0. Do you think you could just post a screenshot of the diagram, or create a LV7.0 or earlier version of the same VI?

Don't do it if it's too much of a hassle. I would check the VI for the most common time-intensive/expensive operations: AutoUpdate in plots (that gets slower the more points you have to draw), storing data in an array with indefinite size (using Build Array) and maybe something else, that I cannot fish out of my memory now. If you are concerned about the speed, AutoUpdate should be turned off in all plots. If you dont' have to have the data displayed every  time you read it, it is better to have the display of data triggered orders of magnitude slower than you trigger the analyzer (e.g. every 100 data points or only at the push of a button). When it comes to storing, using a fixed-size array created by Initialize Array and manipulated by Replace Array Subset is much, much faster than Build Array. I have been advised about these points quite recently in this forum, so I am only passing it on.

I hope this helps, I don't know if it is of any use, until I have seen the VI itself - I am sorry I could not open the sample you attached.
Daniel
0 Kudos
Message 4 of 15
(5,835 Views)

Hi,

I am attaching a snapshot of my VI. The steps that I perform before this stage in my VI is to initiate the spectrometer and calibrate/read the wavelengths. I do not think the execution of single loop takes that long apart from running the actual device driver (.dll inside the "00I Scan") . Currently my trigger period is 250 ms and I can change my integration time to anything (definitely lot less than 250 ms, I am trying 100ms and I know the read out time from the camera to software is 4ms)

0 Kudos
Message 5 of 15
(5,833 Views)
I looked at your snapshot and saw that indeed one of my previous suggestions applies here: the one about Replace Array Subset vs. Build Array use. I understand the array passed between the iterations (using the shift registers) is one dimensional, right? I suggest you try the following: put the Initialize Array in before the iterations loop, wire a "0.00" double constant as the element input and wire the Iterations control as the dimension size 0 input. Wire the output to the existing left register. Then replace the Build Array block with Replace Array Subset. Wiring of the inputs is self evident, index 0 receives the iterations index "i". Please let me know results of a test, if there is any slowing down with iterations number.

Daniel
0 Kudos
Message 6 of 15
(5,827 Views)

I made the changes. I have attached the snapshot. Is that the modification you were suggesting? I still do not get consistent time difference between each scan.

 

0 Kudos
Message 7 of 15
(5,823 Views)
Inconsistent times are one thing, overall slowing down is another, although they may have common source. I guess it is the XY plot in your case. Do you have it AutoScaled? If so, try turning autoscaling of both axes off.

Secondly, I don't quite understand the reason for the inner loop with number of iterations = constant 1. What happens if you remove the loop? I understand you want to change the number of iterations in future, but let's test the simplest things first. Removal will require indexing the Wavelength array explicitly with an apropriate block. By the way, it is customary that you EITHER define the number of iterations of a FOR loop by connecting the N input OR by indexing of an input array - NEVER both at the same time. Maybe, changing the multiple XY plot into a single XY plot won't be necessary, maybe it will, try for yourself.

Thirdly, I suggest you try enclosing the XY plot block alone in a case structure (say, in its TRUE window) and set the true condition to occur at some fraction of the total iterations, not every cycle. You do this using the index "i" of the main iteration loop, calculate modulo something (e.g. 10) and test if it is true or false. This way you update the XY plot every 10th iteration only and by choosing different modulo divider you can test, if the plot's display is or isn't the beast slowing things down.

Finally, I suspect it is not necessary to use a Local Variable of the seconds 2 indicator. How about simply wiring the output of your To-double block to the input of the subtraction block? That should let you remove seconds 2 local variable with no harm done.

Daniel
0 Kudos
Message 8 of 15
(5,820 Views)
Errata: There should be ... divide modulo something (e.g. 10), test if the remainder is zero and wire the result of this test to the case structure boolean control.
0 Kudos
Message 9 of 15
(5,815 Views)
Hi  Reja,
 
Would you please send a copy of your OOIscan.vi to me?
I'd like to use it capture the data from HR4000.
 
Thanks.
My email: wang_kylin@sohu.com
 
 
0 Kudos
Message 10 of 15
(5,720 Views)