Johnny Rotten
Member
Master Line Set/Reset - do you folks use this?
For/Next - same question
(orout) - found out the hard way
Am going back to a project from last year. Machine was basically a compactor 'modified' to do other things.
It has 2 (two) modes of operation, 'manual' and 'automatic'. One selector switch handles this, as each mode sends 120V into an input.
Tried to set up 'subroutines' for each mode in programme. Initially seemed a nice way to structure programme. If 'manual' bit was true, MLS/MLR a section of logic to deal with that. Did the same for 'automatic'.
It did end up working, and will post logic next week as this machine must work. Found out the hard way that you can not have the same output ie, (out y6) be the result of two or more rungs of logic.
Basically in 'manual' mode Solonoid Fwd is 'fired' at certain times. In 'automatic' mode Solonoid Fwd is 'fired' at certain times as well.
With two subroutines for each mode, problems were plenty. Had to use (orout y6) for it to work. Basically 'ouput y6' was the 'result' of more than one rung of logic.
If For/Next was used for each 'subroutine' it ignored any logic other than what was in that 'loop'. Could not stop the damn machine at one point, on the simulator of course.
Why would DirectSoft allow you to write code like that as you get no errors. Rung 1 results in ouput y11 'true'; Rung 2 results in output y11 'true'; - for example.
It makes crazy things happen. Ended up, as stated, using (orout y11) for each rung (as an example), and it worked. Used Master Line Set/Reset for each subroutine, and it worked.
Documented it very well, teacher did not understand, gave me a 'B'.
Johnny
For/Next - same question
(orout) - found out the hard way
Am going back to a project from last year. Machine was basically a compactor 'modified' to do other things.
It has 2 (two) modes of operation, 'manual' and 'automatic'. One selector switch handles this, as each mode sends 120V into an input.
Tried to set up 'subroutines' for each mode in programme. Initially seemed a nice way to structure programme. If 'manual' bit was true, MLS/MLR a section of logic to deal with that. Did the same for 'automatic'.
It did end up working, and will post logic next week as this machine must work. Found out the hard way that you can not have the same output ie, (out y6) be the result of two or more rungs of logic.
Basically in 'manual' mode Solonoid Fwd is 'fired' at certain times. In 'automatic' mode Solonoid Fwd is 'fired' at certain times as well.
With two subroutines for each mode, problems were plenty. Had to use (orout y6) for it to work. Basically 'ouput y6' was the 'result' of more than one rung of logic.
If For/Next was used for each 'subroutine' it ignored any logic other than what was in that 'loop'. Could not stop the damn machine at one point, on the simulator of course.
Why would DirectSoft allow you to write code like that as you get no errors. Rung 1 results in ouput y11 'true'; Rung 2 results in output y11 'true'; - for example.
It makes crazy things happen. Ended up, as stated, using (orout y11) for each rung (as an example), and it worked. Used Master Line Set/Reset for each subroutine, and it worked.
Documented it very well, teacher did not understand, gave me a 'B'.
Johnny
Last edited: