12-06-2016 08:09 AM - edited 12-06-2016 08:10 AM
Thanks Bob I had included the VI's above but had removed them as GerdW had pointed me in another direction. VI's attached to this post. I now know the issue is something to do with the input from the demo temp VI so I just need to find a way to include this in the feedback loop. I was overthinking it enoumously I think as I was trying to keep the same reading no matter which toggle switch I selected. But having re-read the terms I think it doesnt matter if they carry over from one switch to the next as long as the function is correct, ie the circuit can restart from scratch each time the selector is changed.
12-06-2016 08:30 AM - edited 12-06-2016 08:31 AM
Hi Scooobie,
If I'm understanding your question correctly.
Intialize a shift register with the randomly generated value, then you can increment or decrement the value depending on if you're heating or cooling.
12-06-2016 10:32 AM
If the demo temp vi is just simulating the temperature, why not replace it with a control while you are writing your program? That way you can adjust it manually to any temperature you want to test your code. And when you are done with your code you can replace the control with your real input or the demo temp vi.
12-08-2016 02:51 AM
Thanks for all your help so far I think I have resolved the temp supply issue. I've built a loop and gotten an average of 5 runs to output this has help simulate a somewhat stable result. I can work on the resolution of that later. I'll need to change my code now as I believe the key to getting the temperature changing from rising to dropping depending on limits will be in some sort of switching of a sub/add module fed into the input signal. I'll have another go at this once I get more free time.
12-08-2016 03:48 AM
@Scooobie wrote:
I'll need to change my code now as I believe the key to getting the temperature changing from rising to dropping depending on limits will be in some sort of switching of a sub/add module fed into the input signal.
Basically you need a case structure Boolean input for Increase/Cool (or even better a Enum for Inc/Stable/Dec) and a simple calculation on the temp. Making it into a Sub-vi is always good.
/Y
12-08-2016 04:54 AM
Thanks for that Yamaeda. I'm constricted by what we've currently experience in so a case strurcture seems like the way to go. Once I figure this out and set it up I should be able to just use this for both auto and manual conditions 🙂
12-08-2016 06:11 AM
Assuming you're not allowed to use Enum, you can use a Integer Slider with 3 steps, change to Named labels (instead of numbers) to get Dec/Stable/Inc and use 0,1,2 as case selectors. /Y
@Scooobie wrote:
Thanks for that Yamaeda. I'm constricted by what we've currently experience in so a case strurcture seems like the way to go. Once I figure this out and set it up I should be able to just use this for both auto and manual conditions 🙂
12-15-2016 12:02 PM - edited 12-15-2016 12:08 PM
Hi folks just wanted to say thanks to everyone for their help so far and I've almost completely finished the project. The only issue I've left to resolve is the automatic part of the control. Manualk works perfect and the automatic almost works. The only part that I have struggling with now and I've been looking for help over the last 4-5 days is in relation to keeping the heater either on or off once it's been switched. Ive got the limits controlled by either greater or less than, below lower limit turn on heater but the issue I'm having for both upper and lower is that once the heater goes on or off it turns back to it initial state once its back in control so the system effeftively oscillates around whichever limit it triggers when in automatic mode. I'm reaching out again for some help if anyone can give me some pointers. I'm trying to attach the vi but it's saying it has an unknown content type but I've not done anything different from previous with regards to saving it.
EDIT: Changed browsers and had to add a new post but the VI is posted below.
12-15-2016 12:07 PM
Adding VI
12-15-2016 12:38 PM - edited 12-15-2016 12:50 PM
You did not include the demo temp vi, so I used a control for the temperature.
Look at how you are adding and subtracting the temperature when the heater turns on and off. Why is is based on the iteration count of the loop?
Then you will need to look at the logic for turning the heat on and off. Think of once you turn the heater on you want to then look for the max temperature and then turn off, then wait for the temperature to drop below the min temp before turning on.