LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory problems with .dll

Hi all,
 
I have a memory problem calling a .dll file from the instrument supplier (Rohde&Schwarz). When I use SubVI's containing calls to the function, the CPU shows a big peak, and the memory usage of the LabView process increases each time.
 
Since I use those functions continuously, at the end I run to an "not enough memory" error.
 
Is there any way to avoid/reduce this issue?
 
(I attach an example of one of those subVI, BT_RSCMUBT_Sig_InitRxqBer.vi, and the .dll file: rscmu2bt_32.dll)
 
Many thanks in advance to any tip!
 
Gatet
0 Kudos
Message 1 of 7
(3,897 Views)
Hi Gatet.
Please remove that Error_Handler.VI and verify that the DLL has a good performance.
Then create a more sophisticated error handler i.e. do not read and write to a string indicator by using property nodes. You could for example use a queue instead.
Your memory issue should be solved as soon as you limit the number of characters you write to the string. Currently, there is no limit.
Regards, Guenter
Message 2 of 7
(3,881 Views)

I just forgot to point out clearly: I do not expect the DLL to be the origin for your memory problem.

Guenter

Message 3 of 7
(3,879 Views)
Vielen Dank, Herr Müller! Smiley Wink
 
First of all, many thanks for your time. I will try to apply your suggestions, but could you please let me know a bit more about this queue function? What I do with this string is to write each command executed, thus allowing the user to show a log file.
 
Can this queue allow the same functionality?
 
BR,
Gatet
0 Kudos
Message 4 of 7
(3,868 Views)
Hi Gatet.
A queue can be setup as a lossless communication between two (or more) points in your code, which is exactly what you need.
I do not want to do copy and paste from the LabVIEW Help (which is very thoroughly written). It comes with documentation about all queue functions available in LabVIEW.
LabVIEW also ships with examples on queues. A starter could be the "Queue Basics.VI" that introduces the most important techniques.
If any example opens a new question on LabVIEW -> Use this forum.
Guenter
Message 5 of 7
(3,847 Views)

Hi, many thanks again.

I have checked about queue help info, it's now clearer and look to be a good solution. I have just a question: can I open the queue each time I want to write/read on it; or the best way is to pass the queue data trough the different subVI's? (have a look on the attached main_OPEN and main_IN_OUT files)

The question is not trivial, since there are hundreds of functions where the LOG functionality should be modified (from string to queue), in the other hand I guess that the passed data has better performance....

Gatet

 

0 Kudos
Message 6 of 7
(3,830 Views)

Hi Gatet.
Yes, you can obtain the queue each time you want to enqueue an element.

You will get better performance by wiring the queue instead of obtaining a reference each time you want to enqueue an element. (Obtain Queue might take a couple of milliseconds even if the queue already exists.)

You can prevent wiring the queue to all of your VIs by
(1) using a global variable of the type queue (obtain the queue once and write it to the global variable).
(2) having the queue "live" in a so-called "functional global VI". Ben's nugget has a short introduction on them (and covers some more ideas what you can do with VIs that store data in an uninitialised shift-register).

Regards, Guenter

Message 7 of 7
(3,816 Views)