Hello Guest it is March 28, 2024, 08:19:59 AM

Author Topic: Flash Screen - execute G-Code  (Read 11037 times)

0 Members and 1 Guest are viewing this topic.

Flash Screen - execute G-Code
« on: August 09, 2010, 09:34:45 AM »
Hey everyone,

I'm currently working on a flash screen for mach3 in which I would like to execute a G-Code command.

So I googled a little bit and found this:
http://www.machsupport.com/forum/index.php?PHPSESSID=b4h1r1m6fq0madnpiegqakeq75&topic=7987.0

zealous wrote:
fscommand("Code", 'X 1.0 Y 3.5 Z 2.3')
...should work, but it doesn't work for me....

By the way,
shouldn't be there something with a "G" in the code?
fscommand("Code", 'G0 X 1.0 Y 3.5 Z 2.3') ?

Anyway,
can anyone tell me what im doing wrong?
I can execute G-Code commands with the MDI-input, but not with flash  :-\

And does anyone know where I can get the list with all mach3 fscommand() commands?

Thank you!

Offline zealous

*
  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: Flash Screen - execute G-Code
« Reply #1 on: August 12, 2010, 05:15:14 AM »
------------------------------------- SENDING to MACH CODE--------------------------------------------


VB SEND:Will send VB box text

Code: [Select]
on (release) {
fscommand("VBMacro", “*********X”);
}

BUTTON SEND:Send a button OEM code

Code: [Select]
on (release) {
fscommand("Button" , "*********" );
}

OPEN FILE: Open any file exstention out side of MACH

Code: [Select]
on (release) {
fscommand ("exec", "XCONTROL.exe");
}


SEND MDI

Code: [Select]
on (release) {
fscommand("MDIEntry", _root.box);
}


SEND MCODE

Code: [Select]
on (release) {
fscommand("Code", "M1");
}


------------------------------------- RECIVING IN Flash CODE--------------------------------------------

DRO: Numiracl updates

Code: [Select]
DRO1.variable="DRO800";  

DRO format: Format DRO readings

Code: [Select]
fscommand ("DROFmt800" , "format" )

/////////////////////THESE CAN USE as wel for formatting/////////////////////////////////////////////////////

// "%D:%H:%M:%S"/////Days:Hours:Minutes:Seconds/////////

//  "+%.4f" ////(f)loating point number, (4) decimal points, (+) or - /////////

// "%i" ///integer, no decimals /////////////

// "%x" ////hex number//////////////



Mode:  

Code: [Select]
Mode.variable=" Mode";  

SYSTEM STATUS:
 

Code: [Select]
Cosys.variable=" Cosys";  

ERROR DISPLAY:
 

Code: [Select]
ERROR.variable=" ERROR";  


Profile:
 
Code: [Select]
Profile.variable=" Profile";  

Status Line:
 
Code: [Select]
StatusLine.variable=" StatusLine";  

FileName:  

Code: [Select]
FileName.variable=" FileName";  


LED: Function to watch an OEM LED’s state of “0” or “1”

Code: [Select]
if (_root.LED1024 == 0) {
My_LED1024.gotoAndStop("green");
} else {
My_LED1024.gotoAndStop("red");
}

this.Function = function(varName, oldVal, newVal) {
if (newVal == 0) {
My_LED1024.gotoAndStop("green");
} else {
My_LED1024.gotoAndStop("red");
}
return newVal;
};
this.watch("LED1024", this. Function);

REMOVE SCREEN: Positioning and scaling


Code: [Select]
fscommand("ToolWidth", -1);

SCREN SCALING: scaling Screens


Code: [Select]
on (release) {
ToolXScale._xscale += 10.0;
ToolYScale._yscale += 10.0;
}



////////Send stage size///////

Code: [Select]
fscommand("StageW", Stage.width);
fscommand("StageH", Stage.height);


//Toolpathscreen/////
   

   
Code: [Select]
//keeping track getting property

// X Y positioning
_root.ToolX = getProperty(machscreen_mov, _x);
_root.ToolY = getProperty(machscreen_mov, _y);
// find height width
_root.ToolWidth = getProperty(machscreen_mov, _width);
_root.ToolHeight = getProperty(machscreen_mov, _height);
//find scale factor
_root.xscale = getProperty(machscreen_mov, _xscale);
_root.yscale = getProperty(machscreen_mov, _yscale);
//Sending Fscommand add what ever we can control here
fscommand("ToolX", _root.ToolX);
fscommand("ToolY", _root.ToolY);
fscommand("ToolWidth", _root.ToolWidth);
fscommand("ToolHeight", _root.ToolHeight);
////End script/////////////


   //////GCode watch//////////
   
   
Code: [Select]
//keeping track getting property
//X Y position
_root.GCODEX = getProperty(GCODE_mov, _x);
_root.GCODEY = getProperty(GCODE_mov, _y);
//Movie size
_root.GCODEHeight = getProperty(GCODE_mov, _height);
_root.GCODEWidth = getProperty(GCODE_mov, _width);
//Movi scale factor
_root.GCODExscale = getProperty(GCODE_mov, _xscale);
_root.GCODEyscale = getProperty(GCODE_mov, _yscale);
//Sending Fscommand add what ever we can control here
fscommand("GCODEX", _root.GCODEX);
fscommand("GCODEY", _root.GCODEY);
fscommand("GCODEWidth", _root.GCODEWidth);
fscommand("GCODEHeight", _root.GCODEHeight);
////////end script///////////


   //////MDI watch//////////
   
   
Code: [Select]
//keeping track getting property
//X Y position
_root.MDIX = getProperty(MDI_mov, _x);
_root.MDIY = getProperty(MDI_mov, _y);
//Movie size
_root.MDIHeight = getProperty(MDI_mov, _height);
_root.MDIWidth = getProperty(MDI_mov, _width);
//Movi scale factor
_root.MDIxscale = getProperty(MDI_mov, _xscale);
_root.MDIyscale = getProperty(MDI_mov, _yscale);
//Sending Fscommand add what ever we can control here
fscommand("MDIX", _root.MDIX);
fscommand("MDIY", _root.MDIY);
fscommand("MDIWidth", _root.MDIWidth);
fscommand("MDIHeight", _root.MDIHeight);
////////end script///////////

  
                                                                                                                         
« Last Edit: August 12, 2010, 05:19:58 AM by zealous »

Offline zealous

*
  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: Flash Screen - execute G-Code
« Reply #2 on: August 12, 2010, 05:17:21 AM »
You can do it 3 ways:

SEND MDI
Code: [Select]
on (release) {
fscommand("MDIEntry", "G0X1.2Y3.4");
}

SEND MCODE

Code: [Select]
on (release) {
fscommand("Code", "G0X1.2Y3.5");
}

Code: [Select]
on (release) {
fscommand("VBMacro", 'Code"G0X1.2Y33.4"');
}

I think you just didnt have the G0 in there.
Re: Flash Screen - execute G-Code
« Reply #3 on: August 12, 2010, 08:06:48 AM »
Thank you sooo much!
It worked!

and thank you for all the fscommands, they are really useful to me!

u rock!

bye

Offline zealous

*
  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: Flash Screen - execute G-Code
« Reply #4 on: August 19, 2010, 04:12:41 PM »
oppps that is a mistake on the toolpath code that is the old one:

Code: [Select]
//Toolpathscreen 1/////
fscommand("Tool1", "Show");
fscommand("Tool1X", "100");
fscommand("Tool1Y", "100");
fscommand("Tool1Width", "100");
fscommand("Tool1Height", "100");