LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get list of parameters from Call Library Function Node (CLFN)

Solved!
Go to solution

Does anyone have a quick way to grab a list of parameters (1D array of strings) from a CLFN?  I have a CLFN with like 50 parameters and want to build a subVI to select certain outputs by name.  Can't think of an easy way to do this...

0 Kudos
Message 1 of 6
(1,545 Views)

Can you provide documentation or a function prototype? I can't picture what you're describing.

0 Kudos
Message 2 of 6
(1,519 Views)

Hello,

I'd like to inlcude a sample VI, but these read in pretty large amounts of data.  Here is a screenshot of the CLFN.  It would be really handy to select the outputs on the right side using a list of names.CLFN_Outputs.PNG

 

 

So the subVI would receive all the outputs from the CLFN and a list of names, then spit out a 1D array of CLFN outputs selected by matching the names to output array indices.

0 Kudos
Message 3 of 6
(1,511 Views)
Solution
Accepted by topic author Chris_P_SD

I think you want to enable scripting functions in the LabVIEW Options.

 

VI Server-> VI Scripting

Rolf Kalbermatter
Averna BV
0 Kudos
Message 4 of 6
(1,507 Views)
wrote:

Does anyone have a quick way to grab a list of parameters (1D array of strings) from a CLFN?  I have a CLFN with like 50 parameters and want to build a subVI to select certain outputs by name.  Can't think of an easy way to do this...


You can try checking out the white page on Configuring the Call Library Function Node as a possible starting point.

Marco C.
Applications Engineering
National Instruments
0 Kudos
Message 5 of 6
(1,481 Views)

Thanks to all who responded to this.  The solution I came up with was to add two sub VI's to the main VI that calls the CLFN functions.  The two sub VI's use the scripting functions that Rolfk suggested.  The first sub VI, called "FindCLFNOutputs_v180309_A.vi",  works as follows:

INPUTS:
1) Filepath to "DesiredCLFNOutputs.txt". This is the master list of desired CLFN outputs.
2) 1D array of strings listing CLFN function names to extract data from.
3) Error input.

OUTPUTS:
1) 1D array of strings listing function names of CLFN functions found.
2) 1D array of refnums for CLFN functions found.
3) Integer value of CLFN matches found.
4) Error out.
5) 1D array of clusters. Each cluster contains CLFN name found, 1D array of strings listing desired output names, and
1D array of integers listing desired output indices.

The "aClstrOtptIdxs" is intended to be searched later by the sub VI "GetValsFromArrIdxs.vi".

 

 

The second VI, called "GetValsFromArrIdxs_v180320_A.vi", uses the "aClstrOtptIdxs" array from the first VI:

INPUTS:

1) String with the name of the CLFN of interest,
2) 1D array of clusters from "FindCLFNOutputs_v180309_A.vi", each containing CLFN name, Desired Output Names, and Desired Output Indices
3) Error input

OUTPUTS:

The VI searches for the desired CLFN and if not found, returns an error. If found, outputs are as follows:
1) 1D array of desired output names
2) 1D array of desired output indices for the desired CLFN output array.
3) 1D array of desired output values from matched function output indices.
4) Any errors generated

 

GetCLFNOutputConfig.PNG

 

 

0 Kudos
Message 6 of 6
(1,395 Views)