Seemed easy in theory
Eric R
Posts: 225
Yesterday I started what I thought would be a simple piece of BS2 code... well, that was yesterday.
IN8·was going to be my "program enable" input,
IN11·was going to be my "toggle /·step select" input
12 was going to be pulsout.
The theory was·IF IN8=1· then everytime IN11 was toggled it would advance·a "variable" stepping 1 to 8·as follows:
IF variable = 1 THEN PULSOUT 12,960
IF variable = 2 THEN PULSOUT 12, 1200
and so on...
Once IN8=0 output 12 would toggle to a input for use·as a counter later in the program and the stored variable would then become a comparator·for the counter. This counter and comparator work fine however stepping 1 to 8 and pulsing out at each step along with storing the variable upon IN8=0 has become a burden. How would you guys handle this?
··
IN8·was going to be my "program enable" input,
IN11·was going to be my "toggle /·step select" input
12 was going to be pulsout.
The theory was·IF IN8=1· then everytime IN11 was toggled it would advance·a "variable" stepping 1 to 8·as follows:
IF variable = 1 THEN PULSOUT 12,960
IF variable = 2 THEN PULSOUT 12, 1200
and so on...
Once IN8=0 output 12 would toggle to a input for use·as a counter later in the program and the stored variable would then become a comparator·for the counter. This counter and comparator work fine however stepping 1 to 8 and pulsing out at each step along with storing the variable upon IN8=0 has become a burden. How would you guys handle this?
··
Comments
That would, if I have it right, count on both the rising and falling edge of in11. Note that the entire DO:LOOP executes over and over rapidly, but the IF clause only executes when there is a change in in11.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com