GearHeads Corner
July 23, 2019, 09:12:37 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 ... 9 10 [11] 12 13 ... 22
  Print  
Author Topic: reading Pokeys pins  (Read 5808 times)
0 Members and 1 Guest are viewing this topic.
gburk
Full Member
***
Posts: 167


View Profile
« Reply #150 on: April 13, 2019, 04:04:20 PM »

Art

Tried the errordial og as not global I think your right its closing now and I don't get the 2 oks and cancel buttons showing up on a second call to errordial og.
But the problem with the m6 call still there I have to hit estop to rerun the m code. the stop or rewind don't react till the estop is reset...

What is the command to read the ok and cancel buttons to see which one was pressed?

Curious What program you using for cam?

Gary
« Last Edit: April 13, 2019, 06:40:12 PM by gburk » Logged
ArtF
Administrator
Hero Member
*****
Posts: 5322



View Profile
« Reply #151 on: April 13, 2019, 08:05:48 PM »

Hi Gary:

>>Curious What program you using for cam?

  I usually use Vectric for my mill, I use Vexx for Gcode for my laser generally, but I sometimes just code up a routine to give me what I want on a one off basis.

>>But the problem with the m6 call still there I have to hit estop to rerun them code. the stop or rewind don't react till the estop is reset...

   It seems to me the basic macro for m6 does a pause after its call, it requires one to press run again to start the program after the toolchang e. Perhaps there some interplay there.

>>What is the command to read the ok and cancel buttons to see which one was pressed?

  There is none. All dialogs are based on scripts for any object or button you place. The system buttons of OK or Cancel are typically handled by the return value.
  Ill have to check , but usually the return from a DoModal is checked to see if
its a 1 or zero. If 1, it was OK, if 0 it was cancel. There is no real feedback in
a do Modeless, and cancel or OK is usually enough, you dont need both as each do
basically the same thing..

Art





Logged
gburk
Full Member
***
Posts: 167


View Profile
« Reply #152 on: April 13, 2019, 09:12:07 PM »

Art

>> It seems to me the basic macro for m6 does a pause after its call, it requires one to press run again to start the program after the toolchang e. Perhaps there some interplay there.

I think you may be right, there is a delay before my dialog loads seems like a few sec's maybe less haven't timed it, but seems to continue without the keypress I will check further .

I have another strange problem, only seems to happen in the probing lib, if I try to use a global table I have created in another lib, I get a compile error
I have a global Zreturn = table(-1,-2,-3,-4,-5,0,0); I can do most anything with the table in other library's but not the probing
if I just do a myreturn = Zreturn; I will get a compile error.. I can't see any reason for it the probe script runs fine and compiles till I try any call to one of my global tables.

Thanks gary
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5322



View Profile
« Reply #153 on: April 14, 2019, 07:07:01 AM »

Gary:

>>Zreturn = table(-1,-2,-3,-4,-5,0,0); I can do most anything with the table in other library's but not the probing if I just do a myreturn = Zreturn;

  Is the myreturn variable declared previousl y as anything other than a table?
I dont use tables generally, so I'm not much of an expert on how monkey-script
handles them.  If the compilati on fails on that line, I would think its
having trouble convertin g the table to Zreturn because it sees them as
incompati ble for some reason. If Zreturn hasnt been seen, then it will
auto convert to a table variable. 
  As Auggie resets it first loads the libraries and executes them all in order
to set global variables as global. The second time through it can then use
those variables for compilati on of the various scripts. If the checkmark s in the
library are on, and none of them have changed to X's, then the library is
signallin g its satisfies that everythin g looks good. Whenever you check in a library
make sure it shows up with a checkmark on it, not an X.. (just a note..)

  So Im not sure why you'd get a compilati on error just on that one usage
of the variable.

  As to the pause in the M6, if you check the toolchang e script in the system
library you may find a Stop call or some sort of wait that is making it pause till
run is pressed again. I seem to remember doing that so I could always just
press run again after a tool change. I believe M6 is one of those controls
that is scripted in system lib to perform the way I like, but it may not match
what you may want to do.. Perhaps the two are conflicti ng?

Art

 
Logged
gburk
Full Member
***
Posts: 167


View Profile
« Reply #154 on: April 14, 2019, 08:15:20 AM »

 >>Is the myreturn variable declared previousl y as anything other than a table?

No not declared more that once, the strange thing I can use it  any other lib
Even if I try to create a new variable table say with any random name in the probe lib it gives a compile error and soon as I run it..
I want to be able to return 2 values from a probing function and I though you said a table was the only way,

Zreturn does create in a different lib but still can't use in the probe lib even a whattable = Zreturn[0]; would error
 
>>make sure it shows up with a checkmark on it, not an X.. (just a note..)
funny thing is No X's

>>So Im not sure why you'd get a compilati on error just on that one usage
>>of the variable.

global ProbeRetu rn = table(0,0,0,0);
Ok exact error is script fails compilati on
check back in and No X's for any lib's, bring back to in to edit global table still there try running again and get same error
Endless its reporting a false error

>>  As to the pause in the M6, if you check the toolchang e script in the system
>>library you may find a Stop call or some sort of wait that is making it pause till
>>run is pressed again. I seem to remember doing that so I could always just
>>press run again after a tool change. I believe M6 is one of those controls
>>that is scripted in system lib to perform the way I like, but it may not match
>>what you may want to do.. Perhaps the two are conflicti ng?

I changed most of the M6 function commands but off the top of my head there may still be a Stop Engine in there I will look...

I did remove the call to my dialog from the m6 and it seemed to run fine, stop and rewind were ok didn't have to estop
So looks like its something to do with the dialog getting something in auggie stuck or messed up but I can't see where
all the dialogs close just can't rewind or run again till estop hit.

Gary

Thanks gary
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5322



View Profile
« Reply #155 on: April 14, 2019, 10:02:04 AM »

Gary:

>>I want to be able to return 2 values from a probing function and I though you said a table was the only way,

  Well, there are other ways. You can just use two global values at the top of the script so
any function can set them. Its why I dont use tables, Im lazy and tend to just use
Global variables . I tend to use the script editor itself when developin g anythign complex, it has better erros and debugging so you can see in realtime what the problem is with compilati on and fix it. Using the script tab you dont get as much debug info on whats
going on.

    My use of dialogs has been restricte d to ones showing videos or asking for an entry so
Im not sure of all the interacti ons with the system , your touring unknown country
for the most part.   The script editor may help in identifyi ng whats wrong with the
compilati on at least..

Art
Logged
gburk
Full Member
***
Posts: 167


View Profile
« Reply #156 on: April 14, 2019, 11:58:15 AM »

Art

I removed     //Engine.StopProgram(); line to test that didn't make a differenc e still no stop rewind.

Maybe you have another way to stop and wait for input and get input...

I don't see any other way to do the manual tool change and then do a touch off with the new tool and then reset the Z position. . to the new tool Hight..

I will try to run it though the script editor debugger and see what I find

if you are retuning 2 global variables i'm not sure how, as far as I can tell the return statement will only return 1 value return x,y; doesn't seem to work..
if it's a global table I can return all the values.

Just a quick update I am going to assume its the script edit run , somehow seems that's the problem, I put the line global TestRetur n = ProbeRetu rn; at the beginning of the probe library and a print(TestRetur n[1]);,  ProbeRetu rn has been declared as a table in another library I get compilati on error from the script edit when I hit run.
Now if I run the same code in the scripter debugger I get no compilati on errors and the correct value printed -2 form TestRetur n[1]
So This one I have no idea, I leave this one for you.
   
Getting strange behavior when trying to run  some Gcode when I load the gcode I get no errors, when I run it I cutter comp errors and compile errors, the code runs at the to and  after first t4 m6, it stops, and I hit run it runs, but the second tool change it stops and I get the dialog continuin g job stopped at it shows the work and mach coordinat es and  what line to continue from I can enter any line number and then it seems to be running but gcode never continues past the tool change line...
Now if I stop all and rewind it seems that the Z axis gets lost if I click on the Z axis DRO to change to number 1.0 it changes to 0.0 if I change it to 2.0 it changes to 1.0
and so on... most of the time its 1 off the value I enter but only after running the gcode file..

I assuming auggie doesn't like g40 g41 ?


Gary
« Last Edit: April 14, 2019, 06:19:41 PM by gburk » Logged
ArtF
Administrator
Hero Member
*****
Posts: 5322



View Profile
« Reply #157 on: April 14, 2019, 09:15:36 PM »

Hi Gary:

>>I removed     //Engine.StopProgram(); line to test that didn't make a differenc e still no stop rewind.
>> Maybe you have another way to stop and wait for input and get input...
>>I don't see any other way to do the manual tool change and then do a touch off with the new tool and then reset >>the Z position. . to the new tool Hight..
>>I will try to run it though the script editor debugger and see what I find

    No, I think the script dialog for input should work. IF the scripter doesnt help, zip up all
your script library and Ill see if I can simulate it here.

>>if you are retuning 2 global variables i'm not sure how, as far as I can tell the return statement will only return 1 >>value return x,y; doesn't seem to work..
>>if it's a global table I can return all the values.

  You dont need to return globals, you just set them..

global MyProbeX = 0;
global MyProbeY = 0;

global MyProbe function()
{
...
...
  MyProbeY = 10;
  MyProbeX =  5;
}

global SomeOther Function = function()
{
   if( MyProbeX == 10) ....
}

  Any other script will now see the two variables as 10 and 5, nothing has to be returned. Thats
why I tended to use them as it was easier to simply declare a bunch of globals and not worry about returns.

>>Just a quick update I am going to assume its the script edit run , somehow seems that's the problem, I put the line global TestRetur n = ProbeRetu rn; at the beginning of the probe library and a print(TestRetur n[1]);,  ProbeRetu rn has been declared as a table in another library I get compilati on error from the script edit when I hit run.
Now if I run the same code in the scripter debugger I get no compilati on errors and the correct value printed -2 form TestRetur n[1] .So This one I have no idea, I leave this one for you.

 Hmm , sounds like the script using ProbeRetu rn is being installed before the one that declares it. Ill have to do some checking to see how that can happen, the system loads twice to catch such things. IT might be best to simply send me your libraries and see if I can make them run. Might show me why its off..
   
>>Getting strange behavior when trying to run  some Gcode when I load the gcode I get no errors, when I run it I cutter comp errors and compile errors g40 g41 ?

  Its part of Auggies spec that it doesnt do cutter comp. G40,41 will cause errors and failures. It's whole design was
to try to eliminate the things most cnc hobbiests dont use and add things that others couldnt do. Cutter comp
is large enough a ball of worms it was left  out purposely .

Art
Logged
gburk
Full Member
***
Posts: 167


View Profile
« Reply #158 on: April 15, 2019, 09:37:02 AM »

Art

I can't even declare the  global MyProbeX = 0 at the start of the probing lib I get the same error as the table, I will try it in a different lib and see if I can change it in the probe function. ..

I changed the post processor not to use g40 41 42 and 43...

but I get strange errors the gcode loads ok and look right in the display, but I will get an error script fails compilati on same message will display 4 or 5 time
log shows
27:46:292  Script fails compilati on.
27:46:292  See log for errors.
27:46:308  error (1) parse error, expecting `';''

it doesn't happen with all gcode files...
also still seems to get stuck on the second t4 m6 call seems like every thing gets lost there and if I hit run it will jog and when finished jogging then jogs back and stops for a tool change again its back on the same line, will not continue past the second m6 line..

I setup a global var in another lib it compiles ok
now I put this in the Zprobe function  and get the compilati on error still
ZprobeRet urnPos = GlobalGet("ProbePos2");
almost seems like I cant call any global var form that function. .

Update may have fixed using global in the probing lib, haven't seen this one yet but first time for everythin g  it may have been a bad keyboard noticed some strange things happening when hitting keys swapped out the key board and now I can add global's to the probe lib...

thanks gary
« Last Edit: April 16, 2019, 05:01:39 PM by gburk » Logged
gburk
Full Member
***
Posts: 167


View Profile
« Reply #159 on: April 20, 2019, 05:01:11 PM »

Code:
Hi art

Have a macro question I assume auggie doesn't use g83 peck drilling....

so I created a macro G888 to do peck drilling it works but when I am done and exit the G888 function the go code stops and doesn't continue to next line
I put a Engine.StopProgram and it will return to the next line in the g code but it sits and waits for the run to be pressed is there a way around that..

Also is there a way to stop the dialog that pops up at tool changes and seem to popup at other times I hit the run.. it must be built into auggie it show the work and mach cords and ask line # to run from..

Here is the code

[codeglobal DrillPeck = function(x,y,z,s,r,d)
{
  for( pecking = 0; pecking <= d; pecking+=s)
  {
   print("Peck Drilling X "+x+" Y "+y+" Z "+z+ " R "+r+" S "+s+" D "+d+" Pecking = "+pecking);
   Engine.GCode("G90 G01 Z-"+pecking);
   block("MotionStill");
   Engine.GCode("G91 G01 Z"+r);
   block("MotionStill");
  };
  yield();
 Engine.StopProgram();
};
 
global GCode888 = function()
{
   print( "GCode peck drill is being executed. ");
   print( "The following paameters were on the line.");
   print( "-999999 means the parameter was not used.");
   print("X:" + ParmsXYZ[0] + " Y:" + ParmsXYZ[1] + " Z:"+ ParmsXYZ[2]);
   print("AQL is :" + ParmsAQL);
   print("PRI is :" + ParmsPRI); //P Step distance // R Retract Hight
   print("JKD is :" + ParmsJKD);
   print("UVW is :" + ParmsUVW[0] + ", " + ParmsUVW[1] + ", " + ParmsUVW[2]);
   print("H is :" + ParmsH[0]);  //H max Z distance down
  DrillPeck(ParmsXYZ[0],ParmsXYZ[1],ParmsXYZ[2],ParmsPRI[0],ParmsPRI[1],ParmsH[0]);
};

And in the gcode call like this

T7 M6
( Drill1 )
G17
M8
M3
G888 X-0.4456Y-0.5138Z0.4456P0.03R0.250H.125 (P = peck distance R = Retract Distance H = Distance to Drill)
G888 X0.4384Y-0.5138Z0.4456P0.03R0.250H.125
F10.0
M9
( Drill2 )
G0 Z0.125
( T6 : 0.25 )
T6 M6
M8
M3
G888 X0.4384Y-0.5138Z0.4456P0.03R0.250H1.0
G888 X-0.4456Y-0.5138Z0.4456P0.03R0.250H1.0
M9]


Also is there a way to have auggie invert the estop so pokeys config doesn't have to be run switches get changed from no or nc,
and also with the probe if the probe pin 19 get inverted to also change the GlobalSet("ProbeInve rt",0); so now ProbeInve rt 0 would be inverted so if using probe that n/closed and then switch to a touch plate that may be n/open you wouldn't have to go into the script every time and change ProbeInve rt 0 to 1 or 1 to 0..
make any sense sometimes my expiation s are a little cloudy, maybe all the time..

Thanks gary 
Logged
gburk
Full Member
***
Posts: 167


View Profile
« Reply #160 on: April 25, 2019, 10:57:23 AM »

Hi Art

I modified the post processor in sheetcam and that seems to be working ok in auggie the only time I seem have trouble is during a tool change m6 call and I think it has something to do with the dialog that auggie displays and it looks like it has saved  x y z positions not current positions and when you hit ok to continue it is jogging to those positions sometimes the z would be to low so on the next move the tool could break off..

But it looks like I don't need the peck drill script with sheetcam , I will need it with cambamů

Thanks gary
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5322



View Profile
« Reply #161 on: April 28, 2019, 07:25:23 AM »

Hi Gary:

 Sorry for the delay, my developme nt computer blew its OS drive this week. Ive just now
come back up to snuff..

 Ill take these one at a time..

>>27:46:292  Script fails compilati on.
>>27:46:292  See log for errors.
>>27:46:308  error (1) parse error, expecting `';''
>>it doesn't happen with all gcode files...

   This does sound like a script error in syntax somewhere . Id advise trying single line Gcodes
until you knbow what causes it. If the M6 causes it for example, look to all scripts called
by M6 and call them in the script window till we know which one exactly is missing the ";"
 

>>I setup a global var in another lib it compiles ok
>>now I put this in the Zprobe function  and get the compilati on error still
>>ZprobeRet urnPos = GlobalGet("ProbePos2");
>>almost seems like I cant call any global var from that function. .

  and ZprobeRet urnPos  is defined as a global in an earlier file? Ill do some checking on the order
of execution .. But finding the ";" syntax may solve it, if the syntax error is found in the file, it may
have stopped the global from being defined. A syntax error is a non recoverab le fault for that file.
This may be a clue the bad script is in the same file as the global?
 

Art
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5322



View Profile
« Reply #162 on: April 28, 2019, 07:42:10 AM »

Gary:

>>Also is there a way to stop the dialog that pops up at tool changes and seem to popup at other times I hit the run..

  That would be the "continue" dialog. It doesnt pop up unless it senses the current position
is not properly registere d as a start position. Let me check to see why it pops up on you,
I never see it unless I stop a program and tell it to restart. I think the M0 may be stopping
the program without regard to continuin g, it may instead need an M1 which  should tell
it to stop temporari ly ( pause) till its told to run. Running from stop will open
a continue dialog as its not sure where your starting from.

>>Also is there a way to have auggie invert the estop so pokeys config doesn't have to be run switches get changed from no or nc,

   The polarity of the Estop switches are set by the Pokeys. I use whatever it is set to. If the pokeys software is expecting a no, thats what Auggie uses. If its mismatche d with Mach3, I suspect Mach3
must override the settings of the Pokeys engine, or the engine setting is ignored in Mach3. To fix this
you should only have to open the Pokeys software, chck the setting of "Invert Estop" on that page so
that the estop works and resets properly. At that point Auggie should see the same thing.


>>and also with the probe if the probe pin 19 get inverted to also change the
 GlobalSet("ProbeInve rt",0); so now ProbeInve rt 0 would be inverted so if using probe that n/closed and then switch to a touch plate that may be n/open you wouldn't have to go into the script every time and change ProbeInve rt 0 to 1 or 1 to 0..make any sense sometimes my expiation s are a little cloudy, maybe all the time..

  In Auggie, you set the probe to whether its normally Open or closed with the planner setting of "ProbeInve rt", this isnt the same as the script setting. The planner setting in the config basically
tells Auggie if you want "normal" out of the box behaviour to be be a contact of normally open
or normally closed.

  The Script Call to GlobalSet("ProbeInve rt",true) is a different setting, it means to now
use the opposite of the planner setting. In other words you use it to temporari ly swap
the pins so that you can probe off a plate instead of probing to it. After that move youd
then tell it GlobalSet("ProbeInve rt",false) to set it back to "normal" which is whatever the
config planner setting is. So setting the planners config of "ProbeInve rt" is the way to
set the normal condition . The last script call setting is forgotten upon restart.

  Ill check the code this week to find out how to properly pause a program instead instead
 of stopping it. I think the continue dialog occurs if the postion at last stop changed
prior to hitting run, but Ill check to be sure.

Art



Logged
ArtF
Administrator
Hero Member
*****
Posts: 5322



View Profile
« Reply #163 on: April 28, 2019, 11:03:38 AM »

Gary:

  In looking into why the "Continue" dialog opens after your scripts I figured Id explain how it work.

When you press run there are quite a few different things that will happen depending on context. IF the Tab window is on scripts for example it runs the script, if on MDI, it runs depending on the tab as to if its
single line or multiple line MDI . In Gcode though, it does a few checks. If your last end point is the same as the current start point, then it wont open the "continue" window. If it senses though, that you are in
a different coordinat e that when you last ended a move, it will bring up the "continue" dialog to ensure
a smooth motion to the start of the move. This is in case you have jogged or something .

  This is why in a default M6 call, the tool changes, the system waits for a run to be pressed in
order to start up on the next gcode line when RUN is pressed, and when you press RUN, the
dialog doesnt open, it just runs.

  In your case, your moving the coordinte s , so the system thinks your starting from a new
location. Try adding a Gcode("g1...") call to your new coordinat es (( in essense a non move)
which will set the system so it thinks the last end was your new coordinat es. When you next press
run the dialog shouldnt open.

  I will add a command I think to disable the "continue dialog", or find soem way to properly
sync the last move so you wont have it open. I call to the planners sync() routine would stop
it from happening so it may be I only need to add a Sync Command after coordinat es
have been changed. 

Thx
Art
Logged
gburk
Full Member
***
Posts: 167


View Profile
« Reply #164 on: April 28, 2019, 01:41:32 PM »

Hi Art

Glad to here you are up and running again...

I will try one thing at a time I think I keep getting ahead of my self OCD!

As for the Continue dialog it only pops up during a M6 Tool change, and right now I have removed any scripts I was working on for M6 calls and I am using only the ones you had in the scripts.. maybe be easier to trace down..

hers an example of what continue dialog displays on the very first M6
Mach cord X -0.4450 Y -0.6963 Z -0.3312 A 0.0000
Work cord X 0.0000 Y 0.0000 Z 0.0000 A 0.0000

auggies DRO's show X = 0.0000 Y = 0.0000 Z = 0.5000

I sent the Z axis to .5 before the M6....

As far as what's script is causing the ; error I don't know here is a clip from the error file. it error as soon as the g code is loaded seems like its in the screen regen
The image looks correct on the screen not messed up, looks like the correct tool path I guess is what I meant to say..

 15:56:507  --System -- User has Regened the toolpath. 
15:56:585  Script fails compilati on.
15:56:585  See log for errors.
15:56:600  error (3) parse error
15:56:600  error (3) parse error
15:56:600   Script OnRegen() Called
15:56:600  error (1) parse error, expecting `';''
15:56:600  Script fails compilati on.
15:56:616  See log for errors.
15:56:632  error (1) parse error, expecting `';''
15:56:632  Script fails compilati on.
15:56:632  See log for errors.
15:56:647  error (1) parse error, expecting `';''
15:56:647  Script fails compilati on.
15:56:663  See log for errors.
15:56:679  error (1) parse error, expecting `';''
15:56:741  Script fails compilati on.
15:56:741  See log for errors.
15:56:757  error (1) parse error, expecting `';''
15:56:772  Script fails compilati on.
15:56:772  See log for errors.
15:56:804  error (1) parse error, expecting `';''
15:56:819  Script fails compilati on.
15:56:819  See log for errors.
15:56:835  error (1) parse error, expecting `';''
15:56:866  Script fails compilati on.
15:56:866  See log for errors.
15:56:897  error (1) parse error, expecting `';''
15:56:929  --System -- User has Regened the toolpath. 
15:56:929  GCode file loaded.
15:56:929  Processin g Paths

do you think not having a space between line number and g code could be a problem example
N220G00G4 3Z0.8000H 2
or space
N230 S2500M03

Thanks gary
« Last Edit: April 29, 2019, 09:51:25 AM by gburk » Logged
Pages: 1 ... 9 10 [11] 12 13 ... 22
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!