Hi, I'm just a complete newbie on ladder logic and plc programming and I started a few weeks working with that, also it's my first post here, I'm working with an omron plc and I have an encoder attached to a rack and a pinion that reads the move of a component that is moved on a rail with a motor.
The encoder sends a signal ranging from 0 to 10v and I already set the limits physically on the encoder, but I need to measure that component distance outside of the range from a reference point in millimeters. First I need to convert the position in millimeters (I saw scl and apr functions but I don't get how I proper use it) so in an HMI it shows the proper distance that this component is placed at a reference point, set limits so this component so it only rides forward and backwards on that range and let the user input a value in millimeters so it travels to the desired position.
I tried to convert the signal in milimeters with a couple of mathematical operations but I think scl or apr is more suited for that operation, I have the conversion working but I think it can be optimized.
Another thing is that I need to store the current value because it oscillates and I'm using a compare function <> to check if the value has been changed to call the move function, probably here's another good way of doing it with switches.. I dunno.
The last thing is I need to reposition the component because when it reaches the value it travels a lil bit further so I need to make it go inside an approximated value (-1mm or +1mm).
Is anyone here that have done something similar and could help me out? It's my first post here and I'm already asking for too much... I did a research over the internet and here but could not find anything similar for my problem...
Thanks
The encoder sends a signal ranging from 0 to 10v and I already set the limits physically on the encoder, but I need to measure that component distance outside of the range from a reference point in millimeters. First I need to convert the position in millimeters (I saw scl and apr functions but I don't get how I proper use it) so in an HMI it shows the proper distance that this component is placed at a reference point, set limits so this component so it only rides forward and backwards on that range and let the user input a value in millimeters so it travels to the desired position.
I tried to convert the signal in milimeters with a couple of mathematical operations but I think scl or apr is more suited for that operation, I have the conversion working but I think it can be optimized.
Another thing is that I need to store the current value because it oscillates and I'm using a compare function <> to check if the value has been changed to call the move function, probably here's another good way of doing it with switches.. I dunno.
The last thing is I need to reposition the component because when it reaches the value it travels a lil bit further so I need to make it go inside an approximated value (-1mm or +1mm).
Is anyone here that have done something similar and could help me out? It's my first post here and I'm already asking for too much... I did a research over the internet and here but could not find anything similar for my problem...
Thanks