reading Pokeys pins

C Scripting questions and answers
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Ok I made the changes to the code as per your suggestion, but doesn't seem to trigger the pin or at least see it being triggered, I don't get the printed message displayed from the code.

I did create a library folder called pokeys57 and added the script to that library also have it turned on and checked
you said maybe put it in the gcode library does it need to be there ?.

or could I be missing something else.

tested the pin in mach3 and mach4 today and both read the pin so I sending the signal correctly.

also some times when I boot auggie  it asks if I want to use pokeys config or auggies I have been choosing pokeys..

Im supprised no one has asked for probing but I guess auggie is mostly for laser and I mostly use the mill...
I have problems with pokeys and mach3 probing no matter what I change in the config the probe led flashes on and off looks like a false trigger constantly
if I invert the pin the led stays on but on flashing but mach3 thinks its triggered...
Mach4 seems to read it ok no flashing but I don't have mach4 on the mill's computer. 
and I like the scripting better in auggie not a fan of lua?

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

Re: reading Pokeys pins

Post by ArtF »

Gary

 
I talked to Mat, the pokeys firmware author and he tells me its a normal buffered waypoint move
that I set to a probeing state to make probeing work, Ill take a look at it. The pokeys stops motion
and switches to internal; planner waiting for the trigger point to be read.

  Your script shouldnt have to be in the Gcode library, can be in any. If you run it from
the script window does the script running led flash showing one is running? Ill take a look at the
block triggering code to see why it might not answer.

Art


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

Re: reading Pokeys pins

Post by gburk »

Not sure which led but when I run it in the script window I get the message  end of mdi script run no led's flashing

also having jog problems now only will jog one direction and only .010 distance can't jog past that.. or the other direction.

also do you have it setup to read the homing pins or will that also need to be done with a script?.. haven't got that far yet so going to ask before I start on the homing..

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Homing should work fine. Also, turn off softlimits, it may be those that are affecting you, until homing is setup, turn off softlimits in the config.
That will probably fix your jogging.

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

  Test homing in the pokeys setup program, it should work there, if so it should work in Auggie.  I use
it daily.

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

Re: reading Pokeys pins

Post by gburk »

homing pins are showing being triggered in pokeys...

I have been looking for a doc file to show how dome of the build in commands are used haven't found one the file in the auggie folder shows the calls but not how to use them
like what they may need to be passed to then or read from them say like  SetStateMask that's all that's in the doc file but not what to pass to it like maybe the led variable name
and a value to set it just an example, is there a doc file with how values need to be passed and read from the built in functions?

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

Re: reading Pokeys pins

Post by ArtF »

Hi Gary:

Check the AuggieProgrammersGuide.chm file in your folder. It shows erxamples of all the script calls and hwo they are
used in general.

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

  That help file is only complete through the direct Engine commands, its parameters are not entered forthe other groupings. IF you see one of interest
that isnt complete, yell and Ill fill it in. Im looking at completeing that list and removing obsolete groups such as the contour drawing groups and such.
Too much was added into auggie that it didnt need, so much is being removed.

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

  One final thought, make sure you read the code contained in the default libraries, they are the best example of how
to use the various calls. Most of them are used in one way or another in the examples shown. You get a pretty good
idea how to script from those scripts. You can see some of them instantiate functions and also call them to run at startup
by simply calling the declared function in the library file.

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

Re: reading Pokeys pins

Post by gburk »

Ok did a button to call this script

The Word help prints to the screen but the led doesn't turn on.

I created a led with the var name to XhomeTest

global Main_BUT_20 = function( current )
{
print("Help");
led = Led("XhomeTest");
  led.SetStateMask(1);
  //sleep(30);
  //led.SetStateMask(0);  //this makes the LED turn off, then on again in 3 seconds.

return;
};

So doing something wrong sorry for all the questions once I wrap my head around this stuff I should be good to go..
I didn't see anything like this in the scripts in the script folder...

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

Re: reading Pokeys pins

Post by ArtF »

Hi Gary:

    Your problem is the name of the led, your using the led variable name , not the actual led id name.
Start the scripter with the scripter checkbox in config dropdown. Turn on the scripter with its power button.

  At this point you can right click any LED and its identifier will be shown. In the case of your XhomeTest youll see
a name like LED_USERPANEL_6 or some such thing. Thats the identifier needed for getting an LED hook.

The variable name can be used with variable manipulation routines. As you type the right LED identifier it will
autocorrect in the window your typing it in.

Art


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

Re: reading Pokeys pins

Post by gburk »

I guess I'm to old for this but any way I started the script edit and when I right clicked the led I got
Main_LED_0:XhomeTest
I got the same type of name on all the led's, but the buttons did look like I was getting the right names back

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

  SO to connect to that LED youd use
the name Main_LED_0 ,

led = Led("Main_LED_0");
led.SetStateMask(1);

the variable name is XHomeTest. Not all items have a variable name.
I think the statement XHomeTest = 1 shoud turn it on as well without
having to get an LED hook for it. Generally a variable named object can
be refered to in script by its variable name instead of getting a hook and
using that. Ill have to test thats true in the case of LED's, its been awhile
since Ive done screen edits.

Art

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

Re: reading Pokeys pins

Post by ArtF »

Hi Gary:

I went back and edited to refresh myslf on how it works.

To set or get and LED's value, if it has a variable name, you can use

x = GlobalGet("MotionConnected");
print("Led = " + x);
GlobalSet("MotionConnected",1);


This will show you the motionconnected LED and set it to on if your in sim, replace
its varaible name with any you use and the globalGet / GlobalSet should work for you
for getting and settign any variable.


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

Re: reading Pokeys pins

Post by gburk »

Ill try it I was confused as to how it knows which led  is ("Main_LED_0"); all the leds on the main screen had the same name except the :XhomeText The Estop led had Main_LED_ 0:Estop

Thanks gary
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests