Hello Guest it is April 26, 2024, 09:16:40 PM

Author Topic: Tool changer routine with hot swap  (Read 34695 times)

0 Members and 1 Guest are viewing this topic.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Tool changer routine with hot swap
« Reply #60 on: March 27, 2008, 12:07:40 PM »
LOL - you can't go around saying things like that. Last time I said that about someone's software they looked at me like I'd said their daughter had a face like a horse  ;D

vmax549

*
Re: Tool changer routine with hot swap
« Reply #61 on: March 27, 2008, 03:56:28 PM »
Hi Ian,

 ITS not too late like I said THAT would be my last approach. I believe I can figure out a workaround to the charector delay that does not involve using it. (;-)

Would you happen to know of a way to do a DOS command from inside of machVB if so then I can send the file to the printer with the DOS Print command????   

Yep I guess I had better straighten up or Brian might not talk to me anymore(;-(

(;-) TP
« Last Edit: March 27, 2008, 03:58:16 PM by vmax549 »

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Tool changer routine with hot swap
« Reply #62 on: March 28, 2008, 07:02:57 AM »
Hi Terry
Would you happen to know of a way to do a DOS command from inside of machVB if so then I can send the file to the printer with the DOS Print command????

Dim cmd As String
cmd = "print c:\test.txt"
Shell ("cmd.exe /c" & sCommand)

(With thanks to Shuja Ali)

Ian
« Last Edit: March 28, 2008, 07:05:56 AM by stirling »

vmax549

*
Re: Tool changer routine with hot swap
« Reply #63 on: March 28, 2008, 09:18:07 AM »
Hi IAN,     that worked like a charm(;-)

Here is the code to get the tool table data and print it. ( this is not an original code but borrowed peices and parts patched together to do a job)

All it needs to be added to it to be pefect Is to add the time and date to the top of the file AND arrange the data to be printed so all the collums line up making it easier to read. BUT as it is, it serves the purpose(;-)


***********************

'newer version will poll up To 225 tools And skip Any tool With a description of "empty"

' overwrite file = C:\mach3\ToolInfo.txt

textFilePath = "C:\mach3\ToolInfo.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(textFilePath)


Do Until num=225

num=num+1

N = GetToolDesc(num)
D = GetToolParam(num,1)
L = GetToolParam(num,2)
WD= Gettoolparam(num,3)
WL= Gettoolparam(num,4)

If N <>"Empty" Then

objTextFile.WriteLine("*Tool"& num &"  * "& N &" *Diameter: "& D &" *Length: "& L &" *Wear Diam"&WD &" *WearLength"&WL & Chr(13) & Chr(10))

Else

End If

Loop

objTextFile.Close

Dim sCOMMAND As String
 sCOMMAND="print c:\mach3\toolinfo.txt"
 Shell("c:\winnt2\system32\cmd.exe /c" & sCOMMAND)
 
End   

Thanks Guys for all the help. Hopefully it will serve others as well, We will add this to the MACH TOOL BOX.

(;-) TP

vmax549

*
Re: Tool changer routine with hot swap
« Reply #64 on: March 28, 2008, 09:27:13 AM »
HOWDY HOUNDDAWGS  that new( PRINT TOOL TABLE) button works like a CHARM. Here is what it prints out like:


*Tool1  * .250,EM,2f,RN *Diameter: 0.375 *Length: 1 *Wear Diam0 *WearLength1.1111

*Tool2  * .250,EM,4f,BN *Diameter: 0.05 *Length: 0 *Wear Diam0 *WearLength0

*Tool3  * .250EM,2f,FN *Diameter: 0.5 *Length: 0 *Wear Diam0 *WearLength0

*Tool4  * .500,EM,3f,FN,CB *Diameter: 0.25 *Length: 1 *Wear Diam0 *WearLength0

*Tool5  * Tap,tc,1/4x20 *Diameter: 0.12 *Length: 0 *Wear Diam0 *WearLength0

*Tool6  * BB, set .4883" DIAM *Diameter: 0.375 *Length: 0 *Wear Diam0 *WearLength0

*Tool7  * FM,6",alum *Diameter: 1 *Length: 0 *Wear Diam0 *WearLength0

*Tool8  * Probe,6"a,2mm,BE *Diameter: 1 *Length: 0 *Wear Diam0 *WearLength0

*Tool9  * .500 *Diameter: 1 *Length: 0 *Wear Diam0 *WearLength0

*Tool10  * This is a test *Diameter: 1 *Length: 0 *Wear Diam0 *WearLength0

*Tool99  * Probe *Diameter: 1 *Length: 3 *Wear Diam0 *WearLength0



(;-) TP
« Last Edit: March 28, 2008, 09:29:27 AM by vmax549 »

vmax549

*
Re: Tool changer routine with hot swap
« Reply #65 on: March 28, 2008, 09:40:36 AM »
IAN,  I gleened another piece of info about the sendportbyte call . It does seem to require the port address in HEX?

THat could be really dangerous for me to go roaming aroung inside of somewhere I don't have a clue about(;-)

Also I read that ART was going to address the charactor delay problem with a new version of event driven serial  but I don't see where that ever got finished.(;-)  Alot of the older equipment that was serial driven seemed to like the built in delay between charactor send over serial for some reason ???????

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Tool changer routine with hot swap
« Reply #66 on: March 28, 2008, 10:29:41 AM »
Hi Terry - now you're starting to take the p*ss  ;D

(PS - for 0x378 (C hex style) use &H378 (BASIC hex style)

Hi Terry - with regard to your last question to Graham - you need to read my earlier reply about the format of hex strings in BASIC. The syntax is &H0378 or whatever address you're using. The &H is instead of Grahams 0x at the front of the string.

A word of caution which I hope isn't too late. You have to be VERY careful which port or address you write to - you can seriously screw up your system - even trash the hard disk if you're not careful.

vmax549

*
Re: Tool changer routine with hot swap
« Reply #67 on: March 28, 2008, 11:45:51 AM »
OK I have the Tool slot assignment report finished, It tells what tool is in what slot and prints it out for you. It is assigned to a button (Print TOOLSLOT Assignment) It tells the slot #, T# and tool desc. Also inclused the tool currently in the spindle.

textFilePath = "C:\mach3\ToolAsmt.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.CreateTextFile(textFilePath)

slt1= getuserdro(1150)
slt2= getuserdro(1151)
slt3= getuserdro(1152)
slt4= getuserdro(1153)
slt5= getuserdro(1154)
slt6= getuserdro(1155)
slt7= getuserdro(1156)
slt8= getuserdro(1157)
TIS= getuserdro(1159)

TS1= gettooldesc(slt1)
TS2= gettooldesc(slt2)
TS3= gettooldesc(slt3)
TS4= gettooldesc(slt4)
TS5= gettooldesc(slt5)
TS6= gettooldesc(slt6)
TS7= gettooldesc(slt7)
TS8= gettooldesc(slt8)
TISA= gettooldesc(TIS)

objTextFile.WriteLine("*TSlot1---- " & slt1 &" -- " & TS1)
objTextFile.WriteLine("*TSlot2---- " & slt2 &" -- " & TS2)
objTextFile.WriteLine("*TSlot3---- " & slt3 &" -- " & TS3)
objTextFile.WriteLine("*TSlot4---- " & slt4 &" -- " & TS4)
objTextFile.WriteLine("*TSlot5---- " & slt5 &" -- " & TS5)
objTextFile.WriteLine("*TSlot6---- " & slt6 &" -- " & TS6)
objTextFile.WriteLine("*TSlot7---- " & slt7 &" -- " & TS7)
objTextFile.WriteLine("*TSlot8---- " & slt8 &" -- " & TS8)
objTextFile.WriteLine("**")
objTextFile.WriteLine("**")
objTextFile.WriteLine("*Tool In Spindle---- " & TIS &" -- " &TISa)

objTextFile.Close
Dim sCOMMAND As String
 sCOMMAND="print c:\mach3\toolasmt.txt"
 Shell("c:\winnt2\system32\cmd.exe /c" & sCOMMAND)
End   


****************** Copy of the printout

*TSlot1---- 8 -- Probe,6"a,2mm,BE
*TSlot2---- 7 -- FM,6",alum
*TSlot3---- 6 -- BB, set .4883" DIAM
*TSlot4---- 5 -- Tap,tc,1/4x20
*TSlot5---- 4 -- .500,EM,3f,FN,CB
*TSlot6---- 3 -- .250EM,2f,FN
*TSlot7---- 2 -- .250,EM,4f,BN
*TSlot8---- 0 -- Empty
**
**
*Tool In Spindle---- 1 -- .250,EM,2f,RN


(;-) TP



vmax549

*
Re: Tool changer routine with hot swap
« Reply #68 on: March 28, 2008, 12:35:09 PM »
OK I figured out the Time and Date thingy but I have a question about the file structure that gets printed out.

THis is what the file prints like:

*Tool#1  * .250,EM,2f,RN *Dia: 0.375 *Lgth: 1 *WrDiam0

*Tool#2  * .250,EM,4f,BN *Dia: 0.05 *Lgth: 0 *WrDiam0

*Tool#3  * .250EM,2f,FN *Dia: 0.5 *Lgth: 0 *WrDiam0

*Tool#4  * .500,EM,3f,FN,CB *Dia: 0.25 *Lgth: 1 *WrDiam0

*Tool#5  * Tap,tc,1/4x20 *Dia: 0.12 *Lgth: 0 *WrDiam0

*Tool#6  * BB, set .4883" DIAM *Dia: 0.375 *Lgth: 0 *WrDiam0

*Tool#7  * FM,6",alum *Dia: 1 *Lgth: 0 *WrDiam0

*Tool#8  * Probe,6"a,2mm,BE *Dia: 1 *Lgth: 0 *WrDiam0

*Tool#9  * .500 *Dia: 1 *Lgth: 0 *WrDiam0

*Tool#10  * This is a test *Dia: 1 *Lgth: 0 *WrDiam0

*Tool#99  * Probe *Dia: 1 *Lgth: 3 *WrDiam0

**
  Date: 3/28/2008 Time: 11:25:28 AM




********* THis is what I would like it to look like: Whith the columns lined up.

*Tool#1    * .250,EM,2f,RN           *Dia: 0.375    *Lgth: 1    *WrDiam0

*Tool#2    * .250,EM,4f,BN           *Dia: 0.05      *Lgth: 0     *WrDiam0

*Tool#3    * .250EM,2f,FN            *Dia: 0.5        *Lgth: 0     *WrDiam0

*Tool#4    * .500,EM,3f,FN,CB       *Dia: 0.25      *Lgth: 1     *WrDiam0

*Tool#5    * Tap,tc,1/4x20           *Dia: 0.12      *Lgth: 0     *WrDiam0

*Tool#6    * BB, set .4883" DIAM   *Dia: 0.375    *Lgth: 0     *WrDiam0

*Tool#7    * FM,6",alum                *Dia: 1          *Lgth: 0     *WrDiam0
 
*Tool#8    * Probe,6"a,2mm,BE     *Dia: 1          *Lgth: 0     *WrDiam0

*Tool#9    * .500                        *Dia: 1          *Lgth: 0     *WrDiam0

*Tool#10  * This is a test             *Dia: 1          *Lgth: 0     *WrDiam0

*Tool#99  * Probe                       *Dia: 1         *Lgth: 3     *WrDiam0

**
  Date: 3/28/2008 Time: 11:25:28 AM


Seeing how I can't format at the print level I would need to format the actual file that is written to look like this as the printer just dumps the file when printing.

Any ideas ????? 

(;-) TP

« Last Edit: March 28, 2008, 12:37:48 PM by vmax549 »

vmax549

*
Re: Tool changer routine with hot swap
« Reply #69 on: March 28, 2008, 01:40:44 PM »
Mean while back at the farm,(;-) I have stalled long enough building the easy stuff(;-) Back to the LOGIC side.

Seeing that Mach saves the DRO values I think the approach to the hotswap should stay with the dro approach.

I want to have the process selfcontained inside of mach if possible. So I will pound on a process using the DROs as the VARs.