Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2012, 02:11:02 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  VB commands needed for tooltable
Pages: 1   Go Down
Print
Author Topic: VB commands needed for tooltable  (Read 870 times)
0 Members and 1 Guest are viewing this topic.
softselect
Active Member

Offline Offline

Posts: 56



View Profile
« on: December 29, 2009, 05:00:42 PM »

I have just completed my all in one lathe screen, now i want to add a wear offset calculation routine, that will read the current tool wear value and a userDRO contaning the wearoffset measured, then do some math and store the recalculated wear value back in the tool table

the code i will use to get the measured wear is something like this, but i cant fint the correct commands/veriable names

TWx=GetUserDRO(1201)     (read value from user DRO 201)
TW=GetWear....? (get wear value of X or Z from tooltable)
calculate new value for X axis e.g. (TWx/2)*-1 + TW
setWear.... = newvalue (store new value to tooltable)

Hope someone can help
Friedrich

Logged
Chaoticone
South Carolina, US
Administrator
*
Offline Offline

Posts: 3,598


Precision Chaos



View Profile WWW
« Reply #1 on: December 29, 2009, 05:43:01 PM »

Friedrich, see if the attached helps. It is only for a refrence for you. Still lots of checking, verifying, editing to do. Maybe an idea of some things to come. Use the numbers in the old numbers column.

Brett

* OEM List Alpha 3.ods (60.3 KB - downloaded 77 times.)
* OEM List Alpha 3.xls (245.5 KB - downloaded 54 times.)
Logged

Grin If you could see the things I have in my head, you would be laughing too. Grin
www.precisionchaos1.com
My guard dog is not what you need to worry about!
softselect
Active Member

Offline Offline

Posts: 56



View Profile
« Reply #2 on: December 30, 2009, 07:45:53 AM »

Thanks Brett,
But i dont see a code for the tool wearx and wearz
I will post the Q on yahoo, maye Brain or Art can help
Friedrich
Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,665


West Yorkshire, England



View Profile WWW
« Reply #3 on: December 30, 2009, 11:59:55 AM »

GetToolParam(SHORT toolnum, SHORT param) for tool parameters.

Param numbers are 1 - n and correspond to the tool window in the mill or turn modes. In turn for example, 1 is TipDia, 2 is Tip Radius. Etc.

And to put it back use :-

SetToolParam(SHORT toolnum, SHORT param, DOUBLE data)

Then you must re-store the tool table by doing a DoButton(316) "save tool table"

This is all from memory as I am not at my normal computer, errors may be included free of charge  Grin

Graham
« Last Edit: December 30, 2009, 12:12:33 PM by Graham Waterworth » Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
softselect
Active Member

Offline Offline

Posts: 56



View Profile
« Reply #4 on: December 30, 2009, 02:29:20 PM »

hi Graham
thanks for the info, i tried the following code
CT=GETDRO(24)
DTX=GETTOOLCT (SHORTCT, SHORT5)
TWx=GetUserDRO(1201)
NV=((TWX/2)*-1)+DTX
SetToolCT(SHORTCT, SHORT 5, DOUBLE NV)
DoButton(316)

and i get an error "Scriptter compile error"

Break down of what i am trying to do
CT=GETDRO(24)                                        /get current tool number
DTX=GETTOOLCT (SHORTCT, SHORT5)            /get wear value from table, if i add line y line for testing it give error here already
TWx=GetUserDRO(1201)                             /get user wear value
NV=((TWX/2)*-1)+DTX                               /calculate new waer value
SetToolCT(SHORTCT, SHORT 5, DOUBLE NV) /store new wear value
DoButton(316)                                           /save tool table


i am probebly doing it all wrong, but then the last real programming i done was BBC basic back in the 80's
thanks Friedrich
Logged
Graham Waterworth
Administrator
*
Offline Offline

Posts: 1,665


West Yorkshire, England



View Profile WWW
« Reply #5 on: December 30, 2009, 03:21:06 PM »

Try it more like this :-

CT=GETDRO(24)
DTX=GETTOOLparam(CT ,5)
TWx=GetUserDRO(1201)
NV=((TWX/2)*-1)+DTX
SetToolparam(CT, 5, NV)
DoButton(316)

Graham
Logged

G-Code is on the cutting edge

Autovalues Engineering, CNC machining specialists, Bradford, England
softselect
Active Member

Offline Offline

Posts: 56



View Profile
« Reply #6 on: December 31, 2009, 05:35:04 AM »

hi Graham
Thanks for the prompt responce, i tried it like you said, now i dont get the error, but nothing happens, any ideas
i saw some code on the forum some where that said to use CALL in front of the GetDRO...., tried that but it seems to have no effect
the tool table doesnt even come up, i even changed it to doButton(121)
maybe i should just wait till you get to ur usual computer, i assume its at your shop
Thanks for your time
Friedrich
Logged
softselect
Active Member

Offline Offline

Posts: 56



View Profile
« Reply #7 on: January 02, 2010, 05:25:36 PM »

hi graham,
the solution is as follows, thanks for your guidance, once i put in the dim statements it worked

DIM CT
DIM DTX
DIM TWX
DIM NV
'X WEAR=5
'ZWEAR=6
CT=GETDRO(24)         'GET CURRENT TOOL
DTX=GetToolParam(CT,5)      'GET CURRENT WEAR OFFSET
TWx=GetUserDRO(1201)         'GET REQUESTED OFFSET
NV=((TWX/2)*-1)+DTX         'CALCULATE ACCUMULATED OFFSET
CALL SetToolparam(CT, 5, NV)      'SEND VALUE TO TOOL TABLE
MESSAGE "OFFSET ACCUMULATED"   'STATUS INDICATOR
DoOEMBUTTON(121)         'SAVE TOOLTABLE

Happy new year from a swelteringly hot South Africa

Thanks Friedrich
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!