LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Global replace in a function tree file (*.fp)

Is there a way to perform a global replace in a function tree file?

 

Wanting to replace some long prefixes in function names in the .c, .h, and .fp files generated when using the Create .NET controller or Create ActiveX controller tools.

0 Kudos
Message 1 of 4
(3,429 Views)

JeffC,
I went through the same steps in Tools >> Create ActiveX Controller. Unfortunately, these dialogs did not give the option to specify the prefix since it is automatically generated and prepended to the function calls.

 

I opened up the .fp file in a text editor, but it is a binary file, and so there is no way to modify the function names. In addition to the .fp file, you would need to modify the .c and .h files as well (as you mentioned).

 

It may be possible to rename the functions in the .c and .h files (since they are text), but there is no way to modify the .fp file (since it is binary).

 

As an alternative, if you are seeking to just make the code more readable, it may be possible to use a #define to do an automatic substitution for the function names.

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,416 Views)

Hi Jeff,

 

Actually, you can do a search/replace on the .fp file. After you open the .fp file in CVI, select Edit>>Replace in the function tree editor and then select the check boxes that correspond to the changes you want to make:

 

replace.png

0 Kudos
Message 3 of 4
(3,391 Views)

Hi Jeff,

In addition to Luis's post, I found another way to change just the prefix in the Function Tree.

 

1. Open the Function Panel (*.fp) file in CVI.

2. Right-click the Title and choose Edit Node... (see image)

 

EditNodeMenu.PNG

 

3. In the 'Edit Instrument Node' popup, you have the option of changing the Prefix used for all of the functions. (see image)

 

 EditNodePrompt.PNG

 

As an example, I shortened the hp34401a prefix to hp for my IVI driver.

Jared A.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,383 Views)