Page 1 of 1

Assistance on text field math

PostPosted: Wed Sep 16, 2020 3:18 pm
by ejg3855
I have my encoders feeding into the control and functioning as a DRO.

I have them setup to display a sort of X' axis underneath where my axis positions are so I can can compare.

I'd like to create a field that takes that DRO position and subtracts if from the actual position giving me a sort of gut check that the machine is in the right position.

I have no idea how to do this?

I am thinking it will need to be a macro loop ? But then how do I display a macro loop?

Thanks

Re: Assistance on text field math

PostPosted: Wed Sep 16, 2020 6:11 pm
by dezsoe
That's it:
Code: Select all
double mx = exec.GetXmachpos(); // X machine coord.
double x2 = AS3.Getfielddouble(2430); // Encoder 1 position
AS3.Setfield(mx - x2, 21000); // Your field

Re: Assistance on text field math

PostPosted: Thu Sep 17, 2020 3:26 pm
by ejg3855
thanks a ton.