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
(7,470 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
(7,463 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
(7,420 Views)

Can you provide some documentation on the DLL?

0 Kudos
Message 4 of 25
(7,410 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
(7,385 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
(7,369 Views)