Hello Guest it is April 18, 2024, 10:31:54 AM

Author Topic: Need some help with Pokeys and My ATC  (Read 4116 times)

0 Members and 1 Guest are viewing this topic.

Offline derek

*
  •  200 200
    • View Profile
Need some help with Pokeys and My ATC
« on: November 15, 2012, 01:46:24 PM »


I’m a little (understatement) confused with pokeys and inputs. I have proximity sensors on the ends of the travels on my tool changer. The macro I’m going to be using uses the inputs from the proximity sensors to turn the outputs on or off at the proper times.

Here is a snippet of the macro that I tested with.
ActivateSignal(OutPut1)            
 Do While Not IsActive(Input1)
 sleep (10)         
 Loop
ActivateSignal(Output2)

This works great but I need more than 4 inputs. There are only 4 inputs listed in the drop down menu on the IO column of the pokeys plugin.

Should I be using a user led for the proximity sensors instead of inputs and have the macro watch for the led?

Thanks
Derek

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: Need some help with Pokeys and My ATC
« Reply #1 on: November 16, 2012, 01:55:33 AM »
Hi, Derek

Please take a look at the ' PoKeys Pulse Engine and Mach3 plugin manual (20.6.2012) ' available at poscope.com. In the end of the document, there is a section 'Reading and writing of IO from VB script' that I think will answer your question and solve your problem.

Regards,
Matevž
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope

Offline derek

*
  •  200 200
    • View Profile
Re: Need some help with Pokeys and My ATC
« Reply #2 on: November 16, 2012, 06:03:08 AM »
Hi, Derek

Please take a look at the ' PoKeys Pulse Engine and Mach3 plugin manual (20.6.2012) ' available at poscope.com. In the end of the document, there is a section 'Reading and writing of IO from VB script' that I think will answer your question and solve your problem.

Regards,
Matevž

Hi Thanks for the reply.
I had read that section earlier but had trouble getting my arms around it. It all seemed complicated when all I want to do is add an input that Mach will recognize.

Thanks
Derek

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: Need some help with Pokeys and My ATC
« Reply #3 on: November 16, 2012, 01:02:05 PM »
Just assign any PoKeys input pin to Mach3 IO input pin (1 to 100) in the PoKeys configuration dialog.
Then, in VB script, read the Mach3 input pin to get the value.
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope

Offline Tr_G

*
  •  10 10
    • View Profile
Re: Need some help with Pokeys and My ATC
« Reply #4 on: November 20, 2012, 11:27:36 PM »
Does anyone have an example VB script working with a pokeys Mach3 IO input? Seeing one would help me understand how it works.

Thanks

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: Need some help with Pokeys and My ATC
« Reply #5 on: November 21, 2012, 12:31:54 AM »
It is fairly simple. For the following code to work, map any PoKeys input to Mach3 IO Pin 0 and map one of the PoKeys outputs to Mach3 IO Pin 1.

Dim devName As String
devName = GetIODevName(0)
MsgBox(devName + " IO0: " + Str(GetIODevInput(0, 0)))
MsgBox(Str(SetIODevOutput(0, 1, 0)))
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope