From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is you most reused VI you came up with?

Share your wisdom!

 

I have plenty of favorites, but the one most useful one is Malleable VI Rotating Log, which takes anything repeatedly and makes a growing array out of it (up to a set size, or growing infinitely). It can be used for:

 

1) moving filters (e.g. moving average)

2) perpetual logging to file (detects if reached max array size)

3) replacement for History probes which are cool but inefficient and slowing the execution.

 

Watch out, causes memory leaks if array max size is not connected.

 

Actually Malleables are a cool way for me to abstract certain problems in a general way.

Message 1 of 34
(1,680 Views)

My most used subvi is to convert different units of flow rate, where the user can pick the unit he wants to see. This subvi is used several times in most of my programms to change the logging output or the display unit in diagramms.

 

Timo

Message 2 of 34
(1,644 Views)

My most reused VIs are simple ones that should be or are now built in functions like this:

 

My time delay vi

most2Capture.PNG

 

My Get time in Seconds vi

most1Capture.PNG

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 34
(1,605 Views)

My most common VI would by my version of the Stall Data Flow.vim.  I made a copy to handle an incoming error (do not wait if there is an error).  See attached (saved in 2019).

 

After that would probably be my VISA/SCPI library which handles initialization depending on the bus type, just sending commands (appends the Carriage Return and Line Feed), performing queries (send the request and wait for the response), and closing stuff out.  I do a lot of instrument communications.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 34
(1,593 Views)

@VitSlaby wrote:

Share your wisdom!

 

I have plenty of favorites, but the one most useful one is Malleable VI Rotating Log, which takes anything repeatedly and makes a growing array out of it (up to a set size, or growing infinitely). It can be used for:

 

1) moving filters (e.g. moving average)

2) perpetual logging to file (detects if reached max array size)

3) replacement for History probes which are cool but inefficient and slowing the execution.

 

Watch out, causes memory leaks if array max size is not connected.

 

Actually Malleables are a cool way for me to abstract certain problems in a general way.


I no longer use arrays for this purpose. I use lossy queues. To retrieve the data you simply flush the queue or check its status. All of the the other things needed are handled by the queue itself so I don't worry about limiting the size of the array or keeping track of the index in a circular buffer.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 5 of 34
(1,582 Views)

Technically speaking my most used VI is a simple range-creating malleable VI that takes in x and y and outputs x+y and x-y. Working in Test Development, very often in my programs I would up needing to find out if a value is in a range of that form. Though in practice, my most used is a "Place Contents" VI that contains FaKI State Machine (pronounced Fay Kay Eye as in "fake JKI"), which is a producer consumer version of the popular architecture. But it contains several supporting SubVIs as you can see, so it isn't just one VI.

Spoiler
FireFistRedhawk_0-1660840326537.png FireFistRedhawk_1-1660840577596.png   

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 6 of 34
(1,553 Views)

paul_cardinale_0-1660843195231.png

 

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 7 of 34
(1,532 Views)

 - My own implementation of "Split String" to manage more corner cases like no separator in the input string, empty last element or empty regex:

 

Better Split String.png

 

 - A simple and compact error inserter:

 

Insert Error.png

 

 

Message 8 of 34
(1,405 Views)

And these

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 9 of 34
(1,353 Views)

I'll add two VIs that I like to use for timing slow tasks in faster loops. For example there is a task in one of my projects where I check for free disk space every 10 minutes and if there is too little, I move files to sd card or delete them. But I also need the same loop to report to watchdog loop every 5 seconds. And once the app is set to exit, I want the loop to stop in a matter of seconds. This timer does the timing thing. There is a standard and autoreset variant.

Download All
0 Kudos
Message 10 of 34
(1,318 Views)