12-15-2020 08:56 AM
Hello, i start a project about smart home where i measure the temperature, and by that i can increase or decrease the temperature from house. All good until i want to measure the temperature periodically not instant to look more realistic. I'm looking for a function who can do that with formula node, or if anyone have a better ideea i will be grateful. I attach my example below
12-15-2020 09:24 AM
Unfortunately your example is not attached.
I'm not sure what you mean by "measure periodically not instant to look more realistic".
Whatever you are trying to do, I don't think you want a formula node to do it. A formula node is a rarely used LabVIEW function used when you have calculations to do that are easier to write as an equation rather than regular LabVIEW primitives.
12-15-2020 09:27 AM
I think you want a timer not a formula node...
But who knows? You haven't attached any code so we can see what you did wrong...
12-15-2020 09:58 AM
A teacher told me it could be done through a logarithmic function but I couldn't find anything to help me. It wants to increase my temperature with a delay after I set it through the thermostat to increase periodically but if I put a wait it is done instantly after
12-15-2020 10:21 AM - edited 12-15-2020 10:24 AM
Your loop currently spins millions of time per second, as fast as the computer allows. One way to model a delayed reaction would be with an exponential filter. Start reading here for ideas.
Has you asked your teacher for clarification? It is his job to teach you!
12-15-2020 10:22 AM - edited 12-15-2020 10:24 AM
I know the tutorials make it look like One Big Loop is how LabVIEW programs are written, but it's not...
Even thought your program is simply numbers, comparisons, and Boolean indicators. You should still be using a proper program architecture like a simple State Machine...
I am guessing you have heating and cooling plus a smoke alarm?
So you need a few basic states such as..:
Read your sensors at regular intervals, use their values to determine what state to run next.
12-15-2020 10:53 AM
There is also way too much duplicate code.