LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Use master/slave to run constant load/unloading program

I had previously been working on a program to do creeptest and the boards helped me alot.  Now I want to further develop the Creep program into a constant load with the addition of unloading.  E.g we will want a actuator to keep a constant load on a specimen then unload and reload afterwards- we will be looking at the unloading graphs.  I am using Labview 8.5 witha DAQ and loadcell attachments with a PI actuator.  My approach was to use the Master slave design previously people had mentioned.  The idea behind the program is to use the master to determine if we want to keep the load constant or unload - this is monitored by a counter.  Unloading is where im a bit lost after I unload in the slave program does the data get recorded- is the master program always running? When I run with a lightbulb data tracker it seems so but is it fast enough to get the unload data and then the loading?  

 

also does my data collection wiring in the master loop make sense?  I want a load vs displacement graph and a displacement vs time, and an output array. 

 

any hints or tips to improve my LabView code writing is appreciated. 

 

thanks for all the help 

0 Kudos
Message 1 of 4
(3,402 Views)

Hi kingsgambit1943,

 

There are a couple of good articles available that would be useful for you.  A couple comments:  It is usually best to keep block diagrams to the size of one screen (when possible) as well as keeping wires as straight and left-to-right as possible.  It is a bit difficult deciphering your block diagram, especially without being able to run the VI.  (Although, I have seen much worse, so don't feel too bad!)

 

Here is some more information on Master/Slave Design Pattern.

Here is a tutorial on using local and global variables (you want to minimize these when possible to avoid race conditions)

Here is a presentation on general programming tips.

 

Enjoy!

 

Kristen H.

0 Kudos
Message 2 of 4
(3,360 Views)

Thank you;  Race condition tutorial was very helpful.

 

I've fixed up the program a bit and it is now running but I am still having some awkward data collection.  Ive attached a picture of one of my XY graphs - it doesnt let me clear either at the beginning of the test.  Ive not changed much in the data collection part of the vi located in the Master loop.  Am I collecting the data right?

 

I am under the influence that I am creating

1. an array of 3 columns with iteration, position, and load 

2. an actuator position vs iteration graph  (when I ran the test the graph looked pretty good)

3. an Load vs position graph   (this one is the most important- data is overlapped from several runnings, when I clear it doesn't clear)

 

Does my wiring effectively do this?   Am I understanding the Value property node - I think of it as keeping the original values in the chart by effectively making an array of the data?

 

Although not that important I have some general Labview questions as well.  How do people usually keep these master /slave programs small- I cant seem to see any way to fit my into "a" screen.  Also ive used a counter is there a numerical indicator that can be set to 0 or does it have to be a numerical control?  How do I include events in a master slave does it have to be seperated into several slave loops?  When i put a event case inside the master while loop it freezes the entire process, is this just my computer?

  

 

Thanks again.   

0 Kudos
Message 3 of 4
(3,343 Views)

Hi kingsgambit1943,

 

Your three items in the list are correct- your code does do them. You are also correct about the property node "holding" the information.  If you want to clear it programmatically you will need to pass uninitializeddata into it.

 

People usually keep programs small by using subVI's when possible, using stacked sequence structures instead of flat sequence structures.

 

I'm not sure what you mean here: " Also ive used a counter is there a numerical indicator that can be set to 0 or does it have to be a numerical control?"

 

As far as using events: take a look at the Producer/Consumer Design Pattern (Events) located here:C:\Program Files\National Instruments\LabVIEW 2009\templates\Frameworks\DesignPatterns

 

The freezing is actually LabVIEW waiting for an event most likely.  Take a look at this KnowledgeBase

 

I hope this helps!

 

Kristen H.

0 Kudos
Message 4 of 4
(3,290 Views)