10-19-2009 10:47 AM
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?
10-19-2009 12:20 PM
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?
10-19-2009 12:28 PM
here is the vi.
10-19-2009 08:52 PM
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?
10-20-2009 01:27 AM - edited 10-20-2009 01:28 AM
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.
10-20-2009 08:09 AM
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.
10-20-2009 08:35 AM
Thanks for the explanation. Now it makes sense.
🙂