Hi friends
I am planning to count the number of total steps of a machine moving between different location.For actual positon of the machine , i am getting BCD in my plc.Let us assume if the machine is at position #1 and i give command to go to position #4 , It goes there in steps i.e. goes to positon#2 and stops and moves and stops at position#3 and stops and then to position#4.So it moves 3 steps. Similarly if i give command now to location#2 , It moves to location#3 and stops and then moves and stops at location#2. So this time 2 steps.So totally till now 3+2 steps.
I can do it by taking feedback of forward or backward movement and count it directly but unfortulatily I need to lay cable for it.
I want to do it with positon feed back. Something as below
Read presnet position
Read new positon
Subtract new positon value from old
Stroe result at a memory location say MW100
similarly in next operation
and save result to previouly saved result at MW100
but this time we have to take care as when i move from lower location to higher location , after subtraction i get answer in negative whereas i need it in positive so i need to make it positive.
I am trying it in diffent ways but suggestion from you guys are highly appriciated.
I am planning to count the number of total steps of a machine moving between different location.For actual positon of the machine , i am getting BCD in my plc.Let us assume if the machine is at position #1 and i give command to go to position #4 , It goes there in steps i.e. goes to positon#2 and stops and moves and stops at position#3 and stops and then to position#4.So it moves 3 steps. Similarly if i give command now to location#2 , It moves to location#3 and stops and then moves and stops at location#2. So this time 2 steps.So totally till now 3+2 steps.
I can do it by taking feedback of forward or backward movement and count it directly but unfortulatily I need to lay cable for it.
I want to do it with positon feed back. Something as below
Read presnet position
Read new positon
Subtract new positon value from old
Stroe result at a memory location say MW100
similarly in next operation
and save result to previouly saved result at MW100
but this time we have to take care as when i move from lower location to higher location , after subtraction i get answer in negative whereas i need it in positive so i need to make it positive.
I am trying it in diffent ways but suggestion from you guys are highly appriciated.