09-10-2009 11:37 PM
Hi all,
I'm still looking for that elusive vi or section of one that I have been for a while. 😞
Basicly I want to trigger a timed 'holding' event once a temperature reaches a certain point (temperature thing not a problem nor is it's display).
Then once this temperature has been reached, I would like to 'hold' the temperature for a set time - or just hold until the next phase is ready - again for the same set time. Again the setting up of the timer values has been done and is not a problem.
Once this has timed out, I would like to send a signal to the next set of events - preferably a 'TRUE' signal, if this output ignal before the timer sequence was running as FALSE.
This setup should also be only triggered once, unless I press a reset button (of which I have working elsewhere too) whereby the sequence starts again, i.e. a signal saying that a preset temperature has been reached is found, and the sequences final output is FALSE until the timing is done where it becomes TRUE, returning to FALSE once a reset button is pressed. 🙂
I have tried while loops, flat sequence structures, case structures (using the trigger), elapsed timers and loads of others. I have tried ni.com, google, examples, but no joy. I'm sure this is simple and I am missing something!
If possible, if any kind soul can help me, could an example be posted in LV 7.1 format please?
Hoping someone can help!
Steve 🙂
09-11-2009 07:49 AM
Hi Steve,
I can't provide an example off-hand in LV 7.1 that will do that but I can get you started moving toward your goal.
1) Please start by drawing up a State Diagram that realizes your end goal. Once you have thought this out and the process is clear then...
2) Search this site for "State Machine" and figure out how to translate your State Diagram into a State Machine.
3) if you have trouble while walking that path, post-up your design along with your code so we can give you any nudge you may need.
Speaking for myself, "I'm here to help people learn to fish...."
Ben
09-11-2009 08:03 AM
Cheers mate, I shall draw up a condensed version (the other parts are quite complicated and would only get in the way of the issue).
Myself, I've been using labview for a few years now, but it's still the silly little things that are 'easy once you know how' that become an issue when programming! 🙂
Liking the teach a man to fish thing too!
With luck I'll have a vi for you in the next 15 mins 🙂 (Oh I'll put the timer part that doesn't quite work in and take out the parts that are triggered by a Qlarity G75 touchscreen (no vi needs to be uploaded there so we are OK with that!)
Steve
09-11-2009 08:09 AM
Steve,
The State Diagram will help use understand your needs. Generally when I see a situation that does not simply break down into a For While loop or Case structure, I stop and drwa it up to get my head straight befoer I drop any code on diagrams.
Please include that so both you and us have a clear definition of the problem.
Ben
09-11-2009 08:26 AM
I'll give the State Diagram a crack - could take a little while!
-Steve
09-11-2009 08:44 AM
For reference here is a diagram for an app that cylced through multiple devices on a wafer, mutliple light intensities and mutliple temperatures. Each temp change was driven by a Ramp to control a PID and after each ramp we waited for the PID to stabalize. When that temp was withing plus/minus 0.5 degree of set point we would acquired an IV curve.
I don't expect yours to be that involved but do think about all of the situation your code will have to handle BEFORE developing the code.
Just trying to help,
Ben
09-11-2009 09:02 AM
Having a tad bit trouble getting the State Diagram downloaded (the trial version as I don't have it) so in the meantime I'll list an event sequence. It might help!
The blue text is the problem.
In the meantime I have pared down the vi to only one vessel. Built using LV 7.1
Untill I get the State diagram sorted I hope this helps a little.
Thanks again so far! I appreciate it mate 🙂 i shall try to get the other stuff to you ASAP. Bear in mind it's just gone 10pm on a Friday night in Borneo here! 🙂
- Steve
START button pressed (This activates the main WHILE LOOP that everything is encased in).
TEMPERATURE is read and displayed whether START button pressed or not).
The TEMPERATURE, once START button is pressed, allows a heater to be turned on via a cFP2020 output.
Once this TEMPERATURE reaches a pre-set value, it should trigger a TIMER.
This TIMER counts in seconds the pre-set time value. During this time the TEMPERATURE of the heated vessel is CONTROLLED.
When the TIMER reaches the allocated time, the OUTPUT via the cFP2020 is stopped and an indicator saying REACTION COMPLETED is turned ON.
The TIMER is now inert. Nothing can turn the cFP2020 outputs here (to the heater) on apart from the RESET button.
Once this condition is reached, the TIMER cannot be reactivated by anything apart from reset by the RESET button.
This TIMER cannot be reset unless the RESET button is pressed.
The RESET button allows all states (apart from TEMP and TIME values) to be reset. (This has been done).
09-11-2009 09:10 AM
fios wrote:...
Thanks again so far! I appreciate it mate 🙂 i shall try to get the other stuff to you ASAP. Bear in mind it's just gone 10pm on a Friday night in Borneo here! 🙂
...
In the interst of teaching you to fish...
Q1) Are you allowed to drink in Borneo? If so I'd suggest you sit down with a beer and start drawing this thing up. Most of what I saw in the code you posted will be replaced.
When drawing it up, put yourself in a position where you are teaching some sharp rookie how to do the job manually. Think about what the will have to do and check as they do there job. Once you have it in a condition where you can explain it to a human, THEN we start to translate it for the compuete to understand.
Ben
09-12-2009 02:34 AM
Hi again Ben, I've simplified and tidied up the single reaction vessel vi now, please find it attached. 🙂
I am having some dificulty getting the State Diagram downloaded - where I am housed while is Kuching, Borneo, the wireless modem seems to be shared or at east not as high a quality as other places. Out in the wilderness where my project is, the internet signal is fine. I have had this same bother with other sites, and have contacted the mobile operators about it. So until I get back to the site on Monday, I'm afraid a vi is the best I can do unfortunatly.
Normally I'm in Singapore so no trouble there!
From the vi (based on LV 7.1) you can see I have great trouble triggering and locking down the timing sequence. In this version I have included a while loop to test some things - still no further forward!
The sequence above, pasted below is still true for the procedures needed.
thanks again,
Steve
🙂
START button pressed (This activates the main WHILE LOOP that everything is encased in).
TEMPERATURE is read and displayed whether START button pressed or not).
The TEMPERATURE, once START button is pressed, allows a heater to be turned on via a cFP2020 output.
Once this TEMPERATURE reaches a pre-set value, it should trigger a TIMER.
This TIMER counts in seconds the pre-set time value. During this time the TEMPERATURE of the heated vessel is CONTROLLED.
When the TIMER reaches the allocated time, the OUTPUT via the cFP2020 is stopped and an indicator saying REACTION COMPLETED is turned ON.
The TIMER is now inert. Nothing can turn the cFP2020 outputs here (to the heater) on apart from the RESET button.
Once this condition is reached, the TIMER cannot be reactivated by anything apart from reset by the RESET button.
This TIMER cannot be reset unless the RESET button is pressed.
The RESET button allows all states (apart from TEMP and TIME values) to be reset. (This has been done).