Sunday, December 31, 2023

Speedup the VI's running inside loop_Inline sub vi

 Calling the sub vi's continuously inside loop makes sub vi over head. This causes delay in execution speed. To over come this issue we can make the sub vi as inline vi ( Refer following articles and discussion forum for more details). 

In one of our project we set both inline & subroutine VI properties (wherever possible) to increase the execution speed of sub vi. 

https://www.ni.com/docs/en-US/bundle/labview/page/vi-execution-speed.html

https://forums.ni.com/t5/LabVIEW/Inline-subvi/td-p/1279078



Wednesday, September 28, 2022

Solving ActiveX- Excel error -2147319784 & Crash Issue

 I was upgrading LabVIEW 7.1 code to LabVIEW 2020 (32 bit) which has activeX excel report generation.  Code upgraded for Win 10 OS 64 bit & Office 365 - 64 bitVersion. While executing the EXE in some other Win 10 OS with Office 365 version machine got Excel Error "-2147319784". 

To solve this issue ActiveX function used VI properties->Execution->Preferred Execution System changed to User Interface based on the https://forums.ni.com/t5/LabVIEW/What-is-error-2147417851/td-p/103921 forum suggestion. 

EXE crashes while generating Excel report in Win10-64 bit OS with Office 2016-64 bit machine. 

To solve this issue, we removed the “Save As” ActiveX function in code & replaced with Save function. After that it works in both Office 365 & 2016 (both 64 bit) with LabVIEW 2020 32 bit

Here development machine Office 365 version also important we used Version 1609

Hope this will help...

Monday, January 27, 2020

Tuesday, March 5, 2019

Add Enum Items programmatically

I learned some trick in ni website to add the items programmatically in Enum control. I am aware to perform the same using  panel control reference method using VI reference (https://forums.ni.com/t5/Example-Programs/Programmatically-Add-Elements-to-Enum-Ring/ta-p/3514584). But I preferred this method which is more simple & easy to code.
Here we need to add one Ring control & set the "Strings" property and run the code. Now Rig control will have the items which you set through "Strings" property. In front panel right click over  Ring control and replace the it with Enum control. Now Enum will have the all the items which was added in Ring control.


Sunday, December 16, 2018

Get Window Handle reference using windows API

We can get any windows task handle reference using user32.dll. For that we need to use the window title as a input for the user32 windows dll (We can call user32 dll using call library function node). I attached the code snippet & step by step instruction pictures for reference. Using the Window Handle reference we can programmatically perform some task in that window like minimize, maximize & close the window etc...



Tuesday, May 23, 2017

Tip of Case Structure using string selector



Today I learned a new trick about case structure. As we know, once we connect the numeric number in the “case selector” & if we use 1...4 in “selector label” that case will work for 1, 2, 3 & 4 inputs. Similarly if we connect string in “case selector” & if we use a..d in “selector label” that case will work for a, b & c inputs (not for d). Screenshot attached for this condition. One more point is, this will work on capital letters & small letters if we selected “Case Insensitive Match” option.

Wednesday, September 28, 2016

Automate text update in BookMark of MsWord using LabVIEW


I am uploading the VI snippet to automate the text update in the defined bookmark field of the Ms Word document.


Sunday, December 6, 2015

LabVIEW Keyboard Shotcut for Objects & Movement

Today I learned one hidden trick to scroll through the Event, Case Structure & Stacked Sequence. Most of us know Ctrl + Mouse Wheel shortcut used to scroll through the Event, Case Structure & Stacked Sequence states one by one.  But if we use Ctrl + Shift + Mouse Wheel it scrolls through every 5th case/Event/Sequence state (Like 5,10...) from the beginning state (0 state). It will work only if we have more than 5 case/Event/Sequence states. I verified this Keyboard Shotcut in LabVIEW  2009

Wednesday, November 25, 2015

Moving (Running) Average using LabVIEW function without loop

Today I learned one trick from NI discussion forum to calculate the Moving (Running) Average without using loop. FIR filter LabVIEW function used for this calculation. See the attached screenshot & VI snippet code below.



Monday, November 24, 2014

Strip a path using Build Path function

Today I learned one LabVIEW trick from my colleague Balaji. He showed me how to strip a path using build path function. I attached code snippets of the trick below.



Thursday, October 30, 2014

Remove duplicate element & Sort the Array

Using varient function we can remove the duplicate elements & sort the elements of the array (Numeric,String array...). You can find the varient functions like "Set Variant Attribute"," Get Variant Attribute" in block digraram-> Function Palatte-> Cluster,Class & Varient -> Varient (LabVIEW 2009). By using those function without implementing anyother logics we can achieve removing duplicate element & sort array. It will work in String,Numeric & reference array also. See the simple exampleVI snippet attached below.
Front Panel : 

 Block Diagram :

Tuesday, October 28, 2014

Automate Powerpoint Macro execution using LabVIEW ActiveX









Using LabVIEW ActiveX functions we can call the powerpoint library to execute the macro of the opened Powerpoint file (*.ppt). Example code attached as a VI snippet. This VI module is tested using MS-Office 2003.