Hello Guest it is March 29, 2024, 11:58:57 AM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ArcEye

Pages: 1
1
VB and the development of wizards / Re: steps per by VisualBasic
« on: April 08, 2010, 08:04:24 AM »
Yep,

Just tested it

X = GetParam("StepsPerAxisX")
SetParam("StepsPerAxisX", X * 2)


fetches steps per for X and then doubles it
You can see the X DRO change to compensate and the motor tuning entry is changed.

  ;D

2
VB and the development of wizards / Re: steps per by VisualBasic
« on: April 08, 2010, 04:19:35 AM »
Hi

Just come across this post and realised I had seen something recently that might help.

Amongst the list of strings for use in the GetParam() and SetParam() functions in the wiki are

"StepsPerAxisX" = X Steps per unit from the motor tuning page

"StepsPerAxisY" = Y Steps per unit from the motor tuning page

"StepsPerAxisZ" = Z Steps per unit from the motor tuning page
etc. etc.

Haven't tried them yet, but it reads as though you should be able to set them on the fly from VBS.

regards

ArcEye

3
VB and the development of wizards / Re: lathe turret macro
« on: April 07, 2010, 04:02:36 AM »


Do Kaderick, Dave Mauch or DennisCNC not already have a tool change macro or is your lathe not a Dyna 3000?

If it a Dyna 3000 have you seen this link?  The guy who converted it has already got toolchange with Mach and appears to be involved in a CNC company

http://www.romaxxcnc.com/dyna3000.html

If the 'not re-inventing the wheel' tack does not work, come back to the forum and someone will be able to help.

regards

ArcEye

4
VB and the development of wizards / Re: lathe turret macro
« on: April 06, 2010, 12:48:45 PM »
Hi

Quote
I'm finish installing mach3 and new geckos drives in my dina3000 lathe

If you mean a Dyna 3000 lathe, the link below will give you the names of 4 people who seem to have the same lathe, they should be able to help you.

http://www.machsupport.com/forum/index.php/topic,5480.0.html

Otherwise you will have to give some info as to exactly what the turret comprises of, how it indexes and locks etc. etc.

regards

ArcEye

5
Hi

Don't know of any laptop issues that would prevent directory access functions working.

I don't have Mach installed on a laptop so can't test that.

The code you posted works fine on my Vista desktop simulation set up and the MSDN VB documentation still shows that method for iterating through a directory listing

regards

ArcEye

6
OK

I have re-written parts of it and run it in simulation and it works now.

There was a syntax error with an unterminated If statement and a couple of other little glitches.
(I have taken out the G53 move before the toolchange, you will need to have the lathe carriages in a safe position before the change, use G28 or similar until you are happy with what you are doing and can reinstate it if you wish)

Rename it M6Start.m1s and install it in your profile macro folder.
Run it from MDI not VB window

If it does not work I need to know exactly the message on the error message line, not a paraphrase of it.

It works perfectly in my simulated set up. I can see the axes change value as I select different tools based on my tool table offsets.

regards

ArcEye

7
Hi

Quote
"Got past that maybe and now it says tool number slot too large"

You need to be precise, there is no message in the macro about 'tool number slots'.

The macro relies upon a saved tool number in a UserDRO, assuming you do not have the old owners full set of macros, that DRO will be blank.

Open the M6Start.m1s macro in an editor (Notepad not Word) and find

HoldingDRO = 1050
Requested_Tool = GetSelectedTool()
Current_Tool = GetUserDRO(holdingDRO)


Change the 3rd line to
Current_Tool= GetCurrentTool()

Save it, set tool 1 manually to cutting position, change the tool number DRO to 1 by clicking on it, entering '1' followed by carriage return and then enter M6 T303 from the MDI line.

If it doesn't work, write down exactly each message you get on the error message line and this will show a) that the macro is working and b) where you got to and why.

regards

ArcEye

PS  I assume you have auto tool change set in General Setup, check this too

8
Hi

The macro does rotate the ATC 60 degrees per tool and backs it up 10 degrees at the end to latch the pawl.

Yes it does replace the default macro that comes with the installation.

Rename the original M6Start.m1s macro in your C:\Mach\macros\name_of_your_lathe_profile folder to M6Start.old or something like that.

Copy the new macro to that folder and re-name it M6Start.m1s.

regards

ArcEye

9
Hi

It looks OK, should be called M6Start.m1s.

You should also have a corresponding macro called M6End.m1s, which may or may not actually do something, depending on the set up.

Try renaming it.

regards

ArcEye

PS Turn off macro pump, if you didn't need it before, you don't need it for this.

10
Hi

There is no built in FileOpen dialog in this version of VBS, you have to access the CommonDialog DLL in Windows.

The method is well documented, the below does just enough to open a dialog, you will have to research the way to fill the structure properly and read the returned structure when the dialog exits.

It might just be a lot of work for what you are trying to achieve.

Paste the below into a file, saved as a macro in whatever profile you are using, and call it from the MDI line and a FileOpen dialog will appear.
A message will tell you the return value of the dialog.

regards

ArcEye

Code: [Select]
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' save as m*********.m1s and call from MDI line to test


Public Const OFN_LONGNAMES As Long = &H200000
Public Const OFN_PATHMUSTEXIST As Long = &H800
Public Const OFN_CREATEPROMPT As Long = &H2000
Public Const OFN_NODEREFERENCELINKS As Long = &H100000




Public Type OPENFILENAME

  nStructSize       As Long

  hWndOwner         As Long

  hInstance         As Long

  sFilter           As String

  sCustomFilter     As String

  nMaxCustFilter    As Long

  nFilterIndex      As Long

  sFile             As String

  nMaxFile          As Long

  sFileTitle        As String

  nMaxTitle         As Long

  sInitialDir       As String

  sDialogTitle      As String

  flags             As Long

  nFileOffset       As Integer

  nFileExtension    As Integer

  sDefFileExt       As String

  nCustData         As Long

  fnHook            As Long

  sTemplateName     As String

End Type



Public OFN As OPENFILENAME



Public Declare Function GetOpenFileName Lib "comdlg32" Alias "GetOpenFileNameA"(pOpenfilename As OPENFILENAME) As Long




Sub Main()

Dim bSuccess As Boolean

 

   bSuccess = false

   Message ""



   OFN.nStructSize = Len(OFN)

   OFN.hWndOwner = hwnd

   OFN.sFilter = "*"

   OFN.nFilterIndex = 1

   OFN.sFile = "" & Space$(256) & vbNullChar & vbNullChar

   OFN.nMaxFile = Len(OFN.sFile)

   OFN.sDefFileExt = "" & vbNullChar & vbNullChar

   OFN.sFileTitle = vbNullChar & Space$(256) & vbNullChar & vbNullChar

   OFN.nMaxTitle = Len(OFN.sFileTitle)

   OFN.sInitialDir = "" & vbNullChar & vbNullChar

   OFN.sDialogTitle = "" & vbNullChar & vbNullChar

   OFN.flags = OFN_LONGNAMES Or OFN_CREATEPROMPT Or OFN_NODEREFERENCELINKS Or OFN_PATHMUSTEXIST

   

   bSuccess = GetOpenFileName(OFN)

   

  Message "Dialog return was" & Str(bSuccess)
 

   If bSuccess Then



    '  do stuff here

   End If

 

End Sub


 

Pages: 1