LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

urgent help to slove this problem bout washing machine control

i have create a washing machine control simulation tht requested lecture by there stil a problem tht i can't slove.. when the drain water less than 4 the motor should be stop but it stil on until the count time go to 0!!plz help to slow this problem!!! i will sent out my vi file! thanks
0 Kudos
Message 1 of 8
(3,742 Views)
Your program is highly flawed and I would recommend to rewrite it from scratch using a state machine architecture. There should only be one or two while loops.
 
You have way too many while loops that have data dependency and are thus blocking each other. You need to program this with dataflow in mind.
 
  1. Loops that wait for user input need a small wait statement.
  2. Your second loop on the left is a death trap. If the condition is TRUE, there is no way for the loop to ever finish. Ever!
  3. The small while loop in the upper left of the big loop relies on the wash time that is decremented in the other while loop towards the right, but since there is data dependency, the loop on the right cannot start until the first loop finishes. Another dealock!
  4. A large part of the problem is your overuse of local variables. Use shift registers to esure proert dataflow.
  5. ...

I don't see an easy way to fix the code without rewriting from scratch using proper coding guidelines. Most likely, the code will be less than half the size, much easier to debug, and prettier to look at. 🙂

Have you ever tried to run your code while watching the diagram with execution highlighting enabled. You'll see what's going on.

Good luck!

0 Kudos
Message 2 of 8
(3,735 Views)

thanks for ur advice n help Smiley Happy!! i will try my best to rewirte this program, actually i not learn much from my lecture coz himself oso not so familiar wif tht, most is i try an error to find out the solution!

the question given is- the wash time muz more than 1 min n the water level muz over 4liter,n drain switch is off, then only the motor wil run! when drain switch is press, if water level less than 4 liter, stop immediatly. Or without press the drain switch, the motor stop when time wash = 0

i'm juz a begineer on labview, i got few question:

  1. how many local variable can use  (max)
  2. where i can find the coding guidelines?

 

0 Kudos
Message 3 of 8
(3,708 Views)


@kannajin wrote:

i'm juz a begineer on labview, i got few question:



It is OK to be a beginner. The nice thing with LabVIEW is that it becomes very easy once you are a bit more familiar with it. 🙂

Some coding guidelines can be found in the LabVIEW style guide: http://www.ni.com/pdf/manuals/321393d.pdf#labview_style_guide , look for chapter 6 nad the section about the block diagram.

You can have as many local variables as you want, there is no limitation. However, there is typically little need for them if the program is properly designed. Local variables are often overused and they make a diagram hard ot read, break dataflow, and can cause race conditions.

0 Kudos
Message 4 of 8
(3,700 Views)
thanks q so much!!!Smiley Wink
i hope tht can keep contact, coz in the coming i think i'l got lot problem may need ur help!!
thanks again
0 Kudos
Message 5 of 8
(3,693 Views)
One of the problems is the fact that you are still using LabVIEW 5.0. Most users here are running much higher versions (newest is 8.0), so we cannot give you an example.
0 Kudos
Message 6 of 8
(3,676 Views)
me  is using version 7.1 now but my collage is teachin in version 5.0 so i hav to do it in tht version!!
coz have to pass up the soft copy to the lecture! if there got an example can u sent it to me i will open it up, coz i had buy the latest verion labview juz not yet install to my pc!
0 Kudos
Message 7 of 8
(3,656 Views)

Since your motor display is in For Loop, it will execute 17 times and hence there is no stopping it..
That mean it will just run and run and run once the program state enter into the for loop.

And again you set you wire your wash time into another for loop, it will go until loop (washtime * 3.85) then
it will exit from loop.

------------------------------------------------------------------
When you feel sad, laugh
0 Kudos
Message 8 of 8
(3,650 Views)