Hello Guest it is April 19, 2024, 12:49:49 PM

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 - zealous

51
Thank you Dave, Terry,  Ya-Nvr-No  and everyone

This seems to work... the reason I took out wait for the regen LED to come on is in some cases the file is aready loaded and that would cause the script to get stuck.

Ya-Nvr-No code looks good cept for if the user Feedholds the current loaded file or other cases that the machine is not moving could cause some issues.

Code: [Select]
LoadFile"c:\mach3\gcode\roadrunner.tap"

DoOEMButton(MachSimRoutine)

Call WaitForSimFinish()  

Const RegenInProcessLED          = 179   ' On during regen & Sim process

Sub WaitForSimFinish()

      sleep(10)   ' we want at tighter loop here

  
   'sleep 10
   'message "waiting for end transition"
   'sleep 10
  
   ' ok the process started, wait for it to end
   While CBool(GetOEMLED(RegenInProcessLED))  
      ' wait for process to finish
      'message "waiting for sim to end"
      sleep(100)
   Wend
   Sleep (100)   ' add a bit of pad time
   'message "sim ended"
  
   ' ok, best we can tell, the process started and then ended, let's return to the caller
  
     runfile()
   Exit Sub

End Sub

52
I don't mean to hijack this topic but "LoadRun" has been freezing up Mach for me...is this happening to anyone else?

53
Drop a label in screen4 and name it "UserLabel1"

54
If you want to get the next tool with that code I would count back from 3 characters out from T and check to see if it is numeric.

Code: [Select]
Dim filesys As String
Dim currentLine As String
Set filesys = CreateObject("Scripting.FileSystemObject")
Dim i As Integer
i = 0

currentLine = GetOEMDRO(816)+1

Set filetxt = filesys.OpenTextFile(FileName , 1, True)


Do While filetxt.AtEndOfStream <> true
linestring = UCase(filetxt.ReadLine()) & " "

If linestring <> " " Then

i = i+1

If i > currentLine Then

If ((InStr(linestring,"M6" ) >0 Or InStr(linestring,"M06" )>0)) Then

ToolIndex = InStr(linestring,"T")

For d = 3 To 0 Step -1

ToolNum = Mid(linestring,ToolIndex+1,d)

'Msgbox ToolNum

If IsNumeric(ToolNum) Then

N = GetToolDesc(ToolNum)
D = GetToolParam(ToolNum,1)
L = GetToolParam(ToolNum,2)

SetUserLabel(1, ToolNum & " " & N)
SetUserDRO(2000,ToolNum)

Exit For

End If

 Next d   



Exit Do

End If

End If
End If

Loop

'MsgBox GetUserDRo(2000)
'MsgBox GetUserLabel(1)

filetxt.Close
Set filesys = Nothing
Set filetxt = Nothing

55
General Mach Discussion / Re: RUN REVERSE, Serious problem
« on: May 19, 2010, 08:47:13 PM »
From my understanding "Reverse Run" will also NOT read MCodes and such.
If you press the stop button rather then resuming from a FeedHold do you get the same results?

56
Mach Screens / Re: Mach 3 in small Netbooks (1024 x 600)
« on: May 15, 2010, 03:55:37 PM »
Selecting the "auto screen enlarge" in the "gen config" should fit the screen to your resolution.

57
Works in progress / Re: Flash RU Screen
« on: April 29, 2010, 05:09:50 PM »
Nice!
Things seem to be working well, will run it on my machine and report back.

58
Works in progress / Re: Flash RU Screen
« on: April 29, 2010, 02:46:39 AM »
this is a great way to dynamically import stuff, for example Macros:

Code: [Select]
vbdata = new LoadVars();
vbdata.onData = function(vbsrc) {
var myvb = vbsrc;
vbformated = myvb;//.split("\n");
sendvbcode.text = vbformated.split("\r").join("");
};
vbdata.load("C:\\Mach3\\Flash\\UserMacros\\usercode1.txt");

59
Works in progress / Re: Flash RU Screen
« on: April 26, 2010, 10:10:43 PM »
yeah that will work fine.
I had just come up with a way to just name your object and it would create the watch function dynamically depending on the name of the object by using that function.

What you have works well.

If you want to gather anything that Flash is using you can do a debugger check with this.
Code: [Select]
for (var Object_Name in _root) {
trace(Object_Name)
}

thanks,
Jason

60
Works in progress / Re: Flash RU Screen
« on: April 26, 2010, 06:49:29 PM »
Looks great, will test things out and report back.

I am not sure if you are already doing this but I found it helps create screens faster and even more reduces resources.

You can get the current objects on the stage with
Code: [Select]
typeof and
Code: [Select]
Object_Name in _root
So you could grab all of the objects and there names and automaticaly create functions for them. You can also store up what was there before they moved to another frame and remove the "watch" function. This is important because since we are watching from the root they are always there and active even when you may not need them. This can cause a LED to fire off a function even if the code isnt on that frame.

This is what I do, and if you have a special function just put an indicator in the objects name.

Code: [Select]
///Create buttons and LED's Function
LED_Watch_function = function () {;

//remove any watch functions;
for (var w:Number = 0; w<_root.Stored_watch.length; w++) {;
_root.unwatch(_root.Stored_watch[w]);

};

///declare;
_root.Stored_watch = Array();
i = 0;

///Loop and find all objects named LED*********X EX:(LED_800);
for (var Object_Name in _root) {;

///Is it a movie object to nerrow it down;
if (typeof (this[Object_Name]) == "movieclip") {;

//-------------------------------------------------------------------------;

///does it have LED in the name;
if (Object_Name.indexOf("LED") == 0) {;

//What is the LED number;
LED_OEM_num = Object_Name.substr(3, Number(Object_Name.length-7));

//check current state of the LED;
if (_root["LED"+LED_OEM_num] == 1) {;
_root[Object_Name].gotoAndStop("on");
} else {;
_root[Object_Name].gotoAndStop("off");
};

///This function is create for each object with LED for its name<<<<<<<<<<<<<<<;
_root["LED"+LED_OEM_num+"_function"] = function (varName, oldVal, newVal) {;

//Call function (optinal);
_root[varName+"sub"](newVal);

//check cuurent state of the LED;
if (newVal == 1) {;
_root[varName+"_mov"].gotoAndStop("on");

} else {;
_root[varName+"_mov"].gotoAndStop("off");
};
return newVal;
};

//Watch the LED;
_root.watch("LED"+LED_OEM_num,_root["LED"+LED_OEM_num+"_function"]);

//Store it to remove later<<<<<<<<<<<<<<<<<<<<<<<<<;
_root.Stored_watch[i] = "LED"+LED_OEM_num;
i++;
};
};
};
};
//end function;