• matthew@hierthinking.com

Forum

Please or Register to create posts and topics.

cnc_rdtimer negative value

Hi Matthew, thank you for your blog posts about Focas.

I'm trying to get time value with focas, with the function cnc_rdtimer, but with one machine it return me the correct value, in another one it return me negative number as you can see in the image. Have you ever had this case?

There's is also a function to get the alarm content in the box below the time in the machine panel?

Thank you

Uploaded files:
  • You need to login to have access to uploads.

Hi Marco,

 

This sounds like it is a two's complement error. Basically when using a signed integer the bits making up that integer can be arranged in a way that makes the value negative. You'll need to Google two's complement and try to figure out where the calculation is going wrong.