From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I have several inputs into a fill tank?

My assignment is to simulate a restaurant.  I have to have the amount of people in line in a fill tank(which increases randomly at certain time increments), and then I have 8 different LED lights which represent tables.  These tables can each fit different amounts of people at them(2,4 or 6).  And the people stay at these tables for a certain amount of time.  So the fill tank has to increase according to the amount of people coming into the restaurant and decrease as they're seated at the tables.  Also, as the people are seated at the tables the LED light will turn on to indicate that they're at the table, and there must be a 'clean-up' time after the people get up from the table.
      I'm realy sorry about asking all these questions in one post, my teacher didn't have time to teach us labview, but our final project involves it.  I've figured out how to increase the fill tank at a random amount of time using a while-loop with a 5000ms wait attached, but then I cant attach the tables to that if you know what I mean.
Any help at all would be greatly appreciated 🙂
0 Kudos
Message 1 of 12
(3,286 Views)
We will not do your assignment for you but may offer some suggestions.

Think about how you want to represent the data in your model (not necessarily on the front panel, which seems to be fairly well defined). You have several groups of customers, each with several possible status states: size of group, waiting, seated, departed but table not cleared, ... You have several timing issues: random arrival times (and group sizes), waiting time, time to eat (random over some range), and cleanup time. Once you decide how to represent this data, then think about how to link it.

The seating algorithm can be simple or rather sophisticated: Simple - First come, first serve. This could have a group of one seated at the only table for ten, forcing the following group of nine and all others arriving later to wait until the one has finished. Not too good. More complex: Weightings based on wait time, number of tables with capacity larger than the current group size, how long the tables have been occupied (predicting how soon they will become available), ...

LabVIEW is dataflow driven. Let the data guide how things will work.

Sounds like a fun project. Keep us posted on how it is working out.

Lynn
0 Kudos
Message 2 of 12
(3,256 Views)

I won't write any code for you, but here are a few things which can you check out. You can search the palletes for functions by clicking the search buttton which should be on top of the pallettes window and you can search for examples by opening Help>>Find Examples.

The tank is basically a line of people, so you could handle that with a queue (hint, wink). You can push people into the queue in one loop and take them out in another. The tables can be represented by an array of clusters which will include data like how many people the table can hold, when they got there, when they left and so on. You can then write a series of functions (VIs) which will manipulate this array to do the desired options.

I'll leave you to do some searching.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here, here, here, here and here are a few you can start with and here are some tutorial videos. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 3 of 12
(3,254 Views)
Thank you very much, i wasn't expecting you guys to do the project for me, its just that i'm kind of stuck and I just need a little help showing me which direction to go with this.  What kind of loops do you recommend that I use, and how should I arrange them?  (I emailed my teacher asking him for help, and he told me he couldn't help me and that I should just search online lol)
0 Kudos
Message 4 of 12
(3,253 Views)
You will probably want while loops. For loops run for a fixed number of times. A while loop runs until a boolean condition is satisfied. The tutorials tst mentioned will help with understanding these fundamental elements.

Lynn
0 Kudos
Message 5 of 12
(3,244 Views)
This is far from finished, but it should get you started.  I made the assumption (a bad one) that the tables all fill up in an orderly fashion.  The REAL way to do this is to insert and extract people from an array....I'll show you how this is done when I have a bit of time.
 
Notice the data conversion to a WORD INTEGER.   This is so you don't have fractions of people 🙂  
 
This is a very good (and classic) problem.  Good luck!
 
eric
0 Kudos
Message 6 of 12
(3,239 Views)

Thank you all very much, when I tried opening up that VI that was just attached called "restaurant.vi" it says "Labview: VI version is later than the current labview version. An error occurred VI 'restaurant.vi'  Labview load error code 9: VI version(8.2) is newer then version(8.0).

The labview I have is version 8.0, and it was suplied by my school and I cant upgrade it...What should I do?

0 Kudos
Message 7 of 12
(3,234 Views)

Wouldn't a QUEUE be a good idea......

As the user is new to LabVIEW this might be a leap to far, whilst the array is perhaps the more common approach.

As indicated, a classic question........

 

0 Kudos
Message 8 of 12
(3,233 Views)
It sure looks like you need a state machine to pull it off nicely. The reason is that there will not be a time limit on filled tables nor coming people and waiting for tables, to say the least.
0 Kudos
Message 9 of 12
(3,224 Views)
My teacher told us that we had to think of a project to do in labview and this seemed like a good one at the time.  I can make it much more simpler though if I choose to.
 
What if the people going into the restaurant were just random people (they didn't have to be seated together), then the tables could just be completely filled up.  The tables would then fill up as soon as they're empty from table 1 to table 8 or however many tables there were. 
0 Kudos
Message 10 of 12
(3,217 Views)