LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C-style variable arg list handling in Call To Library VI?

I have Labview 6.0 on a Windows 2000 PC and I have a DLL with routine that I am trying to call in a VI. I am using the Call Library Function VI to call this routine. My problem is this. The routine uses a C-style variable argument list (like the printf function). In other words, the routine can accept any number of arguments and will decide how many of those arguments to process and what those arguments mean based on the values of the arguments.

Is there a way to handle such variable argument lists in Labview, or do I have to create a different VI for each possible argument list length?
0 Kudos
Message 1 of 3
(2,725 Views)
Neal,

Well, the only way to do it is to create a different Call Library Function Node for each number of parameters. If you want to write a wrapper DLL, then you might be able to do it a different way, but I don't think so.

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
0 Kudos
Message 2 of 3
(2,725 Views)
Thanks. So, just to double check, the only way to work with a DLL routine that can have arbitrary numbers of arguments is to guess ahead of time how many arguments there will be and create the appropriate number of terminals? I have a related question which you might be able to answer. I've noticed that some VIs offer a "add terminal" contextual menu option. If wanted to create a wrapper VI for a Call to Library Function VI that calls on a variable argument function and handles some intermediate processing, could I give such a VI a "add terminal" option? If so, how do I manage added terminals within the wrapper VI?

Thanks,
Neal
0 Kudos
Message 3 of 3
(2,724 Views)