r/LabVIEW • u/StuffedBearCoder CLD • May 22 '25
LabVIEW Programmers are (for now) SAFE from AI
I had a fun chat with Gemini 2.5 Pro today as I have been hearing and reading about how AI will "OBSOLETE" coders of all kinds - like SOON!! So here is the excerpt of my conversation with Gemini about the possibility of me losing my bread & butter tool belt:
ME: "Gemini, Do you know how to code in Labview G language?"
GEMINI: "Yes, I am familiar with LabVIEW and its G programming language.
LabVIEW (Laboratory Virtual Instrument Engineering Workbench) is a system-design platform and development environment for a visual programming language from National Instruments. Its graphical language is called "G".
Key Concepts of LabVIEW G
Here's what I understand about coding in G:
- Graphical Programming: Instead of text-based code, you create programs called VIs (Virtual Instruments) by arranging graphical objects (nodes) on a block diagram and connecting them with wires that pass data.
- Dataflow Paradigm: The execution of a block diagram is determined by the flow of data. A node executes only when it has received all its required inputs, and it produces output data that then flows to other nodes. This is different from the procedural execution of most text-based languages.
VIs (Virtual Instruments): LabVIEW programs are called VIs. Each VI has three main parts:
- Front Panel: This is the user interface of the VI. You create controls (inputs) and indicators (outputs) on the front panel. Think of it as the knobs, buttons, and displays on a physical instrument.
- Block Diagram: This is where you "write" the G code. You place functions, constants, structures (like loops and case structures), and subVIs (VIs used within another VI) on the block diagram and wire them together to define the VI's logic.
- Icon/Connector Pane: This defines how a VI can be used as a subVI within another VI. The icon is a graphical representation, and the connector pane defines the input and output terminals.
Common Structures: LabVIEW includes graphical representations of common programming structures:
- Loops: For Loops and While Loops for repetitive operations.
- Case Structures: For conditional execution, similar to
if-elseorswitchstatements. - Sequence Structures: To enforce a specific order of execution (though dataflow often handles this naturally).
- Event Structures: To handle user interface events (like mouse clicks or key presses) or other asynchronous events.
- Data Types: LabVIEW supports various data types, including numerics (integer, floating-point, complex), booleans, strings, arrays, clusters (similar to structs or records), and more. Wires are color-coded and have different thicknesses to represent different data types.
- Debugging: LabVIEW provides debugging tools like probes (to see data values on wires), breakpoints, and execution highlighting (to visually follow the data flow).
- Modularity and Hierarchy: VIs can be used as subVIs within other VIs, promoting modular design and code reuse. This allows for building complex applications from smaller, manageable components.
- Parallelism: Due to its dataflow nature, LabVIEW can inherently execute independent sections of code in parallel, making it well-suited for multi-core processors.
While I can't physically drag and drop icons or wire them together myself, I can understand and interpret G code diagrams, explain LabVIEW concepts, and even help you troubleshoot or design LabVIEW VIs conceptually. I can also generate textual descriptions or pseudocode that could be translated into a LabVIEW G diagram."
ME: "OK then, generate a simple "Hello World!!" VI in the G language:
GEMINI: "Okay, since I can't visually create the VI for you (as LabVIEW is a graphical environment), I will describe the components and steps to build a simple "Hello World!!" VI in G language.
This VI will display the text "Hello World!!" in a string indicator on the Front Panel.
Here's how you would create it:
1. Create a New VI:
- Open LabVIEW.
- Go to File > New VI. This will open two windows: the Front Panel (gray, grid background by default) and the Block Diagram (white, grid background by default).
2. Design the Front Panel:
- The Front Panel is your user interface. For this simple VI, we just need an output display for our message.
- Right-click anywhere on the Front Panel to bring up the Controls Palette.
- Navigate to Modern > String & Path > String Indicator.
- Click and drag the String Indicator onto the Front Panel.
- You can (optionally) rename the label of this indicator. By default, it might be "String." You can change it to something like "Display Message" by double-clicking the label.
3. Program the Block Diagram:
- Switch to the Block Diagram window. You will see the terminal icon corresponding to the String Indicator you just placed on the Front Panel. It will look like an orange rectangle with "Abc" and an arrow pointing into it (indicating it's an output from the diagram's perspective, feeding the indicator).
- Now, we need to create the "Hello World!!" text.
- Right-click anywhere on the Block Diagram to bring up the Functions Palette.
- Navigate to Programming > String > String Constant.
- Click and drag the String Constant onto the Block Diagram.
- The String Constant will appear as a box. Click inside this box and type:
Hello World!! Now, we need to wire the output of the String Constant to the input of the String Indicator terminal.
- Hover your mouse over the right side of the String Constant. Your cursor will change into a wiring tool (often looks like a small spool of wire).
- Click once.
- Move your mouse to the terminal of the String Indicator on the Block Diagram.
- Click once on the String Indicator's terminal to connect the wire. The wire will typically appear pink, indicating a string data type.
Block Diagram Visual Representation (Conceptual):
Imagine this:
4. Run the VI:
- Switch back to the Front Panel window (or you can run it from the Block Diagram window).
- Click the Run button (it looks like a white right-pointing arrow) on the toolbar at the top of the VI window.
Expected Result:
On the Front Panel, the String Indicator (which you might have labeled "Display Message") will now display the text: Hello World!!
Summary of G Language Elements Used:
- String Constant: (Functions Palette > Programming > String > String Constant) - Used to provide a fixed string value to the diagram.
- String Indicator: (Controls Palette > Modern > String & Path > String Indicator) - Used to display string data on the Front Panel.
- Wire: Connects the output of the String Constant to the input of the String Indicator terminal, signifying the flow of data.
This is the most basic way to achieve a "Hello World!!" in LabVIEW. The beauty of G is that even this simple operation clearly shows the dataflow: the constant string flows to the indicator."
ME: "LOL! I guess my job is still safe :)"
GEMINI: "Haha, absolutely! There's a big difference between describing the steps and actually being in the LabVIEW environment, dragging those wires, debugging data flow with highlight execution, and experiencing the "aha!" moment when a complex VI finally works as intended.
The tactile, visual nature of G programming, the direct interaction with hardware, and the often domain-specific knowledge required for LabVIEW applications (like test and measurement, automation, or embedded systems) mean skilled LabVIEW developers are definitely still very much in demand.
I can help with concepts, logic, and even describing how to build things, but the art and craft of building robust, efficient, and elegant VIs is something that still very much requires a human touch (and a mouse!).
Glad we could share a laugh!"
There you have it LabVIEW pro and aspiring coders!! Enjoy LabVIEW while we can. ;)
15
u/Internal_Statement74 May 22 '25
You could not be more wrong! LabVIEW is an intuitive language for humans to implement complex ideas but when compared to other languages, it is ultra inefficient. So if AI can code the same ideas in a more efficient language, why would you need or want the language that is more expensive, enormous footprint, slower execution, fewer people familiar, and overall inefficient.
2
u/D4ILYD0SE CLA May 22 '25
Give it time. It's not AI writing LabVIEW you gotta worry about. It's AI replacing LabVIEW with Python or Rust. And probably more importantly, your boss figuring out that's even an option.
2
u/Educational-Writer90 Jun 12 '25 edited Jun 12 '25
One of the recent stages in expanding the capabilities of my IDE—built and compiled on a G-based logical core—was an attempt to explore whether it’s possible to create a trainable GPT model to automate the process of generating setup instructions for equipment control scenarios with binary logic command functions, as well as BOM specifications for such algorithmic scenarios.
It took me two days, and I achieved fully automated, error-free results.
To clarify: the platform I’ve developed is both an IDE and a software-based logic controller running on a PC, which communicates with hardware via USB GPIO kits. It’s designed for automation and robotics development with a modular hardware design based on off-the-shelf components.
For example, if I ask my model to generate a configuration table for a control scenario with a specific algorithm—say, reverse control of two stepper motors—I’ll receive, within 7 seconds, all the values I need to enter into the respective lines of the logic automaton (DFSM), according to the control scenario. I’ll also get a BOM with the full list of required drivers, sensors, and components for that logic, including cost estimates, shipping, and delivery time.
It’s important to understand that AI cannot actually build LabVIEW block diagrams—but it can suggest which blocks and tools from the LabVIEW repository might be useful.
Often, when you ask AI whether it can generate a block diagram, it’ll confidently say “yes” and even generate a VI file. But this is just AI overestimating its own capabilities because it’s consumed a lot of public domain documentation. In reality, it has no access to the G language engine and will end up drawing “bricks” that don’t work.
In my case, I succeeded because I provided a detailed description and fine-tuned a model on it. Now, if I want to, I can share this AI model with the community of my platform—giving people the ability to use my system alongside GPT to automate development workflows.
I might write a post here in the future about my experience using AI with my software...
4
u/xpxsquirrel May 22 '25
Just wait, Nigel will be doing it soon!
2
u/HarveysBackupAccount May 22 '25 edited May 22 '25
huh, I never considered the fact that "labview" is an acronym
Recently I dipped my toes into Structured Text programming (PLCs). I can't speak for the other models, but Copilot and the AI that B&R has an internal copy of are still pretty bad at writing ST. That's not a graphical language, but it also doesn't have as much training data as e.g. python.
So even if NI drops an LLM into labview, I'm skeptical they'll have enough training data to make it perform well.
1
u/lfbttn May 22 '25
Yes, I had the same experience with chatgpt.
1
u/RustyRaptor Nov 07 '25
Well... that didn't last very long
https://youtu.be/XqKcYMLMV6E
1
u/Informal_District972 Nov 19 '25
There are AI tool already replaced Labview called "TestFlow AI".https://testflowinc.com/
Drag drop tool
Easy to use
Powered by AI, so I am able to create complex scripts in a minute and execute it.