646 views|6 replies

2625

Posts

6

Resources
The OP
 

Python combined with LabVIEW programming (1) [Copy link]

Python combined with LabVIEW programming (1)

Hi, uu, good evening! Where did you go for National Day? How do you feel about your first week at work?
At the beginning of the text, it is well known that Python is a very useful tool, and LabVIEW is also a very useful tool, especially in making GUI. Python also has many libraries for making GUI, such as the built-in Tkinter, Pyqt, NiceGui, etc. NiceGui can directly turn the application into a web program, as long as it is under the same router, it can be used, and it is very convenient to cross-platform. For example, if the program is running in the laboratory in the company, it is more convenient for you to occasionally check where the program is running while sitting in the office. However, it is still very troublesome to make a beautiful layout with NiceGui. If I want to adjust the X-axis and Y-axis to my comfort, it will take a lot of time. LabVIEW is much easier, and it is done by just pulling the control. Moreover, LabVIEW can be combined with Python, Python processing, and LabVIEW making the interface. I am not very familiar with LabVIEW, but I am slightly familiar with Python, so I thought of combining it in this way to get things done.
~~Preparation~~
  1. Download LabVIEW Community Edition
  2. Download the corresponding Python 32/64 bit version according to LabVIEW
~~Begin~~
Figure 1: Create a new blank VI
In LabVIEW, VI (Virtual Instrument) is the basic program unit of LabVIEW.
After the new VI is created, two boxes will be generated, one is the front panel (Front Panel) and the other is the program flowchart (Block Diagram) as shown in Figure 2 below. If you accidentally close the program flowchart, you can use the shortcut key CTRL+E to call up the program flowchart.
Figure 2: Front Panel and Block Diagram
The front panel is the user interface of the VI, similar to the front panel of a traditional instrument. Users can place various input controls (such as knobs, buttons, text boxes, etc.) and output display controls (such as gauges, charts, indicator lights, etc.) on the front panel. These controls are used to interact with users. Users can set parameters through input controls and view program running results through output display controls.
The flowchart is the source code of the VI. In the flowchart, users can use various functions, subVIs, and structures (such as loop structures, conditional structures, etc.) to build program logic. The code in the flowchart transfers data through wires, and the wires indicate the direction of data flow between different nodes (functions, subVIs, etc.).
Let's first write Hello World in Python and then display it on LabVIEW. The Python program uses a function to return a Str (string) of HelloWorld. The Python code is as follows:
def HelloWorld():
return 'HelloWorld'
LabVIEW block diagram:
Figure 3: Block Diagram
LabVIEW front panel:
Figure 4: Front Panel
Workflow:
  1. Open Python
  2. Execute the HelloWorld function
  3. The return value is displayed using String Indicate
If you don’t know how to configure the module, you can press Ctrl+H and click the module to display it, as shown in Figure 5.
Figure 5: Module Help
It's a bit late today, so I'll stop here for now and continue later.

This post is from Test/Measurement

Latest reply

Interesting, this combination of programming is a good choice, graphical interface plus command programming   Details Published on 2024-10-18 15:28
Personal signature

希望做一些大家觉得好用的东西!

 
 

2625

Posts

6

Resources
2
 
python combine LabVIEW.vi (6.41 KB, downloads: 0)

LabVIEW Add-ons

This post is from Test/Measurement
Personal signature

希望做一些大家觉得好用的东西!

 
 
 

2w

Posts

341

Resources
3
 

Python combined with LabVIEW programming,

It sounds more fun.

Can you introduce the compilation environment?

This post is from Test/Measurement

Comments

Pycharm and Vs code  Details Published on 2024-10-17 09:31
 
 
 

2625

Posts

6

Resources
4
 
qwqwqw2088 posted on 2024-10-17 07:28 Python combined with LabVIEW programming, it sounds interesting, can you introduce the compilation environment?

Pycharm and Vs code

This post is from Test/Measurement
 
 
 

1582

Posts

0

Resources
5
 

LabVIEW has been upgraded and can be used together with programming software. It is so powerful.

This post is from Test/Measurement

Comments

I remember there were java and tcl supports before  Details Published on 2024-10-17 23:40
 
 
 

382

Posts

9

Resources
6
 
se7ens posted on 2024-10-17 17:13 Labview has been improved again. It can be combined with programming software. It’s great

I remember there were java and tcl supports before

This post is from Test/Measurement
 
 
 

277

Posts

0

Resources
7
 

Interesting, this combination of programming is a good choice, graphical interface plus command programming

This post is from Test/Measurement
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
Analog Circuit Study Notes

Program Number: 1087 Program name: Analog circuit study notes Program Type: Other File size: 10K bytes ...

Humor SMS 2

On the first day of school, the school director gave a report to the students. He emphasized several school rules: "Boys ...

A picture shows the layout of Qorvo and domestic replacement-penetration in various fields

RF Front-End Introduction and Supply Chain The RF front-end module of the mobile terminal mainly includes a power amplif ...

Sound detection system

# Sound Detection System##Sound Detection System###The sound detection system is used to capture sound and display the t ...

i.MX6ULL Embedded Linux Development 1-Preliminary Study on Uboot Transplantation

This post was last edited by DDZZ669 on 2021-7-27 23:05 This series of tutorials uses the ARM development board of the ...

Evaluation and Award: Anxinke Bluetooth Development Board PB-02-Kit

Thanks to the netizens for their attention and sharing on the evaluation of the Anxinke Bluetooth Development Board PB-0 ...

Buck switching power supply MOS tube gate has pwm signal, but cannot conduct normally

I am a power supply novice. Recently, my teacher asked me to make a digital buck circuit. I used a signal generator to g ...

Understanding of op amp parameters

AD825 is a classic high-speed operational amplifier with excellent frequency characteristics, offset and gain. Very smal ...

Basic knowledge of electronic circuits - Learn electronic circuits from scratch

This collection is specially compiled for beginners of electronic technology. The information includes the basic knowled ...

Award-winning live broadcast | 2D/3D sensing miniaturization: ams and OSRAM's new Mira series global shutter image sensors

Live Highlights: Overview of ams and OSRAM's machine vision and CMOS product portfolio Analysis of Mira series mainstre ...

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list