Jump to content

HSC counting


DavorS

Recommended Posts

Good day,

I am working on a milling machine. The machine has multiple milling tools which are moved with motor and spindle.  The position is measured with incremental encoder which is connected directly to  the spindle, that means 1 rotation of spindle (10 mm per turn) is directly translated to 1 rotation of encoder (2500 pulses per turn). The position will be set only manually, since it is meant for correction of tools.

Previously I worked a lot with VisiLogic, but this is my first project with UniLogic.

At the moment I am having problem with the position. In the VisiLogic you could define integer type which was used for encoder, but in UniLogic it is generated automatically (UINT32). Since I need to count position in both directions is there any way to change unsigned integer type to signed?

I have already tried with linearization, but at compiling i get error message, that there can be used only same data types.

Did anyone encounter similar problem? Maybe any ideas for workaround?

 

Thank you for your replys

DS

 

HSC Configuration.jpg

Link to comment
Share on other sites

hi...i never used the THS module but i think that you can consider the overflow of the variables...i mean...both signed and unsigned variable start with no BIT high...then value "0"...if the unsigned receive a "-1" command all the BITs will be HIGH that will give you the max value of this variable...but if you do the same with the signed variable you will have all the BITs HIGH that means "-1"...then i think you can use a simple store value block to store the value of the UINT32 into an INT32.

  • Upvote 1
Link to comment
Share on other sites

Heya,
As always, simple solutions are always the best. Storing value into INT32 type of integer worked like a charm. This way I can also operate with the formula function, which makes calculation of the position even easier. I would like to thank you for your help/time.


Best regards,
DS

Link to comment
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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.