Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 26, 2012, 12:30:46 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
How to get the current subroutine file name?
Pages:
1
2
3
»
Go Down
« previous
next »
Author
Topic: How to get the current subroutine file name? (Read 1302 times)
0 Members and 1 Guest are viewing this topic.
glengeniii
Active Member
Offline
Posts: 26
How to get the current subroutine file name?
«
on:
July 15, 2010, 10:42:06 PM »
In VBscript, how can I find out what subroutine is currently open.
Example:
(c:Mach3/subroutines/99999.nc) is the current subroutine opened with a M98 command.
GetCurrentSubroutinefile = linestring 'gets the name of the current subroutine that is open
setuserlabel (1,linestring) 'inserts 99999.nc into userlabel 1
Is there an led that signals when a subroutine is open?
Thanks
George
Logged
glengeniii
Active Member
Offline
Posts: 26
Re: How to get the current subroutine file name?
«
Reply #1 on:
July 17, 2010, 02:09:01 AM »
???Um..... Anyone out there? If a M98 P12345 subroutine is currently loaded, is there any way I can request the current sub routine name (M98) in VBscript?
Logged
Tweakie.CNC
Active Member
Offline
Posts: 3,258
Super Kitty.
Re: How to get the current subroutine file name?
«
Reply #2 on:
July 17, 2010, 03:58:19 AM »
There are people here George - I am the 21st person to look at this who doesn't know the answer.
Tweakie.
Logged
Success consists of going from failure to failure without loss of enthusiasm. Winston Churchill.
DaveCVI
V4 Screen Contributor
Offline
Posts: 532
Re: How to get the current subroutine file name?
«
Reply #3 on:
July 17, 2010, 07:12:13 PM »
I've become pretty familiar with the Mach Cypress basic interfaces and I don't think what you are looking for is available from the existing interfaces. I think the only place the subroutine file name is known is inside of mach during gcode execution.
Dave
Logged
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
BR549
Active Member
Offline
Posts: 2,553
Re: How to get the current subroutine file name?
«
Reply #4 on:
July 17, 2010, 09:13:40 PM »
OK perhaps I am confused(;-) When you call an outside SUB from Gcode like you want the name appears in the FILE dispaly as
FILE: c:\Mach3/subroutines/99999.nc IS this what you need?? IF so then in VB the Call to retrieve the name is FILENAME
Message(filename) would send that file name down to the error label bar OR you could send it to a userlabel
NOW: This does NOT apply to an "internal" Sub call inside the Gcode file.
OR do you need something else?
«
Last Edit: July 17, 2010, 09:22:13 PM by BR549
»
Logged
DaveCVI
V4 Screen Contributor
Offline
Posts: 532
Re: How to get the current subroutine file name?
«
Reply #5 on:
July 17, 2010, 09:40:35 PM »
Interesting...
I didn't know the filename mach reported changes when an external subroutine is called (that's not in the programmer's manual).
I thought Mach just reported the main gcode file name.
Dave
Logged
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
BR549
Active Member
Offline
Posts: 2,553
Re: How to get the current subroutine file name?
«
Reply #6 on:
July 17, 2010, 09:57:34 PM »
(;-) Before Art fries his brain working on strange Gear designs you might want to hook a BrainWave recording device up to him and get the rest of the mach goodies out before he forgets them.
I remember the filename stuff from a ARF function I worked on.
(;-)
Logged
glengeniii
Active Member
Offline
Posts: 26
Re: How to get the current subroutine file name?
«
Reply #7 on:
July 17, 2010, 11:37:35 PM »
Thanks for the replies, I really appreciate them. I'm new to VB script and have been struggling with some of it. I created some VB script that I will insert into the M6 tool change file that when a tool change is ran, the script will find certain info in the gcode of the current open file. I use SheetCAM to write my gcode programs, which inserts certain info into the gcode (Processes, Tool Descriptions, Notes and etc.), always using the same format. The script I working on will scan the gcode and post this current info to several userlabels, as well, it will scan ahead to find the next tool change number and post the SheetCAM info that takes place with that tool. This way, while the machine is running, I can see what processes are taking place as well as the next tool number and next processes that will take place so I can get ready for them. It seems to work good, as long as there are no subroutines in the code. The problem that happens is that the script does not recognize that it is in a M98 subroutine, so it scans ahead but does not find the next blocks of SheetCAM info because they are in another file. My current part programs all use a Main Program with M98 calls using the M98(filename.nc) format, not the P word / O word format Ex. M98 P12345. I believe I can get around this by using the M98 P12345 O12345 format because all the gcode will be in one single file. I really don't want to have to edit all my programs that have already been written. Would it be wiser to use a Macro-pump to constantly scan for this info, instead of only searching for the info during tool changes? It seems like it might be a good idea because I could receive real time info of what processes are taking place, not just what processes will take place with a specific tool, Although I'm not sure this is what the Macro-pump is meant for.
Logged
DaveCVI
V4 Screen Contributor
Offline
Posts: 532
Re: How to get the current subroutine file name?
«
Reply #8 on:
July 17, 2010, 11:57:07 PM »
Scanning with a script may work - you'd have to do some experimenting to see.
I can think of some things that may make it difficult - consider these in the software design.
1) The macropump period is fixed at 0.1 sec - that may or may not be the sampling frequency which will work for you.
2) an alternative to the macro pump is to start a periodic script (See StartPeriodicScript call in programmer's manual). That call allows you to set the period of the periodic script. However, this is new and only available in 3.43.6+
3) scanning the code via an asynchronous routine will mean that you may need to invent software sync/locking tools between threads (if you need the scanner routine to work in conjunction with some other script like your m6). This is not trivial since Mach has no concept of such things at the cypress basic API level.
4) When mach has a gcode file open, I think that mach opens it exclusively as I seem to remember not being able to open a gcode file in an editor when mach has the file loaded. This may cause you trouble since you are wanting to scan the file that is currently loaded into mach.
Dave
Logged
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
BR549
Active Member
Offline
Posts: 2,553
Re: How to get the current subroutine file name?
«
Reply #9 on:
July 18, 2010, 09:24:49 AM »
Not to discourage you BUT that is a pretty ambitious project(;-) for ALL the reasons Dave described and then some. Mach has its limitations with VB interactions. I can see how it could be made to work BUT "I" would ask myself do I really need that much information at the control OR can I get the same info another way that would not TAX mach's processing load.
SheetCam can put out a LOT of operational INFO via it's REPORT engine(hardcopy of the project) AND Mach can tell you what the next tool change is to be.
Here I take the project file and set all the tools and load them into a simple carrosell tooL holder in ORDER of use. Then verify the tool table is correct for each tool. Then as the program cycles tools they are in order and ready to load at tool change time.
Just a thought, (;-) But do let us know how it goes. We all may learn a new trick.
Logged
Pages:
1
2
3
»
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...