GearHeads Corner
April 22, 2019, 04:59:15 PM *
Welcome, Guest. Please login or register.

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


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: 5214



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
Jr. Member
**
Posts: 85


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: 5214



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
Jr. Member
**
Posts: 85


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: 5214



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
Jr. Member
**
Posts: 85


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: 5214



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
Jr. Member
**
Posts: 85


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
Jr. Member
**
Posts: 85


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
Pages: 1 ... 9 10 [11]
  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!