Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Hamamatsu Mini-Spectrometer

Solved!
Go to solution

Hello Everyone

 

I am trying to make a Vi that is reading a Hamamatsu minispectrometer through dll calls.

My problem is that it is only working half the time. That is, I can run the VI once and there is no error, but the next time i run LabView tells me its Memory is corrupted. The third time it will work again...annoying!

Any ideas why?

 

Regards Rasmus

0 Kudos
Message 1 of 25
(6,900 Views)

How are you running the VI? Are you running it "on-demand" byt pressing the Run button, or are you using the "Run Continuously" button? If you're doing the latter, STOP. Put a while loop inside your code to enclose the actual data gathering. The opening and closing should be outside the loop.

 

Now as to your problem: Watch your datatypes. You have coercion dots in your code. They mean something. In the call to "RC_GetTemperature" you've specified the array as an array of 8-byte doubles. However, you're allocating an array of 16-bit values. Which are 2-byte values. You are not allocating the appropriate amount of memory.

0 Kudos
Message 2 of 25
(6,893 Views)

Thanks for the reply.

I still cant get it to work. I have deleted the temperature node and its the same problem. 

I used the function specification list provided by Hamamatsu to assign the different data types. The thing I do not really understand is it works every second time and it is the same with or without the temperature node.

 

Regards Rasmus

0 Kudos
Message 3 of 25
(6,850 Views)

Can you provide some documentation on the DLL?

0 Kudos
Message 4 of 25
(6,840 Views)

Of course.

Here is the function list.

I get an error 1097. I can se here on the forum that a lot of people had a similar problem, but I still cant solve the problem in my case..

Though I think I have narrowed it down to that it has something to do with the storage buffer in the Get_temperature node. I have tried different data representations, used reset_device and reset_pipe - but still same problem.

Is it possible to empty/flosh the buffer at the end of each run?

 

Regards

Rasmus

0 Kudos
Message 5 of 25
(6,815 Views)

You are not coding up the Call Library Function Nodes correctly. Specifically, the RC_GetSensorData has 5 arguments according to the documentation. Your code only has 4. Also, several of those parameters are supposed to be passed in "By Ref". This is the same as "Pointer to Value" for the "Pass" dropdown.

Message 6 of 25
(6,799 Views)
Solution
Accepted by topic author Rasmus N

I have a working set of VIs for these spectrometers.

 

I was involved in the development of the spectrometers to be exact, I know the RC series like the back of my hand or better.  I'll see if I can dig them up and get them posted.

 

Shane

 

Edit: Here ya go and Enjoy.

Message 7 of 25
(6,795 Views)

There MAY be some slight changes between the versions of the DLLs I had for my work and the final released DLLs so if things aren't working properly that might be a good explanation.

 

Regards

 

Shane

 

PS I beleive the names of the functions in the DLL may be different but if memory serves me correctly, that is the only real difference (apart from needing different DLLs).

0 Kudos
Message 8 of 25
(6,792 Views)

That is fantastic! Thank you very much.

And now that i got a hold on one of the software developers from the RC series, you might be able to answer another question 😉

I was wondering if it would be possible to use the spectrometer as a photon counter instead of the analog to digital measurement?

As I see it, the only thing I need is the gain of the multiplier tube. The only gain I can find in the manual is "high" and "low" which are a bit unprecise. 

Is this a wrong assumption?

Well now I am looking forward to get my hands on the spectrometer again, thanks. 

 

Regards

Rasmus

0 Kudos
Message 9 of 25
(6,765 Views)

I was involved in the development of the optical side of the spectrometer, not the software per se.  I had no hand in the DLL whatsoever.  I just used it for testing purposes.

 

There is no multiplier tube.  IT has a linear CMOS detector.  The only gains supported are low and high, everything else will default to high.

 

If you really want to measure real light levels you need to calibrate the spectrometer vs a sensor with a known spectral response (counts / photon).

 

Shane

0 Kudos
Message 10 of 25
(6,756 Views)