Script running issue

Discussions and file drops for Auggie
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Script running issue

Post by GlennD »

I am sure it is something I am doing wrong.

I can run the Spiral script from inside the Scripter, by putting in the line Spiral(50,0.1,0.2,0.5); and running it.
I can't seem to get it to run when I use the script window see picture.

I get this in the log:
54:12:488  Setting Fold: -3
The above line I would think is as it should since the button logic says set -3

54:17:408  Execution Phase begins...
54:17:408  MDI Script attempts execute
54:17:408  Script MDI execution begins.
54:17:418  End of MDI Script run.
54:17:478  Wait for non existant thread ended.

I even tried just putting the lines below in the script window.
I get the same as above in the log file.
Running it in the scripter it works.

Code: Select all

loops=50;
segment=0.1;
factorX=0.2;
factorY=0.5;
	for (t = 0; t < Const.PI2 * loops; t += segment)
	{
		x = t * math.cos(t);
		y = t * math.sin(t);
		x=x*factorX;
		y=y*factorY;
		print("x "+x + "\ty "+y); //this gets outputted to the Log file. Access with a button push on button labeled "Log"
		Engine.RapidTo(x,y,0,0); //actual movement in x,y,z,a
		yield(); //give it an out to look whats going on elsewhere.
	};
In any of the two script window cases I do not see the script LED lite.

Thanks for your help in advance
Glenn
Attachments
Scriptissue.PNG
Last edited by Anonymous on Wed Dec 23, 2015 4:17 am, edited 1 time in total.
Ya-Nvr-No
Old Timer
Posts: 188
Joined: Wed Sep 08, 2010 11:15 am

Re: Script running issue

Post by Ya-Nvr-No »

the spiral motion function has to go in the mainscreen script area to test and debug.
has all the capabilities of running debugging and single stepping though the code.
use on the reduced screen on the left "script window" clicking on the line and hitting run will call the script (make sure you ran (buttons at top) and re-registered the mainscreen scripts)

the function has to be declared as a global function so the script call can find it.
if you pasted like I provided it should work fine. (as all functions have to be declared and then ended with a "};")

quick tip to get to and out of the scripter is "Ctrl Alt S"

there is a series of buttons at the top:
you have to "toggle on" then "check out script" mainscreen then hit checkout make sure you run the whole script and re-register&nbsp; it.
You can place a "debug();" in the function and it will stop and let you step thru it. you can call the function from within the main screen. When your getting the output you desire you close the scripter and your good to go. Bottom of the scripter you will see the print output statement or they go to the log too. There will be all kinds of locations you will put code, example is under a button.&nbsp;

Art will create many more videos on how to do all this, so don't get too frustrated. I was attempting to show what could be done and might have gotten a little ahead of Art, or you were not following my vague screens. Sorry, good to see your attempting scripting.

In the next release Art has insured me that he wont forget the documentation on monkey scripting. As it is a great resource. At the bottom of the scripter you will find common and global functions that are available and when you create a function it gets added to the list. Its taken me months to grasp all this and we went down some bad roads.&nbsp; ::) but we learned what worked and what did not.

Art, "the Sockless Hermit is a Genius"&nbsp; ;) I'm the guy with the boot in his ___
Not really, we've had a lot of fun with this project
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: Script running issue

Post by GlennD »

Thank you for the response.
No worries on the frustration. :)
You don't do Alpha release code and expect 100%, well maybe from Art you can but most everyone else you can't. &nbsp;;D
I have the global script in the main panel.
That was very straight forward with Art's prompts.
I can run that script inside scripter and it puts the values in the log file.

I just can not get anything to run from the main screen script window.

even a simple

Code: Select all

print("Hi There"); 
doesn't output to the log file from the script "window".
In the script &nbsp;window &nbsp;it never yellow highlights the line that is listed in the execute Line box, like it does the MDI windows.
I can add more lines in and it never changes the Execute line value like it does in the Multiline-MDI window.

I can have the Diags screen active and select run and I only get the "Hold on Linear Script" light to flash.

At this point I am thinking some hook to the script window is not set correctly.

The Ctrl Alt S will take me into the scripter but not out, interesting.
Sitting here seeing what else I can find to play with.

Glenn
P.S. I am enjoying this by the way.
Attachments
Scriptissue2.PNG
Ya-Nvr-No
Old Timer
Posts: 188
Joined: Wed Sep 08, 2010 11:15 am

Re: Script running issue

Post by Ya-Nvr-No »

could be a version issue as it works for me in script and multiline (notice you have to add {} to multiline the activate scripting capabilities)
make sure your cursor is on the line before hitting run, it should flash yellow

Happy to see your enjoying the new challenge.

Attachments
needbrackets.JPG
doesforme.JPG
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: Script running issue

Post by GlennD »

Thank you again.
Adding {} around the Spiral() for the MultiLines lets it run from that window.
Still nothing in the script window though.
Glenn
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script running issue

Post by ArtF »

lol, you guys are getting ahead of me, how does that happen..

Glen: Theres probably mutiple bugs as I swap versions around, Im doing a video next on screen design, then Ill start a long series on the scripting which will be morphing to a dual scripting system, one system for screen control , and one for motion. Scripts should work in the
scripter, BUT, I secretly updated the download yesterday with a fix for that. ( At least Im pretty sure I did. :), a lot of versions flow by me.

&nbsp; So you might try a download, the downloads will now start to be properly versioned and Ill let you know whats fixed. I do remember the
scripting failing though due to a new command structure for it. Ill update tonight if you still cant run scripts fromt he script MDI screen.

I must say, your progress is astounding to me, your much deeper than anyone should be after a day .... well done..I figured we'd confudle everyone till I had a dozen or more video's out..

Art
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: Script running issue

Post by GlennD »

I have a background in CAD CAM automation as well as machinery design, so I have a little bit to go off of.
Besides this is great work, as it is pretty straight forward to follow.

Just downloaded the latest from the downloads section and no luck.
But I am fine with the multiline window running it.
The screen design video will be great as I do intend to make the tabbed box code work and it will require a window for the selections.

Thanks
Glenn
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script running issue

Post by ArtF »

Hi Glen:

&nbsp; New version was just uploaded. It will run the script MDI, I had turned off command objects in that window. Scripts that run in MDI have an
associated command object, by which they request motion, scripts generally in the debugger, do not, they still ask , so its like a simulation..
at least until I add a command like Engine.AddComBlock() for those scripts that need it.

&nbsp;

Art
GlennD
Old Timer
Posts: 80
Joined: Tue Oct 18, 2011 4:19 pm

Re: Script running issue

Post by GlennD »

Art
It is working now.
Thought I would mention, I was running my CAM software while running Auggie.
WIN 7 was reporting 103 processes.
The CAM program was processing a STL of a BAS relief and the motors never missed a beat behind me.
I did not hear a sound difference the whole time it was processing the STL.
That is seriously amazing.

Glenn
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4591
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: Script running issue

Post by ArtF »

Glen:

Thanks for that report, Ive been spending inordinate amounts of time in analysis and testing
for speed, all that is seriously nice to hear. :)

Art
Post Reply

Who is online

Users browsing this forum: No registered users and 58 guests