03-06-2018 11:39 AM
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...
Solved! Go to Solution.
03-06-2018 12:58 PM
Can you provide documentation or a function prototype? I can't picture what you're describing.
03-06-2018 02:21 PM - edited 03-06-2018 02:23 PM
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.
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.
03-06-2018 02:27 PM
I think you want to enable scripting functions in the LabVIEW Options.
VI Server-> VI Scripting
03-07-2018 08:07 AM
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.
03-26-2018 01:09 PM
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