06-06-2020 05:29 PM
Hello dear user,
I learn the Labview but i can't to this. How can i do this? Thank you.
06-06-2020 06:22 PM - edited 06-06-2020 06:23 PM
@emirgumus wrote:
Hello dear user,
I learn the Labview but i can't to this. How can i do this? Thank you.
We can help you with your homework, but we won't do it for you. You should have the knowledge to at lest begin to code it. Let's see what you have so far.
06-06-2020 08:13 PM
Where is your hang-up? Are you having trouble designing the Front Panel? Have you looked at the Indicators available on the Numeric Palette? Have you placed a Control and "played" with it? Right-click a Control and look at its Properties, especially those shown on the first page. Play with them. Experiment. Pretend you are an Engineer, poking and prodding and figuring out How Things Work. Wire some things together and see what happens. Teach yourself ...
Bob Schor
06-08-2020 08:39 AM
I had previously opened a topic on this topic but i got a few warnings and was able to do them on the program. What is wrong this code, can you help?
06-08-2020 09:02 AM
@emirgumus wrote:
What is wrong this code, can you help?
What do you observe is wrong? What is it doing that is shouldn't? What is it not doing that is should?
I see lots of local variables, which is a huge red flag to me. The other major red flag is the Sequence Structure. Perhaps you really should look into making a State Machine instead of several loops in series.
06-08-2020 09:43 AM - edited 06-08-2020 10:12 AM
That's actually a pretty good start for someone new to LabVIEW!
Now let's talk about dataflow. Simply put, "a node executes only when data is available at all of its input terminals and supplies data to the output terminals only when the node finishes execution". This goes for structures, as well.
So let's look at your program. I see two big structures, the sequence structure and the while loop sitting all there by its lonesome. Which executes first? What restrictions do dataflow place on them? Let's apply dataflow. In your sequence file, the next frame won't execute until everything in the frame before has completed. In your lonely while loop, it will execute until it is done, also. But how does dataflow determine which executes first? Let's consult the pertinent part of the rule above: a node executes only when data is available at all of its input terminals. Since both the sequence file and the lonely while loop both satisfy that condition, they can, and do (for all practical purposes), execute at the same time. But I guess you've already noticed that.
Because you're a beginner, let's ignore - for now - the fact that you are using local variables when you probably don't need to. Let's even ignore the fact that you don't need to use a sequence structure if you do things right. There are more pressing issues to take care of, like: Why is that while loop sitting there by its lonesome? Shouldn't it be included as one of your steps inside the sequence structure?
And here's something no one ever tells you about: The "run continuously" button is intended only to be used as a troubleshooting tool, not as a substitute for a proper while loop to get things to repeat. You should be able to click the "run" button and have it run over and over until you tell it to stop (usually using a stop button that you have created).
Fix those things, then we will talk about how to program in a more efficient, less "dangerous" way.