reading Pokeys pins

C Scripting questions and answers
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4648
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

Thx, Ill see if I can reproduce..

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Sorry again seems like that's all I say to you ???

anyway I think the major problem was running the debug version...
I think I said when I first started with the debug ver that when booted in simulator mode that a script was stuck running and the script blue led keep flashing
when I hit Stop the script would stop but I would get the message scrip stopped with errors check log.. I am going to assume that script was messing things up.

So I went back to the last version of auggie no DEBUG, now it seems to be running Ok...

The only problem I seem to be having is if I use RapidTo or FeedTo the system seems to loose it position's
If I boot and the machine and work DRO's are set to 0.0 I run the script with Rapid or FeedTo and then Rapid or FeedTo back to 0.0 the machine cord's and work cord's change the machine may now be at .029 and the work at 0.029 and the more I run it the more they change and I always zeroed out the axis's before running again..
Also I start getting weird values when I read GetAxisPos the first run it shows 0.0 now when I run it again I get unreadable values looks like 0.e0100 not exactly like that but you get the picture..

Now if I replace the Rapid and FeedTo with Engine.GCode(gcode); it seems to run A lot better I don't seem to get weird numbers back from GetAxisPos when I zero out the axis's before I rerun the script it seems to always show 0.

So not sure if it's me but this is my results..

Also is there a way to run FreeAxis With Engine.Gcode(); or similar?  so far the only way I seem to be able to move the FreeAxis's is with the FreeFeed or FreeRapid.

Thanks gary
User avatar
Mooselake
Old Timer
Posts: 531
Joined: Sun Dec 26, 2010 12:21 pm
Location: Mooselake Manor

Re: reading Pokeys pins

Post by Mooselake »

gburk wrote: The only problem I seem to be having is if I use RapidTo or FeedTo the system seems to loose it position's
Any chance that's because your acceleration settings are too high?

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Ill check the Rapid and Feedto to see why their different than Gcode..
and Ill re-release with release version, now that we've tested the debug.

  The reason you see that script is that one exists in the standard saved screen.
One of the panels calls a script that fails and then ignores it. I havent been
able to update the panel yet in the release, so if you enter in debug it logs it,
otherwise it doesn't. Its from an old panel and Ill see if I can update that
file in next release, Ill try for one this weekend. 

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

  I found the crash was due to no tool number being set, it was defaulting to tool #-1267 for some reason.. who knew.. I made it default to zero. No more crash.

  I cant find any real difference between rapidTo and Gcode calls for a rapid, but if it
works better Id stick to GCode. Unfortunatly in the case of the freeaxis, there is no gcode
interpreter assigned, just a planner which is fed by freeFeed and Freerapid.

New version is online to fix the crash and it may also explain weird numbers in
some circumstances..

Art


Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Thanks will try it out and let you know how it go's

Gary
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Defiantly Seems a lot better I went back and tried RapidTo and don't seem to be losing place between the mach dro's and the work dro's
Only time it seems to mess up if you hit Estop then the mach dro's stop there and if you zero out the work dro's, then I hit tool1 button and the mach x dro is sitting at 2.0 and the tool1 button is script is set to send the x to 2.0 it doesn't move and the x work dro is sent to 0...

I don't see a command to set the machine cord dro's to a position.. only to get the truepos .

also if for some reason you hit the EStop say after the x y z have moved and its moving axis 6 and 7 everything stops as should be..
But if I hit EStop again the code doesn't run the 6 and 7 axis were Estop was hit but does continue running the script from the next line I have a rapidto there to return to the original position.. I would think you would have to hit RUN also in case you need to jog out of the way, kind of catches you by surprise Hit EStop and starts running right away, maybe hit EStop and should kill the script so you could start over... not sure how you have it setup.. or if i'm looking at the logic wrong.. most of the time I am..

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

Re: reading Pokeys pins

Post by ArtF »

HI Gary:

  No , you have it right. There are very few safeties in the FreeAxis, it was a second planner
I tacked on because I could for running other motors or frequency channels.
  The only way to set machine coords is in a homed axis, same as Mach3,
Only homing will change the machine coordinates. Various offsets are available
in the normal axis, I'm not even sure if they apply to freeaxis. Im a bit rusty
on some of the specifics of those interactions as I never use them with lasers.

  Glad its working better anyway.. that tooloffset default could have been a
problem in many things.

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Yes it does seem to be running better even with the rapidto, also I don't seem to be having the rewind on the first m6 call, I did end up removing the Enabling the RUN call so after the tool change dialog I just hit RUN and it seems to continue ok...

Now do you think it will matter much if I do a RapidTo() 2.0 and it stops at 1.994 it seems to do this on a regular basis but if I rapidto() back to 0.0 right after that it does stop right at 0...

checked the same code with Engine.GCode and it didn't stop at 2 either stopped at 1.994..

Thanks gary

Last edited by gburk on Fri Jul 05, 2019 2:17 pm, edited 1 time in total.
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Came across another problem maybe me don't know its a strange one and tried many time to get past it with no go..

So I have the tools buttons tool1 thought tool16

So I copied and pasted the code from tool1 to each tool function one at a time and compiling them as I do each one
Now I pasted the code to tool4 and I get compile errors..
I cut the code from tool4 and it compiles again no errors, so now I start pasting code into tool4 one line at a time and compiling it, so when I pasted about 10 lines and compile no I get the compile script error again I remove the last line and it compiles again.
So I typed a Rem line //testing error and compile it again and get compile error.

No matter what I type on the last line I get compile error...

So one though was the scripts may be limited to how many lines can be compiled...

Any thought on this I know its a strange one.

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

There may be a limit to a scripts size based on the language interface. I havent hit
one yet and Auggie deals with all Scripts as single CStrings() , which have a defined
limit of over 2 billion characters. However, monkey script itself may have some internal
limitation I am not aware of.
  Any idea of the number of characters you have when it fails? Is this failing in the Script
window on a run, or when checked back into the libraries?

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

It was failing when I added the code line the hitting RUN...

So of course it was bugging me all night, so first thing this morning I decided to delete the script file..
I then entered one tool change function at a time, it has a little less code per function now, and all 16 tool functions are working,,
don't know what will happen as I add more code to each function but will find out later...

anyway it does seem to be working now, i'm thing maybe some sort of a glitch somewhere in the code not one I was able to see
spent a lot of time on till I decided to delete old file and start again

You didn't mention if you thought that I would be alright running with the dos's not running to the values I entered 2 seems to stop at 1.994 does it with all the axis's
but if I enter for it to return to 0.0 it doe's ok

Gary
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

It was working then I went to add or modify the code, if I check back in the lib I see no errors in the lib, but if I edit the lib and do a RUN I get compile erorrs

If I hit the tool1 button it runs OK except the machine and work cord seem messed up now if I set the dro's to 0 and them run the script, I added a print to show the start x y z axis positions i am getting them with GetAxisPos(1 2 and 3) I don't get a 0 value I will get what seems random values one time I will get 0.033 but I don't get 0 even though the DRO's are set to 0

My thought is because I am getting the compile errors problem is I don't see anything wrong, only seems to happen after adding or editing the script, but once it starts I have to redo the entire script..

Do you think I should break up the tool chance script into 3 or 4 separate scripts, there is 16 functions in the script. I haven't tried that yet maybe next thing to try.

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Breaking it up will probably get it to run. I will check into the GetAxisPos
to see what the error may be. Ill see if I can figure out why the limitation as well,
though I may not be able to do much on that score..depends on its cause.

Art
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Update
I deleted the entire script and folder..
Started from scratch..
Now tool1 seems to be working getting the correct Positions values the only thing I see is I do a Gcode  or Rapid move on x y z then I do FreeTo
when it does the free move I get the message buffer underrun.. still seems to jog to the correct value though. and now returns to 0..
Still stops a little short of the distance entered seem to be the same every time

if I enter 2.0 axis go's to 1.9994 same for all axis's off just a tad..

I think a lot of the problems are from the scripts getting corrupted don't know why, have typed in some code into notepad++  and copy and pasted into auggie
just a thought..

I have had to redo the tool button scripts from scratch 3 or four times now confused as to why, I did split the tool change into two lib scripts one with tool 1-8 and the other with toll 9-16 will see how that go's..

The getaxispos is ok I think when the script gets corrupted it for some reason messes that up also..

Thanks gary
Last edited by gburk on Mon Jul 08, 2019 11:02 am, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest