LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Usage of Event Structure and push button

Hello, I’m very new to LabVIEW and I need to complete an application. I’m struggling to understand how to use the Event Structure and push button setup. In the application I’m working on, there are two buttons: one to start the system and one to stop it. When I press the start button, I want the system to begin running and continue until I press the stop button. I am required to implement this using the Event Structure. There are additional parts to the project, but I’m currently stuck at this stage. I really need your help.

dogukan12324_1-1745154720206.png

 

0 Kudos
Message 1 of 29
(839 Views)

Look up the term "state machine".

 

Currently, your loop cannot even spin because the event structure can never complete (A timeout event with the timeout unwired waits forever!).

 

A picture is insufficient to even analyze your code, because we cannot see what's in the other cases or the mechanical action of your buttons, etc..

 

Please attach your VI, and make sure to use "save for previous" (2020 or below) so more can look at it. Unless this is homework, the requirement of an event structure is pointless. It can also be done equally we without one. There are also serious logical problems, for example an equal comparison of a random number with 2.5 can never be true. There is also no need for local variables.

 

Maybe you should post the entire requirements document.

0 Kudos
Message 2 of 29
(820 Views)

If you type "LabVIEW Events" into a search engine (I used Google), you should find a link called Event-Driven Programming in LabVIEW .  This gives an overview of the Event Structure (inside a While Loop).  One of its uses is responding to a change in a Front Panel control (like "Pushing a Button", which changes a Boolean from True to False, or the other way around).  It will also lead you to several of the ways Event Structures can be used.

 

Have you learned about how (in particular) Boolean Controls can be used?  Does the term "Mechanical Action" mean something to you?  If not, open LabVIEW, click the Help button, search for "Mechanical Action" (which probably will not take you to the most helpful place), and see if "Boolean Controls and Indicators" is a few lines farther down.  Read that.

 

Bob Schor

0 Kudos
Message 3 of 29
(806 Views)

Here is a quick skeleton to get you started. Make sure you understand all parts before making changes.

 

altenbach_1-1745163907731.png

 

 

0 Kudos
Message 4 of 29
(803 Views)

Tekrar merhaba,
yazdıklarınızı okudum ve benimle paylaştığınız başvuruyu inceledim — gerçekten mükemmel bir iş çıkarmışsınız. Projenin tüm gereksinimlerini bir Word belgesinde paylaşıyorum. Cuma akşamından beri bu proje üzerinde çalışıyorum ve LabVIEW'ı ilk kez kullanıyorum. Bu projeyi tamamlamak için YouTube ve ChatGPT Plus kullandım ancak kafamı karıştıran birçok durum oldu. Bana yardım ederseniz çok sevinirim. Proje dosyasını ve oluşturduğum VI dosyasını ekliyorum.

0 Kudos
Message 5 of 29
(796 Views)

You did not see my note about doing a "save for previous" (2020 or below). Most users here cannot open your VI saved in LabVIEW 2025.

0 Kudos
Message 6 of 29
(789 Views)

Hello again,
I’ve read what you wrote, and as you suggested, I did a bit of research online when I first started this project. To carry out this project, I created small demo applications using YouTube and ChatGPT Plus, but since I couldn’t fully implement the scenario I had in mind, I wanted to consult the forum. In my previous comment, I shared the VI file I created and explained the work I’m trying to accomplish. Since I have limited time to complete the assignment, I wasn’t able to learn enough about LabVIEW structures.

0 Kudos
Message 7 of 29
(786 Views)

As you suggested, I have updated the VI file to be compatible with LabVIEW 2020 and earlier versions.

0 Kudos
Message 8 of 29
(779 Views)

Most people here don't understand Turkish, but we can use google translate on your labels. Since the instruction is in English, you should use English labels as described.

 

  • All your boolean controls have incorrect mechanical action. You should not even use a switch to start and stop something. Use buttons that are latch when released (i.e. the reset back to false as soon as the code reads them). Of course you could replace the start and stop buttons with a single switch ON:acquire, OFF: idle) but that does not fit the requirements.
  • It is very unlikely that a random voltage will ever be exactly 2.5 to cause a division by zero, but it would be easier to test if the result of the division is NaN.
  • Do you know how to store the data in an array?
  • Do you know how to measure elapsed time?
  • Do you know how to format the file names?
  • Do you know how to clear charts?

 

0 Kudos
Message 9 of 29
(716 Views)

I started using the LabVIEW program last Friday. Since then, I've been reviewing examples on the internet, trying to find example scenarios on this forum, and trying to understand the block structures. I don’t know more than what I’ve seen online and what I’ve learned through ChatGPT Plus. While trying to implement what you've suggested in LabVIEW, I’ve been researching each step, which makes the process quite challenging. I need to complete the project by Wednesday. What kind of roadmap do you think I should follow? Could you help me with this?

0 Kudos
Message 10 of 29
(704 Views)