Assistance on text field math

If you created a new screenset and want to share it with others then please post it here. You can talk about screens here.

Assistance on text field math

Postby ejg3855 » Wed Sep 16, 2020 3:18 pm

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
ejg3855
 
Posts: 28
Joined: Thu Aug 15, 2019 3:01 pm

Re: Assistance on text field math

Postby dezsoe » Wed Sep 16, 2020 6:11 pm

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
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Assistance on text field math

Postby ejg3855 » Thu Sep 17, 2020 3:26 pm

thanks a ton.
ejg3855
 
Posts: 28
Joined: Thu Aug 15, 2019 3:01 pm


Return to Custom Screensets

Who is online

Users browsing this forum: No registered users and 4 guests