Hello Guest it is December 26, 2024, 12:52:53 PM

Author Topic: Cannot get Mach 3 to run sub progams  (Read 10942 times)

0 Members and 1 Guest are viewing this topic.

Offline birdbrain

*
  •  41 41
  • Stupidity, beyond belief!
Cannot get Mach 3 to run sub progams
« on: July 13, 2008, 11:15:39 AM »
Hope someone can help. I've been trying for days to get Mach3 to run a sub-program, without success. I've searched the forum but found no answer that works. I used to be able to run subs until a few days ago.
Here is an example of a simple sub that Mach3 won't run:

G00 G90 G17
X120 Y0 Z0
M98 P1001 L2
M30

O1001
G01 G91 X-1
G90 Y5
Y0
M99
%

Please could someone tell me what I'm doing wrong... :'(

Offline birdbrain

*
  •  41 41
  • Stupidity, beyond belief!
Re: Cannot get Mach 3 to run sub progams
« Reply #1 on: July 13, 2008, 11:38:56 AM »
Oops... :-[
Title of this thread should have been "Cannot get Mach 3 to run sub progam (unless I write the sub program file on a Windows computer)"

I don't use Windows for anything except Mach3. For all other computing I use Red Hat Linux (Fedora). Sooo  I wrote the program file, including the sub, on my usual computer rather than the Windows one in the workshop. Odd thing is that the main part of a program will run but not the sub part  ???

It's only the fact that Mach3 is such a superb piece of software that I allow the abominable Windows OS in my workshop at all. As I have no plan to edit with Windows software, I just need to figure out which hidden characters Linux uses that Mach3 doesn't like. Then I can set my text editor to not insert them. Must be something to do with the: line end - carriage return. I think Windows does something weird at this point that Mach3, as a Windows program, expects to find.

DaveDoesIT

*
Re: Cannot get Mach 3 to run sub progams
« Reply #2 on: July 13, 2008, 05:56:11 PM »
Oops... :-[
Title of this thread should have been "Cannot get Mach 3 to run sub progam (unless I write the sub program file on a Windows computer)"

Hi BB,

I suspect it will be a line or file termination issue. DOS Text in Windows has a #13#10 byte pair (Character 13 = Return, Character 10 = Linefeed) and I suspect Linux is probably only using one of those. DOS Text in Windows also uses #26 (Character 26 = EOF = End Of File) and Linux may be using something different.

Best way to check is to use a raw (Hex) file viewer to see what hidden characters there are the end of a line and enf of the file.

There's a free Hex viewer and editor here...
http://www.chmaas.handshake.de/

Dave

DaveDoesIT

*
Re: Cannot get Mach 3 to run sub progams
« Reply #3 on: July 13, 2008, 06:03:26 PM »
There's a free Hex viewer and editor here...
http://www.chmaas.handshake.de/

Actually on that website, go to the "other freeware" and there is a free app to convert Linux text files to DOS Text format. It appears Linux uses #10 ( Hex 0A ) as the only end of line marker.

Here is the direct download link for it.

http://www.handshake.de/user/chmaas/delphi/download/crlf.zip

Dave

Offline birdbrain

*
  •  41 41
  • Stupidity, beyond belief!
Re: Cannot get Mach 3 to run sub progams
« Reply #4 on: July 21, 2008, 06:13:30 AM »
Thanks for the tip Dave.

I have now found that there is a simple Linux command line program that works a treat. It is "unix2dos". Very easy to use, works every time.  :)
This program is part of modern Linux distros and is probably already installed on most Linux computers.
This might help other folk who edit with Linux computers.

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
Re: Cannot get Mach 3 to run sub progams
« Reply #5 on: July 21, 2008, 12:19:02 PM »
Try posting your sub-routine in the "Subroutines" folder. I cannot quite remember how it works, I will have to think about it some more, but if you post the subroutine there, you can then call it from the main program. The only problem is, I can't remember how to call it. I will go have a look on my workshop machine, there are none on this machne.
Not me driving the engine - I'm better looking.

Offline birdbrain

*
  •  41 41
  • Stupidity, beyond belief!
Re: Cannot get Mach 3 to run sub progams
« Reply #6 on: July 25, 2008, 03:51:39 PM »
Try posting your sub-routine in the "Subroutines" folder. I cannot quite remember how it works, I will have to think about it some more, but if you post the subroutine there, you can then call it from the main program. The only problem is, I can't remember how to call it. I will go have a look on my workshop machine, there are none on this machne.
This would be really useful if I knew how to do it. At the moment I have a common set of working parameters and calculated variables that I use in a number of part program files. It would be great if I could store these in a special file and refer to it from all the other files. This should be very easy to do, anyone know how to do it ???