Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 10:31:27 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Mach Screens
| | |-+  Flash Screens
| | | |-+  fscommand calling a vbscript
Pages: 1   Go Down
Print
Author Topic: fscommand calling a vbscript  (Read 356 times)
0 Members and 1 Guest are viewing this topic.
Sandy50400
Active Member

Offline Offline

Posts: 2


View Profile
« on: December 13, 2011, 04:05:24 PM »

Hey there first post so be kind. I'm relatively new to flash screens and had a 2 questions.

First, ultimately I'd like to have a custom vbscript in an .m1s file that a flash button could call to perform an action. When I run it I get a "scripter compiler error. In:external macro".

In the button I have this action script:

on (release) {
fscommand("VBMacro", "EdgeQ1");
}


The EdgeQ1 script (just a roof of concept):

CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
MsgBox "Current Feed Rate = " & CurrentFeed

Second, sometimes I get missing file flashcodes.txt
 
Is there some code I need to add in the vbscript or in the action script to get this to work?
And if I'm missing this flashcodes.txt file where can I get it.

Running this on Win7 64 and mach3 Version R3.043.053 using flash 8 and flash player 11. Will try it on my xp machine for my cnc once I can get it to work.

Any help would be greatly appreciated.
Logged
zealous
Active Member

Offline Offline

Posts: 486



View Profile WWW
« Reply #1 on: January 08, 2012, 07:23:37 PM »

There are 3 ways to do this:

Code:
_global.RunScript = function(the_script) {
RunScipts = 'If'+' RunScript("\\macros\\'+_root.Profile+'\\'+the_script+'") < 0 Then '+"\r"+'MsgBox "ERROR! Cannot Locate Script:'+' macros\\'+_root.Profile+'\\'+the_script+'" '+"\r"+'End If ';
fscommand("VBMacro", RunScipts);
};

On every button place(where LoadGCode is the name of you macro) :

Code:
on (release) {
RunScript("LoadGCode");
}

or

Set the value of a var using +"\r"+ to add the return lines :

Code:
Runstart = 'If'+' RunScript("\\macros\\'+_root.Profile+'\\'+"CycleStart"+'") < 0 Then '+"\r"+'DoOEMButton(1000) '+"\r"+'End If ';
fscommand("VBMacro", Runstart);

or

In you will need a text box with VB code in it and name the text box for example to Edge1:


Code:
on (release) {
fscommand("VBMacro", Edge1.text);
}

Let me know if this helps, I can upload examples if needed.
Logged

Regards, Jason Blake

www.Fusioncnc.com
Sandy50400
Active Member

Offline Offline

Posts: 2


View Profile
« Reply #2 on: January 10, 2012, 09:35:36 PM »

Thanks for the info I'll give it a try!!
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!