Hello Guest it is April 17, 2024, 09:13:36 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

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 »
201
Flash Screens / Re: How to round numbers
« on: September 11, 2008, 07:12:16 PM »
Great  ;D

202
Flash Screens / Re: right click in mach screen
« on: September 10, 2008, 06:52:35 PM »
Hey,

To remove Content:

Code: [Select]
var rootMenu = new ContextMenu();
rootMenu.hideBuiltInItems();
_root.menu = rootMenu;

Another way to  Remove content:

Code: [Select]
Stage.showMenu = false;
Right click detect:

Code: [Select]
onEnterFrame = function () {
if (Key.isDown(2)) {
trace("Your right clicking")
    }
}

To add to the "Right Click" menu system(also including functions):

Code: [Select]
Right Click Menu
//////////////////
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();

///////////////////////////////////////////////////////////////////////////////////
var Load_menu:ContextMenuItem = new ContextMenuItem("LOAD GCODE", load_fun, true, true, true);
var edit_menu:ContextMenuItem = new ContextMenuItem("Edit GCODE", edit_fun, false, true, true);


myMenu.customItems.push(Load_menu,edit_menu);
_root.menu = myMenu;

/////////////////////////////////////
function load_fun() {
fscommand("Button", "216");
}

function edit_fun() {
fscommand("Button", "115");
}

Thanks,
Jason Blake

203
I forgot to mention.

I commented out the "Ref Home" and "G1 X0 Yo" if file count equals "0"

If you comment that part out then if your # of files returns 0 it will send the machine to "X0 Y0" and turn off the "File watch" function.

You can then start back up the "File Watch" function when your other machine is ready....


One intresting thing that wouldn't take but a few lines of code....

When your machine if finished and has reached 96 files...you could copy the files to another location, and automate the restart process by simply deleting the files from the "Watch Files" location.
This would allow full automation and no user interaction.




204
DownLoad the Zip File located below the JPG image below this message is has the set screen and Macro pump code.

1. Place: Macropump.m1s
In your Profile Example: "C:\Mach3\macros\Mach3Mill\"

2. In Mach: View/Load Screen " FileWatch.set"

3. In Config/GenConfig: turn on Macropump


I added a tab at the top to get to the "File Watch" page.

It will look at: "C:\automation" about every second (you can change the "Sleep time in the macro"***You can take the sleep function out if you like...some people think it helps slower computer.

If DRO 2000 returns the same file count twice it exits the function and waits for the number to change( InterLock).

You shouldn't have to add much more code to finish things up.

So I think then you will just have to tell it how far to move depending on the file number....I would use Modulus and check the current file number in the loop to determine if you need to move Y.


Thanks,
Jason Blake


205
hey Octathorpe,

I made a typo in the two codes above but corrected them...I had: "getoemdro801" ....rather then "getoemdro(801)"

There shouldn't be any question marks....perhaps it is an unrecognized font types? What part of the country are you from...this might have something to do with it.

206
Hey,

Here is all you need to get the axis moving depending on number of files:

Open Mach Script editor and add this code in and hit run:

The "IF" statement is looking to see if there are 7 files "GetFileCount = 7"
Code: [Select]
'***Create file system object***

'File Sytem Object
Dim objFSO As Object

'Set VB System object
Set objFSO = CreateObject("Scripting.FileSystemObject")

'Folder path
folderpath= "C:\automation"

'Get File count
GetFileCount = objFSO.GetFolder(folderpath).Files.Count

'Message number of files
Print "There are " & GetFileCount &" Files"

'How many to check for
If GetFileCount = 7 Then

Print "If statment True"

'Get current position Move Y up + 9mm
MoveY = getoemdro(801) + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")

End If


'Clean up
Set objFSO = Nothing


It would be better to look at the UserLed and when Not active run the above Macro. That way you don't need to run the macro pump

You might have another button to exit the function in case of an emergency.

You can do it all in a "Brain" would be the best.

Thanks


207
I think there might be a better ways then looking at the number of files in a directory....

can you trigger an external switch with your machine?

You can also use Flash with Zinc to access full functioning VB!

If you want to look at the amount of files in a directory use:

Code: [Select]
'Get File count
GetFileCount = objFSO.GetFolder(folderpath).Files.Count

You could also look at the file name and have set functions per file name as well.


Here is some quick code to do what you want I think  ::)  ...at least its a good starting point to get what you want perhaps.

I have not tested it on a machine... and barely debugged it  :-\

I'm thinking your machine is staring from the bottom left corner and working to the right 8 steps.....then when reaching 8 steps... up 1 row.... and back over to  step 1 then over 8 steps etc...

1. Copy past the code below in to a text File.
2. Rename the text File to "Macropump.m1s"
3. Drop "Macropump.m1s" in to your profile Example "C:\Mach3\macros\Mach3Mill"
4. Add a button to toggle LED2000 on/off to activate the script

You can also add DRO2000 to see how may files are in there.


Code: [Select]
'Ignore If loading a file
ProgLoading = IsLoading()

'***Make a Button to turn on/OFF LED2000 (This could be your run button)***

'Ignore If loading a file and if LED2000 is off
If(ProgLoading = 0 And GetUserLEd(2000)=1) Then


'***Create file system object***

'File Sytem Object
Dim objFSO As Object

'Set VB System object
Set objFSO = CreateObject("Scripting.FileSystemObject")

'Folder path
folderpath= "C:\automation"


'Check to see if the folder is there
If objFSO.FolderExists(folderpath) Then


'Get File count
GetFileCount = objFSO.GetFolder(folderpath).Files.Count


'No files
If GetFileCount = 0 Then

'***Set Default Values***

'Clear interLock
 Call SetUserDRO(2000,"0")

Print "File Count Zero"
'Send Machine to Zero's !!! You might want to set a LED before doing this and send the axis to zero :)
'Code("G1 X0 Y0")



'***File Number return larger then 0 see how many***
Else

'If new file added Store in a DRO InterLock
If Not GetOEMDRO(2000) = StoredFileCount Then

Print("Stored Value " & GetOEMDRO(2000))

'Store new value
StoredFileCount = GetFileCount

'Store interLock User DRO 2000
SetOEMDRO(2000,StoredFileCount)

'***Depending on File count will depend will trigger one of the Case statments***

'***Check Row Count***
Select Case  GetFileCount
   
    Case 8   
   
    'Move Y up + 9mm
MoveY = getoemdro(801) + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")

Print "Row "& GetFileCount
                 
     Case 16
     
     'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0") 

Print "Row "& GetFileCount
       
      Case 24 
     
      'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")

Print "Row "& GetFileCount
     
       Case 32 
       
       'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")

Print "Row "& GetFileCount
       
        Case 40
       
        'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0") 

Print "Row "& GetFileCount
       
         Case 48
         
         'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")

Print "Row "& GetFileCount
         
          Case 56
           
           
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")

Print "Row "& GetFileCount
           Case 64
           
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")
           
Print "Row "& GetFileCount

            Case 72
           
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")

Print "Row "& GetFileCount
           
             Case 80
             
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")

Print "Row "& GetFileCount
             
              Case 88
             
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")
             
Print "Row "& GetFileCount

               Case 96
               
'Move Y up + 9mm
MoveY = GetOemDRO800 + 9

'Move Y
Code ("G1 Y" & MoveY)

'Move X
Code ("G1 X0")

Print "Row "& GetFileCount


'End Case Statment
     Case Else   
   
   End Select
   
'END If new file added Store in a DRO InterLock
End If
'END No files
End If
   
Else

'No folder exist
MsgBox "Bad File Path"

'END Folder exists
End If

'END Ignore If loading a file
End If

'Clean up
Set objFSO = Nothing

208
Flash Screens / Re: Gcode Button in flash
« on: September 08, 2008, 03:08:49 PM »
Hi,

MCodes:
Code: [Select]
fscommand("Code", "M1")
Gcodes:
Code: [Select]
fscommand("Code", 'G0 X 1.0 Y 3.5 Z 2.3')
or

Code: [Select]
myGcode = 'G0 X 1.0 Y 3.5 Z 2.3'

fscommand("Code", myGcode);

Thanks,
Jason Blake


209
Flash Screens / Re: How to round numbers
« on: September 08, 2008, 03:01:07 PM »
These are the formating parameters:

Days:Hours:Minutes:Seconds

Code: [Select]
"%D:%H:%M:%S"
(f)loating point number, (4) decimal points, (+) or -

Code: [Select]
"+%.4f"
integer, no decimals

Code: [Select]
"%i"
hex number

Code: [Select]
"%x"
Format to send the above:

fscommand( TYPE fmt DRO Number , ABOVE FORMAT )

Example:
fscommand ("DROFmt800" , "format" )

210
Flash Screens / Re: How to round numbers
« on: September 08, 2008, 02:54:02 PM »
Hi,
To format a DRO use:

Example will format DRO 104

Code: [Select]
fscommand( "DROFmt104", "%.0f")
To format to time based:

Example will format DRO 815 and 814

Code: [Select]
fscommand( "DROFmt815", "%D:%H:%M:%S")
fscommand( "DROFmt814", "%D:%H:%M:%S")

Thanks,
Jason Blake

Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 »