GearHeads Corner
December 12, 2018, 05:39:43 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: 1 [2] 3
  Print  
Author Topic: reading Pokeys pins  (Read 232 times)
0 Members and 1 Guest are viewing this topic.
gburk
Newbie
*
Posts: 24


View Profile
« Reply #15 on: November 30, 2018, 02:25:07 PM »

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
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5054



View Profile
« Reply #16 on: November 30, 2018, 03:40:31 PM »

Gary:

   SO to connect to that LED youd use
the name Main_LED_ 0 ,

led = Led("Main_LED_ 0");
led.SetSt ateMask(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
 
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5054



View Profile
« Reply #17 on: November 30, 2018, 03:49:22 PM »

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("MotionCon nected");
print("Led = " + x);
GlobalSet("MotionCon nected",1);


 This will show you the motioncon nected 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
Logged
gburk
Newbie
*
Posts: 24


View Profile
« Reply #18 on: November 30, 2018, 08:19:49 PM »

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
Logged
ArtF
Administrator
Hero Member
*****
Posts: 5054



View Profile
« Reply #19 on: November 30, 2018, 11:14:52 PM »

Gary:

 While normally all LEDs will have names that are different, when the system see's they have a variable name,
it doesnt try to rename them to different primary names. this has to do with the rather complex system of naming
which is necessary as various modules could share a led name internall y. At startup various id's are checkled in
order and apparentl y it ignores the naming once it see's it has a variable name instead.  (Its been awhile since
Ive been in there..).
  I tested the script I posted, should work OK.. Still dont know why the block didnt work, more testing req

Art
Logged
gburk
Newbie
*
Posts: 24


View Profile
« Reply #20 on: December 01, 2018, 01:04:15 PM »

Yes Art That script seems to work my led will flash and also it will turn off..

Thanks gary

PS I'm sure I will be back for more advice

Logged
gburk
Newbie
*
Posts: 24


View Profile
« Reply #21 on: December 01, 2018, 08:57:01 PM »

New question go figure..

Is there a way to call a lib script from the button script...

Say I have a button it turns on the led and prints a message now in the same button script I want to call a script in the gcode lib like an mcode script I created Mcode330 or whatever ?

Thanks gary
Logged
gburk
Newbie
*
Posts: 24


View Profile
« Reply #22 on: December 02, 2018, 10:42:27 AM »

You asked me to check the pokeys config program to see if pin 19 is being triggered and it is, still can't seem to get auggie to read a trigger on pin 19..

Thanks gary
Logged
gburk
Newbie
*
Posts: 24


View Profile
« Reply #23 on: December 04, 2018, 02:05:49 PM »

Sorry art another question problem even though I haven't sorted out reading pins but homing problem
I see the homing led lights up if I trigger the home switch but it keeps flashing while its tripped the led doesn't say lit but flashes

But the motor does stop and reverses direction I assume its back off  the problem when the motor reverses it never stops just keeps running
in the opposite direction I have soft limits off.. and switch untrigger ed now..

any suggestio ns how to stop the back off distance?...

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



View Profile
« Reply #24 on: December 07, 2018, 11:27:55 PM »

Gary:

   You need to tell the pokeys to backoff the switch. Its a new setting in the pokeys engine config, if you test home on the
engine config page in Pokeys and it works, it should work the same in Auggie. Should be easier to test in the pokeys
software as it shows you what its doing on each stage.

 Im doing some work in Auggie this week, Ill see what I can find on pin19, I need to hook one up to see..

  Art
Logged
gburk
Newbie
*
Posts: 24


View Profile
« Reply #25 on: December 08, 2018, 01:38:55 PM »

Thanks art did get homing working,
mad a little progress can make a new button and led and get buttons to turn on and off the led also can turn on a relay with button press..

Still haven't sorted out how to read a pin if trigged.

I tried to look at any scripts you have installed but couldn't fine one I know you reading pin triggers like turning on the homing led when hit but couldn't find the script you are using to do it looked at the all the scripts I could find...

Also is it normal for the homing led to blink on and off when the switch to not triggered mine seems to do that, but when its triggered it stays lite no flashing. ..
funny because I have been having the same problem with the probe led in mach3..

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



View Profile
« Reply #26 on: December 08, 2018, 04:01:22 PM »

Hi Gary:


  Some functions like home are done by hardwire, there is no script. The pokeys for example reports homing as done or not and triggers
internal calls as its a priority function. The flashing shouldnt occur..do esnt here. Mine is either off or on. Ill take a look to see what may cause that symptom.

  For other inputs the software checks each pin and does an internal signal to Unblock using the words as we described earlier inj this thread. I just need to hook up something to trigger to see why it isnt calling you when the pin is triggered .

  Is it possible you wrote and forgot a script trying to light the home led? It woudl create a flashing as the system tried to reset it back to zero when not homed. Checking the software I cant fing anything to cause it to flash unless you checked an opion in its propertie s to tell it to flash when inactive
or something . (But its complex in there and I may be missing it..).

  When you actually home sucessful ly, a signal is sent to scripts called "HomedAxis". So a block on "HomedAxis" should trip a script when a home occurs,
thought that doesnt tell you anything about which home it was. A call to GlobalGet( "Axis1Home d" ) will tell you if that axis is homed.

  You get a similar call when a pin goes active.. named MotionPin 19 for example, though as I recall it can be off by a pin # as I used to count 0 as first pin.
I thought that changed but you may want to try "MotionPin 18" or "MotionPin 20" just in case soemthing is one off in there. Ill check this as soon
as I can get to hooking up a cable int here to use a pin.

Thx
Art
Logged
gburk
Newbie
*
Posts: 24


View Profile
« Reply #27 on: December 08, 2018, 06:56:29 PM »

I noticed if I use m8 or m9 its calling SetMistFl ood()

I changed the code to getrelay and if its on with setrelay the m8 seems to turn it on, but m9 doesn't I know is going though the function to the turn off relay I have it printing showing turning off but doesn't go off... if i call m8 again it shuts off,  i tried my own m8 call function but looks like the SetMistFl ood() overrides it..

also i see variables IOpins setup in system variables But nothing for MotionIO would that matter when you are trying to get the MotionIO pin status

also i will try a different # if you start at 0 then i try 18..

I also didn't write any scrips to turn on or off homing or the leds..

Thanks gary
Logged
gburk
Newbie
*
Posts: 24


View Profile
« Reply #28 on: December 08, 2018, 09:48:49 PM »

forgot I ran the pokey configura tion and the home pin works ok led stays lite or stays off no flashing. .

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



View Profile
« Reply #29 on: December 08, 2018, 10:15:34 PM »

Hi Gary:

>>I noticed if I use m8 or m9 its calling SetMistFl ood()

  Yes certain functions such as spindle, flood and mist are considere d systemic and have their own script, it can be changed but not
replaced. Can you post the script your using for flood and mist, I may see something easier.

>>also i see variables IOpins setup in system variables But nothing for MotionIO would that matter when you are trying to get the MotionIO pin status

In the Motion library there is a global variable declared as Pokeys1 . global Pokeys1 = Motion();
So you shoudl be able to use
 
  PinState = Pokeys1.G etPinDig( 19 );


 
>>I also didn't write any scrips to turn on or off homing or the leds

   I cant understan d why its flashing. It may be the screen set has that LED set to flash in its propertie s. Youd have to open the DROPanel screen from panels to see if its led propertie s are telling it to flash.

Art
Logged
Pages: 1 [2] 3
  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!