LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call library function inside a conditional disable bug

i'm trying to call a function in a dll using the call library function inside a conditional disable structure.

 

one of the parameters is a pointer to a C structure.

 

here is the prototype:

 

short in myfunction(short in DevNum, void *pMetrics);

 

outside of the conditional disable, LabVIEW allows me to wire the pMetrics parameter to a cluster.

 

if i put the function inside the conditional disable, LabVIEW doesn't allow me to wire it.

 

as a workaround, i put the cluster inside the conditional disable as well.

 

any ideas?

0 Kudos
Message 1 of 7
(3,505 Views)

I'm not sure I fully understand what you are describing.

Can you post a screen shot of the code with the conditional disable structure?

0 Kudos
Message 2 of 7
(3,491 Views)
0 Kudos
Message 3 of 7
(3,481 Views)

You should be able to move the cluster "ACEX_MTI_METRICS" outside the structure and wire all cases to it.

 

Why are you using a conditional structure instead of a regular Case Statement?

 

What are you trying to accomplish with this structure?

Message 4 of 7
(3,450 Views)

Simply create a constant of the cluster and and put it outside the disable structure. Wire this constant to all inputs (left side terminal) of the Call Library Node. A Call Library Node (CLN) set to Adapt to Type does need a valid datatype to adapt too. This works from the outside side (right side terminal) of the CLN only if the according indicator is inside the same data structure. In older LabVIEW versions you actually had to always define the left side by wiring a constant or a dummy control to it.

 

This has to do with the algorithme that evaluates datatypes along wires. Making that algorithme go backwards (against the natural dataflow) inside one subdiagram without causing circular references or similar is already a challange. Doing that across diagram boundaries (case, disable, loop, etc. structures) is basically impossible without causing the entire edit operation to get very slow.

Message Edited by rolfk on 10-20-2009 08:28 AM
Rolf Kalbermatter
My Blog
Message 5 of 7
(3,437 Views)

thank you. this seems to work.

 

to answer the previous questions.  when i wire the output to the cluster, i get this message in the cotext help window.

 

You have connected 2 terminals of different types.

The type of the source is void.

The type of sink is cluster with 4 elements.

 

the reason why i'm using the conditional disable is that i am targeting 2 different operating systems, LabVIEW Real Time and Windows. if i didn't use the conditional disable, LabVIEW thinks that the vi has a dependency on both dlls. when i run the vi, both dll's get deployed to the target. there are some windows API functions used in the windows dll which are not supported. therefore, it doesn't find them in the kernel.dll and the vi fails to load. using the conditional disable and checking what OS is the target resolves the issue.

Message 6 of 7
(3,414 Views)

Thanks for the explanation.  Now it makes sense.

 

🙂

0 Kudos
Message 7 of 7
(3,405 Views)