Forum
cnc_rdtimer negative value
Quote from Marco Cornaghi on December 2, 2021, 3:52 amHi 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
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.
Quote from Versex on December 6, 2021, 3:00 pmHi 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.
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.