
adccommunitymod (AutomationDirect) asked a question.
Created Date: June 25,2013
Created By: Biederboat
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Hey all, newbie here trying to do my first "recipe ". Currently have a basic 4-step program that uses 4 timers sequentially where each timed step holds an analog output at a steady state. Works great, but we have a 2-position selector switch where we would like to have two different recipes that will have slightly different timer presets and corresponding analog output values. We currently use an I-box (IB-462) to configure the I/O module that assigns V2002 as the output variable and a LD & OUT box to move the value in at each timer step. What I'm thinking I need to do is examine the selector switch input and load corresponding timer presets and analog output values, is that the right direction? So, instead of a fixed timer preset of say "K300 " I would have a V2003 (or whatever is appropriate) where V2003 would be assigned depending on the state of the recipe selector? Am I headed in the right direction? If so, how would I do the analog output where it's always reading V2002? Thanks, BB
Created Date: June 25,2013
Created by: bcarlton
Since you only have two possibilities then it might be easier to understand at each timer step to have two rungs, each conditioned by the appropriate state of your selector switch and moving the selected value into the analog output register.
Created Date: June 25,2013
Created by: Biederboat
I may have over simplified it. I have four steps for the general logic, each step has a timer present and a analog output that are different (i.e. 8 variable per recipe). Also, we may add more recipes in the future. Does that change things?
Thanks,
BB
Created Date: June 25,2013
Created by: Bob S BN
You 're headed in the right direction. Use VMEM locations for your timer presets. Then, based on the state of your selector switch, do a bunch of LD-OUTs where you load a K value and OUT it to the timer preset VMEM address.
As far as the analog values, I presume you already have some logic that checks what timer is running (or just got done) , and then LDs a K value and OUTs it to V2002. Just further that logic such that if selector switch is on and timer 1 is on, LD value "A " and OUT V2002, and if selector switch is off and timer 1 is on, LD value "B " and OUT V2002,
Hope this makes sense, and I'm sure there are several other ways to skin this cat,
Created Date: June 25,2013
Created by: Biederboat
You 're headed in the right direction. Use VMEM locations for your timer presets. Then, based on the state of your selector switch, do a bunch of LD-OUTs where you load a K value and OUT it to the timer preset VMEM address.
Awesome, I assume I can "stack " the LD-OUTs (i.e. all one one rung), so there would be one input examined and then 4 sets of LD-OUTs?
As far as the analog values, I presume you already have some logic that checks what timer is running (or just got done) , and then LDs a K value and OUTs it to V2002. Just further that logic such that if selector switch is on and timer 1 is on, LD value "A " and OUT V2002, and if selector switch is off and timer 1 is on, LD value "B " and OUT V2002,
You are correct-o on the first part. I was hoping that I could "load " all the analog outputs at the first part in the program. If I correctly follow what you 're saying, I would load the V2002 at each point where it's used which is right after each TMR box. I can make work what you 're saying, again, was just hoping to do it sort of "clean " like with the timer presets but since the analog output is all V2002 I see it as more challenging.
Thanks!
BB
Created Date: June 25,2013
Created by: scott.lawrence
instead of LD/OUT/LD/OUT, look at the MOV instruction. You can move entire tables with three instructions, LD/LDA/MOV.
Created Date: June 25,2013
Created by: Bob S BN
Awesome, I assume I can "stack " the LD-OUTs (i.e. all one one rung), so there would be one input examined and then 4 sets of LD-OUTs?
Yes, you can stack them all in one rung. But you will want two rungs. Rung "1 " LDs and OUTs a bunch of values if selector switch is on, and Rung "2 " LDs and OUTs a bunch of values if selector switch is off. This would make the program a little more readable as well.
I was hoping that I could "load " all the analog outputs at the first part in the program. If I correctly follow what you 're saying, I would load the V2002 at each point where it's used which is right after each TMR box.
Use 4 VMEM locations to temporarily store your 4 analog values, lets say V3000-V3003.
In the beginning of your program, where you look at your selector switch status as I mentioned above, do 4 more LDs and OUTs on each rung putting the proper values into V3000-3003.
In the timing section of your program, after each timer, instead of LDing a "K " value, LD from V3000 (or one of the others) and OUT to V2002
With proper nicknames on the VMEM locations, it should be pretty easy to look at the first two rungs and modify the values if needed.
Good Luck,
Created Date: June 25,2013
Created by: Biederboat
Awesome, thanks! That's exactly what I did with the timers and that makes sense for the analog I/O, I was hoping it could be done kind of that way.
Thanks again,
BB
Created Date: June 25,2013
Created by: Biederboat
Hey all, newbie here trying to do my first "recipe ". Currently have a basic 4-step program that uses 4 timers sequentially where each timed step holds an analog output at a steady state. Works great, but we have a 2-position selector switch where we would like to have two different recipes that will have slightly different timer presets and corresponding analog output values.
We currently use an I-box (IB-462) to configure the I/O module that assigns V2002 as the output variable and a LD & OUT box to move the value in at each timer step. What I'm thinking I need to do is examine the selector switch input and load corresponding timer presets and analog output values, is that the right direction? So, instead of a fixed timer preset of say "K300 " I would have a V2003 (or whatever is appropriate) where V2003 would be assigned depending on the state of the recipe selector?
Am I headed in the right direction? If so, how would I do the analog output where it's always reading V2002?
Thanks,
BB