Page 1 of 2

Edit tool screen

PostPosted: Tue Aug 02, 2022 11:15 am
by BKG
Hello, I would like to add a label / field to the tool compensation list which, like tool length and tool diameter, should be linked to info in the profile file.
Does anyone have tips or links to literature on the subject?

I for ex do not understand how / when data is loaded into the label.

I'm somewhat used to Visual Basic, which has things like on load, do so and so

Re: Edit tool screen

PostPosted: Tue Aug 02, 2022 12:37 pm
by ger21
Are you talking about the detailed Windows table you can open, or the normal fields on the screen?

Re: Edit tool screen

PostPosted: Tue Aug 02, 2022 2:15 pm
by BKG
ger21 wrote:Are you talking about the detailed Windows table you can open, or the normal fields on the screen?


Windows table I asume se image

Re: Edit tool screen

PostPosted: Tue Aug 02, 2022 2:19 pm
by BKG
Also, how can I best convert string to int ?

Nead tihis as integer

string New_toolpos = exec.Readkey("Tooltablevalues","ToolPos"+Newtool, "");
string Current_toolpos = exec.Readkey("Tooltablevalues","ToolPos"+Currenttool, "");

Re: Edit tool screen

PostPosted: Tue Aug 02, 2022 5:45 pm
by ger21
Windows table I assume see image

No, just standard screen elements. Just use the screen editor to add your own fields. Your user fields will automatically be saved in the profile under UserTextFields I think.

Re: Edit tool screen

PostPosted: Tue Aug 02, 2022 5:56 pm
by BKG
BKG wrote:Also, how can I best convert string to int ?

Nead tihis as integer

string New_toolpos = exec.Readkey("Tooltablevalues","ToolPos"+Newtool, "");
string Current_toolpos = exec.Readkey("Tooltablevalues","ToolPos"+Currenttool, "");


Fix:

string SNew_toolpos = exec.Readkey("Tooltablevalues","ToolPos"+Newtool, "");
string SCurrent_toolpos = exec.Readkey("Tooltablevalues","ToolPos"+Currenttool, "");

double DNew_toolpos;
double DCurrent_toolpos;
int New_toolpos;
int Current_toolpos;

DNew_toolpos = Convert.ToDouble(SNew_toolpos); //BK String to Double
DCurrent_toolpos = Convert.ToDouble(SCurrent_toolpos); //BK String to Double

New_toolpos = Convert.ToInt16(DNew_toolpos);//BK Double to int

Current_toolpos = Convert.ToInt16(DCurrent_toolpos);//BK Double to int

Re: Edit tool screen

PostPosted: Tue Aug 02, 2022 6:03 pm
by BKG
ger21 wrote:Are you talking about the detailed Windows table you can open, or the normal fields on the screen?


what is a windows table ?

Re: Edit tool screen

PostPosted: Tue Aug 02, 2022 6:23 pm
by ger21
int New_toolpos = Convert.ToInt16(exec.Readkey("Tooltablevalues","ToolPos", "") + Newtool;

Re: Edit tool screen

PostPosted: Sat Aug 13, 2022 10:57 pm
by BKG
Error message in M6
CS1026 | in line: 168 | error text: Forventet )
CS1026 | in line: 170 | error text: Forventet )
--------------------------------------
Trying to get the New Slot value for to get right tool from the right toolholder Vers2115

the profile file is in type string ? and the number for toolchange nead to be in Integer ?? isent it so ?

int New_toolpos = Convert.ToInt16(exec.Readkey("Tooltablevalues","Slot"+Newtool,"");
int Current_toolpos = Convert.ToInt16(exec.Readkey("Tooltablevalues","Slot"+Currenttool,"");

Re: Edit tool screen

PostPosted: Sun Aug 14, 2022 8:49 am
by BKG
This line of code is not ok both in vers 2114 or vers2115
int New_toolpos = Convert.ToInt16(exec.Readkey("Tooltablevalues","Slot"+Newtool,"");

This lines of code is ok in vers2114 but not vers2115 odd message se image


string SNew_toolpos = exec.Readkey("Tooltablevalues","Slot"+Newtool, "");
string SCurrent_toolpos = exec.Readkey("Tooltablevalues","Slot"+Currenttool, "");

double DNew_toolpos;
double DCurrent_toolpos;
int New_toolpos;
int Current_toolpos;

DNew_toolpos = Convert.ToDouble(SNew_toolpos); //BK String to Double
DCurrent_toolpos = Convert.ToDouble(SCurrent_toolpos); //BK String to Double

New_toolpos = Convert.ToInt16(DNew_toolpos);//BK Double to int

Current_toolpos = Convert.ToInt16(DCurrent_toolpos);//BK Double to int

IMG_0176.jpg
error message