08-18-2022 01:19 AM - edited 08-18-2022 01:26 AM
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.
08-18-2022 04:19 AM
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
08-18-2022 09:16 AM
My most reused VIs are simple ones that should be or are now built in functions like this:
My time delay vi
My Get time in Seconds vi
08-18-2022 09:43 AM
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.
08-18-2022 09:58 AM
@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.
08-18-2022 11:38 AM - edited 08-18-2022 11:39 AM
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.
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.
08-18-2022 12:20 PM
08-20-2022 07:07 PM
08-22-2022 07:48 AM
And these
08-23-2022 12:52 AM
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.