How to save ENcoder initial value

Navanes

Member
Join Date
Mar 2021
Location
Malaysia
Posts
2
Hi experts,
im new to PLC programming
im using siemens plc(315) and Fraba absolute encoder

my project is to activate output (Q4.5) when encoder moves 1 meter

but I don't know how to program it

currently I able to get the encoder reading by using below code

L PID 256
T MD 256

L MD 260
T PQD 256


can please help to to give example codes on how to program encoder to activate output when encoder move 1 meter

thank you very much
 
Hi experts,
im new to PLC programming
im using siemens plc(315) and Fraba absolute encoder

my project is to activate output (Q4.5) when encoder moves 1 meter

but I don't know how to program it

currently I able to get the encoder reading by using below code

L PID 256
T MD 256

L MD 260
T PQD 256


can please help to to give example codes on how to program encoder to activate output when encoder move 1 meter

thank you very much


Which programming environment are you using, classic Step7 or TIA Portal and if the latter, which version?
Why STL????????



I have no idea what you wrote above and don't really want to know. But the concept is what matters.

Depending on the encoder resolution, it RPM and scan time you will determine if you need a high speed counter or not.
HSC will do some of the work for you; you give it a count number (equivalent to that one meter) and it will trigger an interrupt when it gets there; in the interrupt you put code that you could use in the program to turn on the output.
Without HSC, you basically need a compare instruction so that when Current_Count >= Trigger_Count you set a tag as above and your code will turn on the output.
 
Hi Expert,

I'm using step 7ver5.6

the code I use is I took from youtube tutorial

I believe step 7ver5.6 don't have hsc function, please guide if i can use other languages ladder or function block

yes i can do these( Current_Count >= Trigger_Count )

this program is for safety system
The input (0.1 n 0.2) which is joystick controlling the machine movement.
so if input 0.1 and 0.2 is not detected but the machine moves, an emergency lock should be triggered

I wanted the encoder to read both directions,
from the initial position, if moved certain distance to the right or left (but no signal from 0.1 n 0.2), it should trigger the output (the emergency lock)


so how to capture the initial value of the encoder when no signal from 0.1 and 0.2 and compare if it move certain distance
 
L #Enc //Encoder PID
DTR
L #PulsePerMM //How many pulses per mm
/R
T #Position //Position in mm


For these encoders, you need to give it a position value to work from. Their manual is quite clear on how to do this.

However, not safety rated. So if you actually require this to be part of a machine safety circuit it will not be compliant. At least not to EN60204-1
 

Similar Topics

Hi; First of all, I am sorry that my post is not relevant with this forum. I have recently purchased Samsung cell phone. I have alreay saved...
Replies
1
Views
73
Hello! I have a datablock in a PLC witch contains about 700 variables. I must save this data once a day on a Windows PC in a XML or CSV file. Eg...
Replies
1
Views
469
Hello Folks! I have an issue and its very often but in this case i applied all the tricks and tips that i always do in similiar issues but in this...
Replies
2
Views
771
I'm a bit stuck again... See the redacted picture. At the moment, pressing F7 saves the "live" laser measurement into the boxes indicated by the...
Replies
9
Views
1,069
On my HMI-1200, I'm trying to assign the image of a floppy disk ("save" icon) to a function key. I couldn't find one in the default drop-down...
Replies
5
Views
576
Back
Top Bottom