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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...