LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop problem

Good morning labview engineers

 

I have a problem with this labview code that is used to read and save an audio file, the problem is that I want to enable all the code with a boolean but because it has two internal reading and writing whiles I can't figure out how to do it, at least Putting it into a state machine like subvi doesn't work for me either because it already has two internal loops. How could I call everything with a button that can be activated and deactivated at any time? I would greatly appreciate your help

0 Kudos
Message 1 of 9
(1,075 Views)

You can try using Queue Message Handler with parallel Loops. 

 

0 Kudos
Message 2 of 9
(1,074 Views)

Hi, could you explain to me how to do that, I don't have much experience in labview

0 Kudos
Message 3 of 9
(1,059 Views)

@TORRESDANIEL wrote:

Hi, could you explain to me how to do that, I don't have much experience in labview


There is a template that you can create and start with.

Using a Queued Message Handler in LabVIEW

-------------------------------------------------------
Applications Engineer | TME Systems
0 Kudos
Message 4 of 9
(1,040 Views)

The problem is that it also takes time to call the sound file open only once, would it still help me to use that method?

SOUND.PNG

0 Kudos
Message 5 of 9
(1,015 Views)

Hello, @TORRESDANIEL.  Welcome to the LabVIEW Forums, where we share ideas and help about All Things LabVIEW.

 

I see you are a new member, and also possibly a new user of LabVIEW.  Here are some things to help us help you.

 

  • Pictures of LabVIEW Block Diagrams are often not helpful.  They are often too tiny to see, show only a limited part of the code (for example, only one Case of a Case Statement), cannot be editied, and cannot be executed (so that we can "see the error pop up").
  • If your code consists of a single, or a few, VIs, you can just attach the VIs.  Otherwise, if you have a LabVIEW Project controlled by a Project file (.lvproj), especially if all of the code is in a single (physical) Folder on you disk, compress the Project Folder (right-click on the Folder, choose "Send To:", "Compressed (zipped) folder"), and attach the resulting .zip file.
  • Many of the "old-timers" on the Forum do not (yet) have the latest version of LabVIEW.  You should consider using "Save for Previous Version" (see File menu) and choose LabVIEW 2019 or 2021 (the two versions I'm currently using).

Bob Schor

0 Kudos
Message 6 of 9
(968 Views)

Hi TorresDaniel,

 

I am trying to understand what you are asking. 

Do you need a start button to start your program? If that's what you need, try out the attached code. 

0 Kudos
Message 7 of 9
(959 Views)

As it happens, processing "Audio" data and "Video" (or "Visual", or "Picture") data are some of the trickier and more "advanced" aspects of LabVIEW, possibly because the "hardware" has been developed and "standardized" by other device manufacturers following other rules than simple Analog and Digital signal processing.

 

As I mentioned in my previous response, I cannot look at your code because I do not have LabVIEW 2022 (or 23) installed on my computers.  I should also ask if you are using LabVIEW Project (and have a Project (.lvproj) file, and possibly a Project Folder, associated with this effort.  If you only have a "Main" and a few (2-4) sub-VIs, then attach them all (Saved for Previous Version, of course).  Otherwise, save the Project for previous version, compress the "Previous Version Project Folder", and attach that.

 

I agree that you probably do want a State Machine, with the "Start" button safely held in a parallel Event Loop where it basically tells the State Machine (which is sitting idle, waiting for a State/Message), to "Start".  If I can see your code, I can provide more guidance.

 

Bob Schor

0 Kudos
Message 8 of 9
(933 Views)

@GRCK5000 wrote:

I am trying to understand what you are asking. 

Do you need a start button to start your program? If that's what you need, try out the attached code. 


Please don't answer with off-topic "solutions" and code full of totally crazy constructs. This might not confuse you, but it will distract and lead every other beginner even deeper into the swamp.

 

  • Why write to value property of a latched boolean?
  • Why stuff a waveform into a queue just to get it out again a nanosecond later?

 

 

altenbach_0-1688232294163.png

 

0 Kudos
Message 9 of 9
(921 Views)