From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do I need to give all the controller in Call library Function?

Solved!
Go to solution

Hi there,


I am interested to know about Call library function(CLF). Here I am explaining my question using example.
Capture.PNG

arg4 = cluster out

arg5 = int 1 out

arg6 = int 2 out

arg7 = int 3 out

 

I am calling simple function through CLF.  Here I am using Cluster Out,Int 1 out,int 2 out, int 3 out for output purpose only.  I am not sending any information to the DLL file using arg4,arg5,arg6,arg7 out arguments.


My question is that, do I need to add the controller for each indicator on left side of CFL?

 

I know it is giving me correct return value from the function without controller on left side. But Whenever I created Vis with help of share library function at that time it is create controller for each indicator.

So controller for each indicator make any change in terms of memory or any others?
  

Thank you,
Yash 
  

0 Kudos
Message 1 of 5
(2,230 Views)
Solution
Accepted by topic author Y@sh001

What is happening here is that those last parameters are pointers to values.

 

LabVIEW will need either an input or an output (nowadays) to create that pointer. So as long as you wire an output, it's OK. If you don't want an output, you need an input.

 

This only works for values passed by pointers. The dll functions properly, because those pointers are probably only used to set values. Sometimes values passed by pointers are also read, but in this case apparently they are not. You might want to check. My guess would be the value at those pointers is set to 0 by LabVIEW, but I'm not sure if that is defined. So the values might be undefined. That could mean it works most of the time, and sometimes not. That is not a good situation to have...

 

 

Message 2 of 5
(2,190 Views)
Solution
Accepted by topic author Y@sh001

Older versions of LabVIEW required you do wire the left side of each parameter to the Call Library Node. Since several versions this is optional if LabVIEW can determine the data type for the parameter (either through explicit configuration in the Call Library Node or through wiring an indicator directly to the the right side of that parameter.

LabVIEW will then create a dataspace with the determined datatype and according default default value (0 for numbers, False for booleans, empty string or array) and pass it to the DLL function.

Rolf Kalbermatter
My Blog
Message 3 of 5
(2,172 Views)

Hi Rolf,
Thank you for explaining in detail about dataspace use by the labview. 

Yash

0 Kudos
Message 4 of 5
(2,152 Views)

Hi 

0 Kudos
Message 5 of 5
(2,151 Views)