Page 14 of 59
Re: reading Pokeys pins
Posted: Sun Apr 07, 2019 11:53 pm
by gburk
Art
Tested out the buttons a bit, not having any luck, I have 16 buttons and it seems like auggie has named them all the same "ToolChanger_BUT_0" with or without a name var, I tried with a var name of tool1 to tool16 got the same results...
You said load the mpg as a screen don't see how to load the panel as a screen and I don't see a mpg panel or screen the only panel with mpg is the jogpanel..
also can auggie return 4 values from a function I seem to get compile errors when I am trying to return 4 values, like return x,y,z,a; ?
Thanks gary
Re: reading Pokeys pins
Posted: Mon Apr 08, 2019 1:11 am
by ArtF
Gary:
Ill check the buttons tomorrow to see why the numbers are sticking .. It is possible I didnt
include the MPG panel in the release, Ill check that too.
The buttons shouldnt have the same ID, I think you need to set each button to a different
ID number as you create them. Ill run a test and see.. You should be able to just enter an ID number instead of a variable name as you make the button.
You cannot return more than 1 item from a function unless the item is a table of values.
You can set multiple globals while in the script though....
Art
Re: reading Pokeys pins
Posted: Mon Apr 08, 2019 1:21 pm
by gburk
Hi Art
I figured that when you created a button and could give it an id name and id number there would be a way to retrieve either or both
This is what i had in mind but i am assumming the button id number can not be read.
Button.IDnumber is there just for example, Make any sense
All the button tool id names are Tool1 and idNumbers from 1 - 16
so all tool names are the same so doesn't matter what button that's pressed it will go to the same function but with its own id number the only one on the stack..
it could be read..
//Get button ID Number
global Tool1 = function( state )
{
Tool = Button.IDNumber("Tool1")
switch( Tool )
{
case 1:
{
//Too11
return;
}
case 2:
{
//Tool2
return;
}
case 3:
{
//Tool3
return;
}
};
};
just rambling on and on :-\
ok I will try it as a table I have had some trouble when setting global var they seem to want to change back to what its value when declared at originally I will also try that again,
Thanks gary
Re: reading Pokeys pins
Posted: Mon Apr 08, 2019 1:43 pm
by ArtF
Gary:
Unfortunatley the way the buttons are joined is simply a mechanism to ensure other buttons
in the group turn off so that one button is always exclusively on in the group.
You still need a script for each button as there is no way to tell which one was pressed other
than it calls its own script. Each script though could set a global to a set number, and then call
the same function as all the other buttons where it does a switch statement on that global.
I know it seems like a lot of scripts, but their really all the same with the minor change of what
the script sets the global to. Scripts dont take much memory so having lots of them doesnt really
run into troubles in my experience so far.
Globals will get set back if the scripting system resets. Doesnt usually happen during use, but
when editing and checking in scripts and such a global reset occurs and the scripting system
will reinitialize back to its original state with the declared variables.
Art
Re: reading Pokeys pins
Posted: Mon Apr 08, 2019 4:30 pm
by gburk
Yes I kind of figured that not a big problem... just running though my head,,
I did notice a funny thing with the dialog when I run the first dialog with the touch off button and let it run to the end I will get the error dialog close out the error box and hit the ztouch button again same thing let it run to error now the second time it displays the error dialog it has 2 of the ok buttons and 2 of the cancel buttons displayed.. Strange
I tried the return mytable; that seems to work fine...
The only problem with buttons is auggie only giving them all the same name all 16 are ToolChange_BUT_0
I am planning on connecting to mill tomorrow and see how the z probing works in real life..
But now I seem to have the problem again with having to run the probe script in the edit run first.. I thing I did say it seems to run all my print statements and are shown on screen in the probe script
but no motor movement till I run the script in the script run..
Also is doing the same thing in any of the button toolchange scripts.
and tried setting up FreeFeed to move 6 and 7 they move but dro's are not moving to entered feed to position and I always get a buffer over run or under run forget which one.
Thanks gary
Re: reading Pokeys pins
Posted: Tue Apr 09, 2019 1:14 am
by ArtF
Gary:
>>The only problem with buttons is auggie only giving them all the same name all 16 are ToolChang e_BUT_0
Did you set the ID numbers to numbers 1 - 16, the _0 shoudl be _1 , _2 etc is the id numbers are set...
Art
Re: reading Pokeys pins
Posted: Tue Apr 09, 2019 12:31 pm
by gburk
No I removed the id numbers and added the id names, that works I can call the button function with the id name and all have a different name..
but still have to run the script first before I hit a button almost seems if you don't run it in the script edit first the Engine.code isn't run it will show all the print statements in that script but no motor movement..
I am finding more g code errors seems to mostly be this type of code
on different lines.. also looks like its being displayed incorrectly on the screen slots and holes in wrong places..
would you like a copy of the complete g code file?.. to look at
Error--44, N2205 G2 Y-1.0185 I0.0000 J-0.0895
also here is the code I am getting buffer underrun
//Engine.FreeSetAxisType( 6, 0 );
//Engine.FreeSetAxisType( 7, 0 );
//Engine.FreeFeed( null, RackMovein, RackRotate, null);
//block("MotionStill");
can I use 8 dro's and run all 8 motors from the main dro's and home? or do I have to rub from freeaxis I only see home and zero 1-4?.
Thanks gary
Re: reading Pokeys pins
Posted: Wed Apr 10, 2019 12:59 am
by ArtF
Gary:
>>it will show all the print statement s in that script but no motor movement. .
Have you jogged and such before pressing the button? By that I mean do we know all motor motions are
working prior to the button being pressed? Im just trying to figure out why no motion is occuring, its
as if there is some condition stopping it from running the motions if the print statements are happening.
Error 44 is "Radius different from start and end in Arc" , this almost always means a mismatch
in incremental vs absolute arc settings. Does the code have a G90.1 in it for abs or G91.1 for incremental
in it? You may need to add it to your postprocessor depending on your arc generation. Post
your Gcode file and Ill check what errors I get.. or add G90.1 to the file and see if it, or G91.1 fixes those
G2/G3 errors.
>>also here is the code I am getting buffer underrun
//Engine.FreeSetAxisType( 6, 0 );
//Engine.FreeSetAxisType( 7, 0 );
//Engine.FreeFeed( null, RackMovei n, RackRotat e, null);
//block("MotionSti ll");
This one is my fault. I recently sped up Auggies engine by
slowing threads when the trajectory buffers were empty. I neglected
to look at the FreeTrajectories as well, so any free motion fails at the moment. I fixed
this as I found the reason and my system runs the above commands
fine. I will recompile a release for you tomorrow that fixes the free axis
planner. You can use FreeSetWorkPos(..) to set a zero on any free axis.
You can drive all 8 motors if you wish, BUT, the two planners,
one for axis 0-4 and the other for axis 5-8 are separate planners. They act
independantly so one has no idea what the other is doing. They are fine for
tool changers or conveyors and such but you cannot do synced motion
between the two. I think home will work with free axis if they are properly
set up to use home switches.
Art
Re: reading Pokeys pins
Posted: Wed Apr 10, 2019 2:15 am
by gburk
Art
Ok I only want to use the freeaxis's for hopefully later on if we can figure out how to set motor 5 for spindle, I plan on using 6 and 7 for the auto tool changer positions.
I did get it to move on motor 6 and 7 but like I said I have buffer underrun error's, and doesn't move to the correct entered distances..
and if I rapid the x y z and free rapid 6 and 7 they all move and after all axis's reach there final distance, then I will do a rapid to return to start position only with x y z but the 6 and 7 also move back with the x y z it seems like a random distance.. hopefully that's part of the problems you said should be fixed...
also I if I print out zeroing axis numbers when I zero Y it shows axis number 4 and when I zero A it show axis number 8, X and Z seem to be the correct numbers being sent to your script updating onzero ..
didn't get it hooked up to my mill today forgot I hadn't wired the estop switch yet, but got that working today, and auggie reads it, so if thing go array I can kill it now.
Thanks gary
Re: reading Pokeys pins
Posted: Wed Apr 10, 2019 12:05 pm
by ArtF
Gary:
You can mix the freeaxis, so using motor 8 for spindle as a frequency output
should be fine. Im sure we'll run into one bug or another along the way but
that part shouldnt be too bad.
SetFreeAxisPos() shoud be the one that can set their axis to zero. Ill run a test when I build the
release later today.
Art