Hello Guest it is March 28, 2024, 03:41:56 PM

Author Topic: Calling external subroutines (calling files)  (Read 2237 times)

0 Members and 1 Guest are viewing this topic.

Calling external subroutines (calling files)
« on: October 18, 2015, 05:18:01 PM »
After hours of misinformation, misdirection and just generally wasting my time, I have found what works for me in MACH3 R3.043.066 when calling a file as a subroutine.

Generally speaking, here are the “rules”.

The syntax is

m98 (-c:\AnyDirectory\AnyFile.tap)

A few notes on the syntax;

Note the hyphen (-) immediately after the opening parenthesis.
Note the full path.
You have no way of knowing this, but the file AnyFile.tap does not exist.
Note the file extension “tap”

ALL of these elements must be present in order for the call to work. In addition, sit down folks, this is an all time “why does that happen?" moment.  If any element is incorrect, when the file is loaded into Mach3, THE CODE WINDOW IS BLANK! Go figure…

Also note that the file NEED NOT be in the "subroutines" folder. My experience is that the file can exist anywhere it can be addressed using the Windows file path syntax. This includes network drives and Google Drive.

One additional note. If the file does not exist (whether due to an incorrect/invalid path, incorrect/invalid file name, etc.) the above blank code window appears.

I welcome any comments.

Offline Tweakie.CNC

*
  • *
  •  9,196 9,196
  • Super Kitty
    • View Profile
Re: Calling external subroutines (calling files)
« Reply #1 on: October 19, 2015, 01:48:32 AM »
Good info and things I did not know - thanks for spelling it out.

Tweakie.
PEACE

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: Calling external subroutines (calling files)
« Reply #2 on: October 21, 2015, 08:10:37 PM »
A very nice extension to having the sub in the \Mach\sub folder.
But is there ANY way to simply specify 'in the current folder'? ie, the one the main source file comes from?
Mach does know where that file comes from: it is shown on the Status and File bars at start.
I WISH!

Cheers
Roger
« Last Edit: October 21, 2015, 08:23:47 PM by rcaffin »