Hello Guest it is November 17, 2019, 07:30:46 AM

Author Topic: Problems reading and writing the PoKeys57U virtual pins  (Read 5578 times)

0 Members and 1 Guest are viewing this topic.

Problems reading and writing the PoKeys57U virtual pins
« on: December 07, 2015, 03:37:20 PM »
To build my pendant I need to control some of the 100 I / O virtual pins that  PoKeys57U offers through a Mach3 VB script to signal me by lighting an LED, a particular state. The order is executed, by pressing in a matrix keyboard input through the "Mach IO pin 0" with the following routine:
'Rutina para leer el estado del botón shift y enclavarlo
Sub LeerShift()
  OutputNumber = 30   
  If GetIODevInput(0, 0) =1 Then      'Si pulso el botón Shift
       If SHIFT Then
            SetIODevOutput(0,OutputNumber,0)
            SHIFT = False
       Else
             SetIODevOutput(DevID,OutputNumber,1)
            SHIFT = True
    End If
  End If     
End Sub

 This works well and I am able to recognize touch on the keyboard, but to send the order by the corresponding output ("IO pin Mach 30") Mach3 show me this message:

 When I press "OK" and the window closes, the order is executed and the LED lights.
I tried to use the instructions for the command of the virtual pin contained in the handbook PoKeys57U but do not work (GetInput, SetOutput).


Can you help me solve this problem?

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: Problems reading and writing the PoKeys57U virtual pins
« Reply #1 on: December 08, 2015, 03:11:33 PM »
I can only say that this message is generated by Mach3 itself, not the plugin - we have no idea what is the purpose of it.
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: Problems reading and writing the PoKeys57U virtual pins
« Reply #2 on: December 08, 2015, 04:49:20 PM »
You know any other way to control virtual outputs using VB script?

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: Problems reading and writing the PoKeys57U virtual pins
« Reply #3 on: December 08, 2015, 11:39:54 PM »
I am personally pretty weak on the VB scripting functionality of Mach3, so would have to research it first...

But you may try to use the Mach3's IO's - there are special IO registers that should be accessible and you can map PoKeys pins to them ('Mach3 IO <n>' option in Plugin configuration, where <n> goes from 1 to 100).
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: Problems reading and writing the PoKeys57U virtual pins
« Reply #4 on: December 12, 2015, 07:10:37 PM »
Excuse the delay in replying. I've been away from my computer a few days.
Precisely what is trying to use the  Mach3's IO's as  as you recommend me. I was assigned to one of the outputs of PoKeys57U the "Mach3 IO pin 30", but I can not activate it with any of the functions contained in the manual pokeys: SetOutput (30.1) "Bool SetOutput (pinID byte, bool outputState)". Generates the error: Wrong number of arguments or invalid property assignment.

I also tried to run previously the function SetPinData (30.4) (I set the pin as a digital output "bool SetPinData (pinID byte, byte pinFunction)") but it generates another error: "Expected: ="

Looking at the forum, I saw that someone had run Mach3's IO's with the function: SetIODevOutput (DevID, OutputNumber 1). It works more or less. Before lighting the LED, the Mach3 error message  of the attached image is displayed. When I accept, the LED changes state. I do not know what I'm doing wrong or if it is not possible to switch the Mach3's IO's by macropump and VB script.
I would appreciate any help on this. Excuse my poor English but I am native Spanish.
Re: Problems reading and writing the PoKeys57U virtual pins
« Reply #5 on: December 20, 2015, 03:06:54 PM »
Someone can help me work with  100 I/O virtual pins that  PoKeys57U offers through a Mach3 VB script?
I have successfully set the corresponding  PoKeys pin, but I have not located any function with which to change state said pin. :-[ :-[

Offline NeoTO

*
  •  504 504
    • View Profile
    • PoLabs
Re: Problems reading and writing the PoKeys57U virtual pins
« Reply #6 on: December 29, 2015, 12:00:36 PM »
It appears that something was changed in Mach3 - the Function == ... Outputmask... was not there before. Have you tried reaching the Mach3 guys?
www.poscope.com home of PoKeys USB HID, IO, USB, Ethernet controler and PoScope USB PC oscilloscope
Re: Problems reading and writing the PoKeys57U virtual pins
« Reply #7 on: December 29, 2015, 02:17:06 PM »
Finally I solved using "ActivateSignal (OUTPUT20)" and wasting some of the outputs of Mach3, but I do not like the solution.
I'm not sure how this works. Do I have to open another post in another forum? Where?
Thank you

Online Tweakie.CNC

*
  • *
  •  8,000 8,000
  • Super Kitty
    • View Profile
    • Tweakie.CNC
Re: Problems reading and writing the PoKeys57U virtual pins
« Reply #8 on: December 30, 2015, 03:28:58 AM »
Finally I solved using "ActivateSignal (OUTPUT20)" and wasting some of the outputs of Mach3, but I do not like the solution.
I'm not sure how this works. Do I have to open another post in another forum? Where?
Thank you


I don’t think it is all that important exactly where topics are posted but its perhaps nice to keep similar things together...

If its PoKeys related then start a new topic in the PoKeys section.
If its scripting (Cypress Enable) related then start a new topic in the VB and development of Wizards section.

Tweakie.
Success consists of going from failure to failure without loss of enthusiasm.  Winston Churchill.