mark.plc

Latching position and counting rotation numbers

2 posts in this topic

Hello everyone!
I don't know how to program some thing.
I will tell you an example.
I have a rotary table, which is rotating from 0 to 2048 impulses (high speed counter counts impulses). I need in some situations latch the position (rewrite actual position to the register) and count number of rotation from this latched position. 
It must be a real type number with one decimal place (e.g. 1,5 rotation, 2,8 rotation).

With an integer i don't have any problem but i don't know how to bite this with a decimal number.

Mitsubishi FX5, GXWorks 3


Thanks for help! :)

Share this post


Link to post
Share on other sites

It's straight-forward. Most instructions you are currently using for integers have an "E" in front of them (like "EDIVISION", "EMOV".....). They indicate REAL numbers and can be used freely. Just remember that a REAL number occupies two 16-bit dataregisters, so if you use e.g. D0, then it will occupy both D0 and D1, so the next usable register would be D2. And if you have an integer that you want to convert to real, just use INT2FLT to convert.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now