LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

small project

soccerfan_0-1732678420512.png

 

0 Kudos
Message 11 of 34
(515 Views)

Hi fan,

 


@soccerfan wrote:

However ii know a fiew hings about events stucture and that is what i used in this problem

soccerfan_1-1732678282031.png

 


Where exactly did you use the event structure mentioned by Bob?

It isn't visible in your image!

 

What's the point of using a while loop that iterates only once???

 

suggestion: use a type-defined enum instead of a combobox to select a predefined number of cases!

 

Why don't you write you want to implement a Darts counter algorithm!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 34
(506 Views)

@GerdW  a écrit :

 

Why don't you write you want to implement a Darts counter algorithm!?


I love how solving this small project became primarily understanding what the project is haha. The 501 and 301 reminded me of something as well that I couldn't point out, well done.

 

@Soccerfan a couple of things:

  • Not everyone has the latest version of labview and will therefore not be able to open code from a more recent version. If you want people to help you debug something it is important to downgrade your code by "Saving for previous version" you VI:
    VinnyAstro_0-1732701246028.png
  • As GerdW said, if you want to subtract multiple times a different number (and most likely check when you hit 0 or go back to the previous number if it is actually a Dart Game) you should definitely spend a bit more time understanding Event cases and I would also add State Machines. You'll see it's a lot of fun, almost more than playing darts.
0 Kudos
Message 13 of 34
(494 Views)

@GerdW wrote:

Where exactly did you use the event structure mentioned by Bob?

It isn't visible in your image!


I think he was referring to my snippet that used an event structure.

 

@soccerfan,

Learn to use the Event Structure. It is one of the most useful features when dealing with a GUI. Just play around with it. This might be one place to start: Event-Driven Programming in LabVIEW 



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 34
(482 Views)

You are right this is from a dart scoring sheet ( 501 and 301 gave it away). This is just a snippet that i pulled from my bigger project that uses a state machine . I did not want to show you the whole project that is a mess right now. I am interested only in the problem i mentioned earlie for now. I am sure more questions will follow about the whole project

 

0 Kudos
Message 15 of 34
(467 Views)

Attached is my project , If you know about dart game and willig to help, i will appreciate it. 

It is still in working process (i know it's a mess), The only part that seems to work now is:

-select player1 and 2

-select game

-Player 1  The 1st time you enter your score (ie 100 or any score  170 or less ) and that comes my problem for the next score

If you play darts you should know what i mean.

Come on Champs,,

Thanks

0 Kudos
Message 16 of 34
(467 Views)

@soccerfan wrote:

Thanks for your answer. You almost got it. I cosidere myself an intermadiate labview learner, i still have a long way to go. However ii know a fiew hings about events stucture and that is what i used in this problem

 

soccerfan_1-1732678282031.png


 Your figure shows a While Loop around a Case Structure.  An "Event Loop" is a While Loop around an "Event Structure".  On the LabVIEW Structure Palette, the Case Structure is the fourth item in the Structure Palette, with the Event Structure being the fifth shown.  Please learn about it, as it seems to be the "missing piece" in your understanding of the problem you are trying to solve.

 

Here is a simple example of an Event Loop.  You can ignore the Invoke Node on the left -- that's just there to reset all the variables on the Front Panel to their defaut values before the code runs.  Code this up or drag the Image to an empty Block Diagram (it's a LabVIEW Snippet, so it might magically become LabVIEW code).  See how it behaves when you run it (including understanding when and how you stop the program).  When you think you understand what is going on, try modifying the program by dragging the Number control outside the While Loop (so it is just "hanging out in the breeze" -- before you run it in this configuration, what do you think will happen?  Did it behave as you expected?  Why (or why not)?

 

Simple Event Loop.png

 

Bob Schor

0 Kudos
Message 17 of 34
(457 Views)

Thank you for your time, However that's not what i am looking for. Check my project that i posted earlier ( darts.app .vi) to have a grasp of what i am looking for.

Thank you again

Also, dragging the snippet did not work for me

0 Kudos
Message 18 of 34
(450 Views)

Hi fan,

 


@soccerfan wrote:

Check my project that i posted earlier ( darts.app .vi) to have a grasp of what i am looking for.


Unfortunately you failed again in providing a downconverted version of your VI.

Somehow you aren't able to read our messages or willing to follow them…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 19 of 34
(443 Views)

I did, i converted all the way down to version 9. What version do u want me to converted to?

0 Kudos
Message 20 of 34
(434 Views)