Hello Guest it is March 28, 2024, 12:32:38 PM

Author Topic: How To Tell When A G-Code Program Is Running?  (Read 7587 times)

0 Members and 1 Guest are viewing this topic.

How To Tell When A G-Code Program Is Running?
« on: September 10, 2009, 12:17:29 AM »
How can you tell, in a VB script, if a g-code program is currently running?

Regards,
Ray L.
Regards,
Ray L.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: How To Tell When A G-Code Program Is Running?
« Reply #1 on: September 10, 2009, 07:43:18 AM »
Yes, Look at the "cycle Start" LED, the only time it is on, is when the G code is running.

scott
fun times

Offline Bodini

*
  •  216 216
    • View Profile
Re: How To Tell When A G-Code Program Is Running?
« Reply #2 on: October 26, 2009, 10:09:17 AM »
But, if your gcode has a macro, the cycle start light goes out when the macro is running.

Update:  I stand corrected.  Its when you type a macro in the MDI that the cycle start doesnt light up.
« Last Edit: October 26, 2009, 10:17:34 AM by Bodini »

sunangel

*
Re: How To Tell When A G-Code Program Is Running?
« Reply #3 on: October 26, 2009, 11:29:27 AM »
Then how do we tell weather a gcode program is loaded? I know it's off topic, but it's best not to open a thread that is partially related, i think. =)

melee

*
Re: How To Tell When A G-Code Program Is Running?
« Reply #4 on: October 26, 2009, 01:43:02 PM »
Hi

currentfile = FileName() will get the name of the loaded .NC file as a string

Testing the return will determine if there is one loaded.
( If (!currentfile.IsEmpty()) {}  or If (strlen(currentfile)) {} type of thing in C++ or C, or something clunkier in VBS)

There are undoubtedly other ways to do the same thing.

regards

Melee

sunangel

*
Re: How To Tell When A G-Code Program Is Running?
« Reply #5 on: October 26, 2009, 11:31:30 PM »
Uhm, so how is it possible to write in VB???

melee

*
Re: How To Tell When A G-Code Program Is Running?
« Reply #6 on: October 27, 2009, 03:44:50 AM »
Hi

I  don't use VB, except where I have to for Mach.

Looking at the reference material, ( always a good move ) the below is a starting basis

Dim currentfile As String

currentfile = ""   // ensure string is empty before you start

currentfile = FileName()
If Len(currentfile) Then
         //  Do whatever you want to if you find a .NC file is already loaded here
End If

I have put together all the references I found on VBS when I was writing macros HERE for download.

When you have read them you will know as little as me.

regards

Melee
« Last Edit: October 27, 2009, 03:46:54 AM by melee »

sunangel

*
Re: How To Tell When A G-Code Program Is Running?
« Reply #7 on: October 27, 2009, 07:43:00 AM »
Thank you very much melee! Though I've been VB coding on Mach3 for a few years, i don't have such important infos like you have collected! Thank you melee!

Offline Bodini

*
  •  216 216
    • View Profile
Re: How To Tell When A G-Code Program Is Running?
« Reply #8 on: October 30, 2009, 10:26:44 AM »
One more thing to the OP.  The cycle start light goes off during and M1 pause.

Offline zealous

*
  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: How To Tell When A G-Code Program Is Running?
« Reply #9 on: December 19, 2009, 12:47:31 AM »
It is undocumented but:
G-Code is Loaded LED 172