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: 

Problem using Labview to simulate a train hub catering system

Solved!
Go to solution

Hello,

I couldnt achieve my goal in this task, as it says, i need to create 7 train lines passing through the main hub, however, whenever i make a solution, it always tends to be wrong. I've made this using Loops, sequences and clusters, but still its not getting the answer i need. Can someone please help me with this problem?

 

The Problem:

KL Sentral currently caters for 7 rail systems. Each of the rail is connected from the past city to the next city.  Upon arrival to the hub, the trains will be directed to the next city.  Simulate the scheduling process in LABVIEW.

0 Kudos
Message 1 of 3
(2,602 Views)
Solution
Accepted by topic author Raybatais

This forum is not to provide you home work solutions. Attach your VI with your specific programming questions/problems. In that case we can provide help/advice.

By the the way, "The Problem" description is just too vague. So there are just so many possible solutions. Some hints: I would simulate the specific train lines with Queues. The HUB would be a consumer loop, where all trains arrive to, but of course only one train at a time. Using different speed of the Queue producers, and different Queue buffer, you could simulate several traffic conditions and problems, depending on how fast the Consumer (the hub) can process the Queue elements (trains).

 

If you are a beginner in LabVIEW, I recommend to go through the Core 1 online training.

Message 2 of 3
(2,593 Views)
Solution
Accepted by topic author Raybatais

Are you trying to create something that follows a pattern like the following diagram?

diagram.png

If so, you probably want to consider something like a State Machine or Producer/Consumer.

Work out what your logic should be - it shouldn't be too tricky to code once you know exactly what you want to have happen.

In this example, you can check where each 'train' came from, and then send it out to the next destination. This can be accomplished using the State Machine architecture fairly simply. If you have multiple trains, you'll need to be a little more careful to store appropriate information, but it still shouldn't be hard, just more asynchronous (which is well documented, as is most LabVIEW content, in this forum and throughout the help files).

 

You should also consider (and explain here, if you need more help) what your output should look like - "Simulate the scheduling process in LabVIEW" doesn't give much information beyond that this is a homework problem.

 


GCentral
Message 3 of 3
(2,590 Views)