From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
James.M

LabVIEW Development Macro

Status: Already Implemented

Functionality already available through VI Scripting

Please let me know if something like this exists, but I can't seem to find anything.

 

What I want is a tool to automate some of my subVI building and implementation. There are a few repetitive things I do during development that would be optimized if I was able to build a custom macro to complete these things with some simple customizing inputs.

 

Here is my scenario:

I have API for each module in my application. Each API VI passes an "Action" enum along with varient data. The "Action" enum is a type-def and the API uses the module's queue reference to pass the action and data to the main module VI.

Every time I want to create a new API VI for a module I have to complete the following steps:

Open a previous made API VI (or template API VI if I want to make one)

Save As my new API (i.e. ReadData.vi)

Open "Action" type-def enum

Edit Items of enum

Add "ReadData" option to enum

Close "Action" type-def

Change Action in API to ReadData

Change Icon in API to match

Save and Close

 

The only changing variables in my situation are:

Which module for which to create the API

Action name for th enum

 

 

This seems like the ideal application for a macro similar to an excel macro or other languages.

Thanks for reading!

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


4 Comments
RavensFan
Knight of NI

What you are asking for is handled by LabVIEW scripting.  So search for "scripting".

 

It is a means for using LabVIEW to write LabVIEW cocde.  Whether that does exactly what you are envisioning, you'll have to be the judge.

 

I'm not sure your message belongs in the new idea thread, or in the regular LabVIEW forum.  It depends on if you are proposing a new idea here that is different from what LabVIEW can do already.

 

(PS.  Your user icon doesn't show up because it points to an unusually named web address.  Probably a location that other people don't have access to.  You should put your icon image into your forums image gallery.  Then have your user icon point to the webadress of the image within your gallery.)

James.M
Active Participant

Thanks RavensFan, I guess I just didn't know what to search for. I used this, as well as a few other links once I knew it was possible, to generate the attached VI. I apologize for the mess, but I just made it a quick, linear VI for time-crunch reasons.

 

Helpful Links:

http://lavag.org/topic/2978-programamtically-editing-typedef-enum-or-ring-strings-and-values/

http://forums.ni.com/t5/LabVIEW/Error-when-programmatically-adding-item-to-LabVIEW-project/td-p/1225...

 

Thanks!

 

P.S. Thanks for pointing out my icon.

API Generator

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Darren
Proven Zealot
Status changed to: Already Implemented

Functionality already available through VI Scripting

James.M
Active Participant
Oh wow, how much I've learned in the past year...

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'