Machsupport Forum
Third party software and hardware support forums. => PoKeys => Topic started by: derek 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
-
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, 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
-
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.
-
Does anyone have an example VB script working with a pokeys Mach3 IO input? Seeing one would help me understand how it works.
Thanks
-
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)))