Hello!
I have machine which moves left - right, up - down based on counts from HSC, counts are like 8 pulses per 1cm of movement as precision is not factor here. Since i have multiple points ( liek go forward for 100, back 100, forward 50 etc, etc) I did solve those by counting and compare blocks, so when HSC value goes over set value it sets coil and when other rung does it sets other and resets that one....
And than I do run inverter by classic run fwd and run rev logic command from outputs. As you can see I do have direct coil for each output on PLC and I set them ON by contact, which are triggered by set/reset coils on rung where rest is. What you think is that good practice or not? For now it works ok, and even great for this kind of precision. But in case I need to have multiple choices of movements and triggering direction, than things get veeeeery complicated (much of rungs and contacts for set/reset). I have posted code and would like to hear if someone had better more effective approach to this, plus is it better to trigger output this way, or direct from compare blocks?
P.S. This is just part of project, but you will get point.
thanks!
hsc_test_v1.ulpr