02-21-2015 09:17 AM
hy,
my english is bad so in advance sorry.
Problem is that i cant get this program working, im stuck with it for a day now and its not working at all. The program is going like this:
create 4 indicators:
1. temp of the refrigerator+ graphical display of the temp in time.
2. are the doors closed or open
3. is the temo ok or not
4. is the motor of refrigerator working or not.
create 3 controls:
1. what is the temp of refrigerator
2. door open or closed?
3. temp of the environment
refrigerator is working when the temp is over 1°C compred with temp of the refrigerator, refrigerator is not working when the temp is below 1°C temp of the refrigerator
Door closed, refrigerator is working--- -5⁰C per hour.
Door closed, refrigerator is not working--- +5⁰C per hour.
Door opened,refrigerator is not working--- +20⁰C per hour.
Door opened, refrigerator is working--- +15⁰C per hour.
1hour of simulation is like 10sec of real time
please guys, someon help this means much to me and i must get it done but i cant on my own. Even if u know just a part of it it will be a big help for me.
02-21-2015 09:40 AM
This sounds like a school project or an assignment to help you learn LabVIEW. So we will not do it for you but will try to help you understand the program.
You have stated some of the requirements but have not told us what you have working and what is still giving you problems. There is some information missing. Does your program run but give bad results? Does it not run? Does it generate any error codes or messages? What are they?
The best way to get help with a program on this Forum is to post your code. Save typical values of the controls as default. Tell us what the expected results are. Ask specific questions about the part you do not understand.
Lynn
02-21-2015 09:59 AM
Do you have a maximum and minimum temp you have to worry about or does the temp grow without limits?
Really, this program could be pulled off by just polling the open/closed and motor on/off booleans in each loop iteration and using the results to add/subtract temp
02-21-2015 10:11 AM
ok that will be ok. My first problem when trying to make this program is how can my refrigerator get a 1°C over or below the main temp?
i Dont get that part, i mean when i tipe in a temp in the indicator for the temp of the refrigerator that temp cant go up or dont on its own( cant turn motor on/off)
02-21-2015 10:23 AM
dont know how to get past this point.
02-21-2015 11:45 AM
So, you do not know how to get started.
Before you try to write any more of the program, define what the program must do.
First. Write down the equations which determine the temperature over time. You may have several equations, separate ones for various conditions such as door open or closed. You may also need to include the temperature of of the environment, although you have not described what effect it has.
Next. Write down (or draw a flow chart of) a description of all the decisions made by the refrigerator. In particular the decision to run or stop the motor is important. The state of the door also affects the decisions.
Then combine the equations and the decision chart to create a detailed defineition of how the temperature changes at any time depending on the previous temperature, state of the door, whether the motor is running, and so on.
When you have all this, try to implement it in the program.
Lynn
02-21-2015 11:51 AM - edited 02-21-2015 11:52 AM
@caca1234 wrote:
dont know how to get past this point.
Please do us all a favor and give the VI a intuitive name (e.g. "MyRefrigator001.vi" or similar. After helping out in the forum for many years, my downloads folder contains hundreds of files named "Untitled....vi". Makes it hard to keep track of things.
First of all, everything that needs to operate at regular intervals (controls, indicators, function, etc.) belong inside the whil loop. If it is outside, it will be processed once at the start of the program and then never again.
Now keep the current temperature in a shift register (e.g. initialize with the room temperature). Decrement it slightly when the motor is on and increment it slightly when the door is open. If the door is kept open, it should asymptotically reach the room temperature. Increment it very slowly if the door is closed and the compressor is off. When it reaches a certain high temperature, automatically turn the compressor on until the temperature reaches a certain low temperature. Repeat forever.
As you can see, the control "motor working or not" does not not need to exist, because it is determined by the temperature differential.
See how far you get.
02-21-2015 11:54 AM
Have you actually tried to code it? What you sent isn't enough to even be a skeleton of a program.
There's a fundamental misconception in your understanding of controls and indicators. You want the VI to change the temp based on the motor and door. This means the current temperature should be an output. Outputs are indicators. You have it set as an indicator. Indicators are inputs. You'll want to change this.
You're also making an architecture mistake with the timing. You don't want to have a ten second wait in that loop. With that, you'll be waiting ten seconds for your UI to respond to you. I can't imagine that's what you want to be doing. That's a long time to wait for the screen to respond to you.
Here's a start. You'll need to actually put some work in to understand what's happening and how to take it from here to what you want to do. We aren't going to do your homework for you.
02-21-2015 12:14 PM
i tried a lot of thing, what is a problem in this one?
i dont have the "working or not working motor" switch because i dont know how to incorporate two switches at ones and work with them together.
so i have putted AND there, and false is like "my motor is not working... all the time".
02-21-2015 12:21 PM
When you AND a boolean with a False, the output will always be False!
(To use better terminology in English, you should refer to the motor as either Running (on) or not running (off). The terms working and not working imply that the motor is either broken or not.