reading Pokeys pins

C Scripting questions and answers
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4648
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  Yes, very possible. Myself and Yanvrno realized at some point the fonts were a bit
flakey due to some technical factors. I havent worked on them as we typically worked around
the problem by using designs that didnt screw up, I was worried about breaking existing panels
and screens. I will take a look this week though to see if I can update them to be a bit
safer. The system "tries" out a font sizing of the text and adjusts it to just fit in a window,
it some cases it can fail, Ill see if I can figure out why in this case. If I can fix it
without breaking predefined screens Ill make a change.

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

Re: reading Pokeys pins

Post by gburk »

art

ok thanks I can set the panel to resizable forget the exact command but that will work, guess it really won't matter to much with the screen panel for spindle
the main thing is I get it to work correct with the m3 seeing the g code will be calling it most of the time screen panel was there mostly for testing.. 
but won't know till I get the new controller..

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

Re: reading Pokeys pins

Post by gburk »

Art

I think I seen you using a poscope in one of you video's..
How is it? is it worth the purchase..

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

Re: reading Pokeys pins

Post by gburk »

Art

Got the new kb controller working on wiring it up a lot different than the old board hopefully I will get it right if not kaboom >:(
hoping to have it back in tomorrow and will see if auggie works I know I have the pokeys wired right now anyway..

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Never tried a PoScope. I have a  bench scope and a small pocket scope
thats usb I use in tight situations, but I havent tried a PoScope.

  Ill keep cross my fingers crossed for you.

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

Re: reading Pokeys pins

Post by gburk »

Art

I think you will be happy, I have the new kb wired up and tested it with auggie and the spindle is working m3 S it is changing the speeds ok and m5 shuts it down so will m3 s0.. I haven't tested what the RPM's are yet ended up needing a battery for my rpm reader.. will let you know in the next day or 2 how close it is compared to what I set it to with the m3 S code..

Also I am thinking of setting up CW and CCW spindle I have m4 working, my question is, I still have problems figuring out how to set pins from high to low.
Like if a wanted to control a relay not on board, I need to send 5+ to trigger the relay would SetPinDig GetPinDig be the proper way to read and write to the pin#?.
I know with the probe you have pin19 built into auggies config..

Ok I hooked up pin28 from the lcd 16pin plug and 5+, if I power on pokeys I get nothing from the pin no voltage if I set to 0 or 1 from auggie, now if I run the pokeys config I see the pin28 is set for digital out, but still no voltage change from auggie, but if I invert the pin in pokeys config it will start to work with auggie I can invert it again and still works I can close out the pokeys config and it works great, but if I power the pokeys off and back on its back to not working seems like I allways have to make a change to the pin in pokeys config for it to start working, Any thoughts on this?..


have you had a chance to check the g code m6 running when g code file first loaded..

Thanks gary 
Last edited by gburk on Sun Jun 09, 2019 12:47 pm, edited 1 time in total.
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

I think we have discussed this before dialogs.

anyway if I remember there is no way to read which button was pressed Ok or Cancel correct?

and if I create my own button, is there a way to close the dialog when button pressed?..

dialog doesn't seem to close endless you hit Ok Cancel or the X..

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

Re: reading Pokeys pins

Post by ArtF »

Hi Gary:

>>would SetPinDig GetPinDig be the proper way to read and write to the pin#?.

  Yes, Those should set any pin. I dont use any myself though, both my systems
are using the relays as the only output. But, on my test rig, I can turn on or off an LED
on a pin I set with those calls. Im not sure why you need to set it in pokeys though,
I dont. Did you tell the pokeys to save the config when you set it to digtial?
Is it still set to digital out when you next run Pokeys again?

  Last test I did , the M6 didnt run on load, I did add a kill for that but now
Im not sure if I released that version. I will check it and release a version
today or tomorrow just so we're sure. I turned off all macro calls during load
as a safety as I recall.

  As to the Dialog issue, I dont think you have much choice as it is implemented,
the user has to press OK or cancel to exit and close the dialog. I will add a Close()
command for you today , call if from any script that dialog is calling from a button
or item.

  Should be out within a day or two..

Art



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

Re: reading Pokeys pins

Post by gburk »

Art

Some of my problem setting relays other than the 2 onboard is for some reason pokeys is outputting at least 1.6v from a pin before I trigger it..

for example if I use the LCD pin28  opps I forget if I had the other wire to gnd or +5 but anyway it would have 1.6v pin not triggered and for the relays I was using that was enough to trigger the relay on, so as soon as I powered pokeys the relay set if I triggered the relay it would jump to +5 so it was working.. I also tried the SSR output and I was getting the same voltage results..

The two onboard relays work fine, problem is I have 2 relays for power to the spindle m3 m4 and 2 for forward and 2 for reverse... SSR relays
I just ordered a couple DTDP I am going to try hopefully that will eliminate 2 relays..

I don't know to much about the oc1 2 3 4 outputs is it possible to use them?.

And a close() for the dialog would be great thenks

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

New Auggie is online. It has a Close() command for dialogs
as a test, its untested as of yet.

  As to the voltages, that really sounds dodgy, if your connected to the
pokeys ground you should have 0 volts to the pin, or 5, but it may be your
requesting too much current. The outputs are pretty low ma capability
so wiring can count. Are you triggering with a transistor circuit?

oc's should work, though I havent used them I dont think..

Art


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

Re: reading Pokeys pins

Post by gburk »

Art

Thanks will test the close().

I'm not sure but sleep on it, and went back to testing voltage now the SSR is working fine 0 to 5v..

I think you may be right the pokeys may not be able to handle the voltage output to relays from the LCD pins.. I tested again and received 4.6v not connected to relay when I hooked up the relay it dropped to almost nothing and relay didn't trigger..

OC'S question are they PWM, I can turn them on but no voltage change.. would I need a PWN to voltage board?.

Tested the Close(), doesn't seem to work I may be using it wrong..
I created a global dialog
I also created a button call.
I press the button and it does call the function correct.
I put a ProbeLengthDialog.Close(); in the function but doesn't close it..
I assume the only way I can close a dialog from another function is it has to be global..

There already was a Close statment in auggie before but not sure what it's use was intended for.


Thanks gary
Last edited by gburk on Fri Jun 14, 2019 9:22 am, edited 1 time in total.
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Did a test with the g code, I attached a copy..

It's still running the m6 t when g code first loaded, brings up my dialog and retracts to 1" but the g codel stays at the first line of the code.. first line is hi lighted.

gary
Attachments
XballscrewmountFinal6.zip
(1.39 KiB) Downloaded 201 times
User avatar
ArtF
Global Moderator
Global Moderator
Posts: 4648
Joined: Sun Sep 05, 2010 6:14 am
Contact:

Re: reading Pokeys pins

Post by ArtF »

Gary:

  Thx, I had lost that file, Ill retest and fix the m6 start.. Ill check the close as well..

>>I think you may be right the pokeys may not be able to handle the voltage output to relays from the LCD pins.. I tested again and received 4.6v not connected to relay when I hooked up the relay it dropped to almost nothing and relay didn't trigger..

  Yeah, there's not enough current to push a relay with a pinout, it has only enough for an
LED or signal , running an opto is one way to make it drive a relay.
OC's are open collector outputs, they are like pins with opto's added so that you can draw
enough current for a relay for example.  You put 5 volts for example on one side of
a relay, and the other side can be hooked to an OC output. There are 4 OC's, and
you can script call them with  Pokeys.SetOC( int oc, int state).

  Note: to do this you need to make sure whatever power supply is driving the relay
must share the same ground as the pokeys..

Art


  These 4 exist mainly to drive relays..

Be a day or two till I can test the M6.. Ill get back to you soon.

Art

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

Re: reading Pokeys pins

Post by ArtF »

Gary:

Small correction. According to the manual the OC's are all
galvanically isolated from the pokeys. So each OC has its own
ground, OC- to be hooked to the ground of the supply driving the
relay from the OC+. The OC command basically if set to state:1
will short those pins OC+ and OC-. Current will flow from OC+ to OC-
when the they are shorted.

  You can think of it as a transistor with the OC+ being the collector,
the OC- a grounded emitter, and the state is the base.
So in short this would be an NPN transistor with emitter ( OC-) to
be connected to your power ground and the collector (OC+) to
be connected to one side of the relay. The other side of the coil to
power supply +.

Art

supply grund, and the collector (OC+)
gburk
Old Timer
Posts: 324
Joined: Sun Nov 25, 2018 3:57 pm

Re: reading Pokeys pins

Post by gburk »

Art

Thanks the oc's work wired up per your directions and relay gos on and off..

Gary
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests