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: 

producer consumer troubles

Solved!
Go to solution

I am  in need of some serious help with my application of this VI template. Specifically I am looking for pointers on how to achieve the procedures described below. I am relatively still a beginner but I have simulated my set-up in the VI attached. My goal is to do the following

 

  1. Move cars from any one lot to another following the gated channels by either
  •        opening the gates for a particular pathway based on the users selection of origin and final destination

 

  •        selecting individual gates to form a path

 

  •        generate error message when user selects the same location for starting point and destination

 

thanks

 

 

Download All
0 Kudos
Message 1 of 12
(4,297 Views)

If you save the VIs for LV 2012, I'll do my best to help. 

0 Kudos
Message 2 of 12
(4,269 Views)
0 Kudos
Message 3 of 12
(4,265 Views)

You have two ways to move forward here,

 

1. Create a lookup table for every possible combination of the lots and the gates you have to open for that pathway. Then when the user selects "go", you use the inputs to select the correct gates to open. This path comes with the tedious task of creating the table and even worst modifying it each time you add/delete/modify the gates and the lots. but after that the programming because very simple.

 

2. you can create a matrix which you specify the connection between each gate to its neighboring gates and you run through all of the possiblities programmatically until you find the correct combination. This is part of path planning and it's not very trivial. But you will learn a great aspect of programatic path planning and I will do my best to help you through it. 

 

I would suggest you choose which path you would like to take and set up the algorithm and the tables before you worry about the producer/consumer architecutre. if you develope the above the rest will be very simple.

 

 

0 Kudos
Message 4 of 12
(4,259 Views)

I think with my level of expertise I will use option 1. I have created a table of all the options and surprisingly its not a whole lot of combinations that are actually possible ( marked in blue) Smiley LOL

0 Kudos
Message 5 of 12
(4,202 Views)

Alright,

In the attached folder find a VI and a text file. the VI will show you how to search the text file for the correct Start Point and Destinationa and then get the Boolean values of the gates in order.

Go ahead and set up your producer to check the users input in order to give out a warning in the your Start and Destination are matching. If they are not matching send the index of the row using your Queue you've set up.

 

I'm not sure about your capabilities in labview so If you need any help with any of this let me know. 

 

Dan,

0 Kudos
Message 6 of 12
(4,187 Views)
Solution
Accepted by topic author Charles.m

I think I will need some help with that can you point me to an example I can study

0 Kudos
Message 7 of 12
(4,151 Views)

Find the VI attached. It's a quick and dirty version of what you have to do. if you are trying to send these signals as digital outs, go ahead and do so in the second loop. you can still improve on this. 

As far as example to study, you can go to the help menu in labview and select find examples. The best thing about labview is that fact that it has a vast example library you can select from based on the task you are trying to perform. 

Programming is all about practice though, the best way you can learn is try your best until you are truly stock, then post your code and have us guide you through it, but ask specific answers on what it is that can help you move forward.

 

Let us know if you need further help on this,

 

Dan,

Message 8 of 12
(4,139 Views)

ok so I finally decided to use a template to implement the solution. Unfortunately certain sections of this template ( a good learning method I thought) are over my head but I have attached what I have  done. My main concern though is to be able to send a sequence of digital outs by selecting various options (manual) on the front panel or using using the drop down menu to select current location and final destination plan to use the acquisition loop to determine and record which gates are open (digital in) from limit switches . I would like to use the recorded sequence to determine which gates are open and then reset them. My code is a work in progress and  any informative pointers would  be much appreciated.

 

 

Download All
0 Kudos
Message 9 of 12
(4,037 Views)
0 Kudos
Message 10 of 12
(4,022 Views)