Loading ...
Sorry, an error occurred while loading the content.

Re: Using User LEDs and DROs from a Plugin

Expand Messages
  • pghcncguy
    Thanks for the help Andy. I ve been experimenting and learned a couple things: - while there is a scripting call for SetUserLED and SetUserDRO , there are
    Message 1 of 8 , May 27, 2013
    • 0 Attachment
      Thanks for the help Andy.

      I've been experimenting and learned a couple things:
      - while there is a scripting call for "SetUserLED" and "SetUserDRO", there are only the standard calls "SetLED" "SetDRO" in plug-ins
      - I'm using MachScreen to draw the screen. Since I only wanted an integer format, I set the format to %4u. It has to be set to a floating point format to display properly %5.0f

      So, it was strictly a MachScreen thing. I'll chalk it up to the challenge of learning a couple different systems at the same time (Mach internals, plug-ins, screen design).

      Rege

      --- In mach1mach2cnc@yahoogroups.com, "Andy Wander" <ohawiseguyeh@...> wrote:
      >
      > Sorry, I have never done a plugin.
      >
      >
      >
      > I know from experience in regular scripting/macros that you cannot write to
      > a regular LED, only to a UserLED, and likewise OEMDROs are what is used.
      >
      >
      >
      > Maybe Brian or Art will jump in here.
      >
      >
      >
      >
      >
      >
      >
      > Andy Wander
      >
      > _____
      >
      > From: mach1mach2cnc@yahoogroups.com [mailto:mach1mach2cnc@yahoogroups.com]
      > On Behalf Of pghcncguy
      > Sent: Monday, May 27, 2013 9:34 PM
      > To: mach1mach2cnc@yahoogroups.com
      > Subject: [mach1mach2cnc] Re: Using User LEDs and DROs from a Plugin
      >
      >
      >
      >
      >
      > Andy,
      >
      > Neither of those are defined.
      >
      > I'm using the Wizard plug-in and it only defines SetLED and SetDRO, it
      > doesn't get the OEM or User version.
      >
      > There's a function in MachDevice.cpp to define them:
      >
      > extern "C" __declspec(dllexport) void SetSetDRO(VoidShortDouble pFunc)
      > {
      > SetDRO = pFunc;
      > }
      >
      > Should I just do the same for "SetSetUserDRO"? It make sense that it has to
      > be defined, but I'm not sure what Mach will recognize.
      >
      > Thanks,
      > Rege
      >
      > --- In mach1mach2cnc@yahoogroups.com
      > <mailto:mach1mach2cnc%40yahoogroups.com> , "Andy Wander" <ohawiseguyeh@>
      > wrote:
      > >
      > > try this format instead:
      > >
      > >
      > >
      > > SetUserLed (my_dro_id, value)
      > >
      > > SetOemDRO (my_led_id, value)
      > >
      > >
      > >
      > > Andy Wander
      > >
      > > _____
      > >
      > > From: mach1mach2cnc@yahoogroups.com
      > <mailto:mach1mach2cnc%40yahoogroups.com>
      > [mailto:mach1mach2cnc@yahoogroups.com
      > <mailto:mach1mach2cnc%40yahoogroups.com> ]
      > > On Behalf Of pghcncguy
      > > Sent: Monday, May 27, 2013 6:33 PM
      > > To: mach1mach2cnc@yahoogroups.com <mailto:mach1mach2cnc%40yahoogroups.com>
      >
      > > Subject: [mach1mach2cnc] Using User LEDs and DROs from a Plugin
      > >
      > >
      > >
      > >
      > >
      > > I'm doing my first plugin and trying to use User DRO's and User LED's for
      > > input and output.
      > >
      > > I used MachScreen to edit an existing screen set to add a new screen with
      > my
      > > DRO's and LED's on them. I started the DRO's at 1001 and LEDs and 1001 as
      > > well. (I've also added buttons starting at 10,001 but haven't tried to do
      > > anything with them yet.)
      > >
      > > In the plug-in I'm doing SetDRO(my_dro_id, value) and SetLED(my_led_id,
      > > value) but neither seems to be doing anything to the DRO's and LED's.
      > >
      > > I feel like I must be missing something, but haven't been able to figure
      > it
      > > out.
      > >
      > > Any insights would be appreciated.
      > >
      > > Thanks,
      > > Rege
      > >
      > >
      > >
      > >
      > >
      > > [Non-text portions of this message have been removed]
      > >
      >
      >
      >
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • Brian Barker
      Hello Rege, It was a holiday weekend here and I was off having fun :) . SetLed(short lednumber, bool val); Should work... you will be using the OEM numbers to
      Message 2 of 8 , May 28, 2013
      • 0 Attachment
        Hello Rege,
        It was a holiday weekend here and I was off having fun :) .

        SetLed(short lednumber, bool val); Should work... you will be using the
        OEM numbers to set them :
        http://www.machsupport.com/MachCustomizeWiki/index.php?title=OEM_LEDs

        Hope that helps
        Brian

        On 5/28/2013 2:48 AM, pghcncguy wrote:
        > Thanks for the help Andy.
        >
        > I've been experimenting and learned a couple things:
        > - while there is a scripting call for "SetUserLED" and "SetUserDRO", there are only the standard calls "SetLED" "SetDRO" in plug-ins
        > - I'm using MachScreen to draw the screen. Since I only wanted an integer format, I set the format to %4u. It has to be set to a floating point format to display properly %5.0f
        >
        > So, it was strictly a MachScreen thing. I'll chalk it up to the challenge of learning a couple different systems at the same time (Mach internals, plug-ins, screen design).
        >
        > Rege
        >
        > --- In mach1mach2cnc@yahoogroups.com, "Andy Wander"<ohawiseguyeh@...> wrote:
        >> Sorry, I have never done a plugin.
        >>
        >>
        >>
        >> I know from experience in regular scripting/macros that you cannot write to
        >> a regular LED, only to a UserLED, and likewise OEMDROs are what is used.
        >>
        >>
        >>
        >> Maybe Brian or Art will jump in here.
        >>
        >>
        >>
        >>
        >>
        >>
        >>
        >> Andy Wander
        >>
        >> _____
        >>
        >> From: mach1mach2cnc@yahoogroups.com [mailto:mach1mach2cnc@yahoogroups.com]
        >> On Behalf Of pghcncguy
        >> Sent: Monday, May 27, 2013 9:34 PM
        >> To: mach1mach2cnc@yahoogroups.com
        >> Subject: [mach1mach2cnc] Re: Using User LEDs and DROs from a Plugin
        >>
        >>
        >>
        >>
        >>
        >> Andy,
        >>
        >> Neither of those are defined.
        >>
        >> I'm using the Wizard plug-in and it only defines SetLED and SetDRO, it
        >> doesn't get the OEM or User version.
        >>
        >> There's a function in MachDevice.cpp to define them:
        >>
        >> extern "C" __declspec(dllexport) void SetSetDRO(VoidShortDouble pFunc)
        >> {
        >> SetDRO = pFunc;
        >> }
        >>
        >> Should I just do the same for "SetSetUserDRO"? It make sense that it has to
        >> be defined, but I'm not sure what Mach will recognize.
        >>
        >> Thanks,
        >> Rege
        >>
        >> --- In mach1mach2cnc@yahoogroups.com
        >> <mailto:mach1mach2cnc%40yahoogroups.com> , "Andy Wander"<ohawiseguyeh@>
        >> wrote:
        >>> try this format instead:
        >>>
        >>>
        >>>
        >>> SetUserLed (my_dro_id, value)
        >>>
        >>> SetOemDRO (my_led_id, value)
        >>>
        >>>
        >>>
        >>> Andy Wander
        >>>
        >>> _____
        >>>
        >>> From: mach1mach2cnc@yahoogroups.com
        >> <mailto:mach1mach2cnc%40yahoogroups.com>
        >> [mailto:mach1mach2cnc@yahoogroups.com
        >> <mailto:mach1mach2cnc%40yahoogroups.com> ]
        >>> On Behalf Of pghcncguy
        >>> Sent: Monday, May 27, 2013 6:33 PM
        >>> To: mach1mach2cnc@yahoogroups.com<mailto:mach1mach2cnc%40yahoogroups.com>
        >>> Subject: [mach1mach2cnc] Using User LEDs and DROs from a Plugin
        >>>
        >>>
        >>>
        >>>
        >>>
        >>> I'm doing my first plugin and trying to use User DRO's and User LED's for
        >>> input and output.
        >>>
        >>> I used MachScreen to edit an existing screen set to add a new screen with
        >> my
        >>> DRO's and LED's on them. I started the DRO's at 1001 and LEDs and 1001 as
        >>> well. (I've also added buttons starting at 10,001 but haven't tried to do
        >>> anything with them yet.)
        >>>
        >>> In the plug-in I'm doing SetDRO(my_dro_id, value) and SetLED(my_led_id,
        >>> value) but neither seems to be doing anything to the DRO's and LED's.
        >>>
        >>> I feel like I must be missing something, but haven't been able to figure
        >> it
        >>> out.
        >>>
        >>> Any insights would be appreciated.
        >>>
        >>> Thanks,
        >>> Rege
        >>>
        >>>
        >>>
        >>>
        >>>
        >>> [Non-text portions of this message have been removed]
        >>>
        >>
        >>
        >>
        >>
        >> [Non-text portions of this message have been removed]
        >>
        >
        >
        >
        > ------------------------------------
        >
        > www.machsupport.com - Web site AccessYahoo! Groups Links
        >
        >
        >
        >
      • pghcncguy
        Thanks Brian, I did get that working. The next thing was figuring out how to handle button presses in the plugin. Fortunately, I found that one fairly quickly
        Message 3 of 8 , May 29, 2013
        • 0 Attachment
          Thanks Brian, I did get that working.

          The next thing was figuring out how to handle button presses in the plugin. Fortunately, I found that one fairly quickly searching the forums.

          I did post on the Mach support forms about getting an "Art Error" when I did a blocking serial port read on a thread I spawned from the plugin.

          I've worked around it, but was wondering if that was an issue with my code or an architecture thing with Mach. Any insights?

          Thanks,
          Rege

          --- In mach1mach2cnc@yahoogroups.com, Brian Barker <brianb@...> wrote:
          >
          > Hello Rege,
          > It was a holiday weekend here and I was off having fun :) .
          >
          > SetLed(short lednumber, bool val); Should work... you will be using the
          > OEM numbers to set them :
          > http://www.machsupport.com/MachCustomizeWiki/index.php?title=OEM_LEDs
          >
          > Hope that helps
          > Brian
          >
          > On 5/28/2013 2:48 AM, pghcncguy wrote:
          > > Thanks for the help Andy.
          > >
          > > I've been experimenting and learned a couple things:
          > > - while there is a scripting call for "SetUserLED" and "SetUserDRO", there are only the standard calls "SetLED" "SetDRO" in plug-ins
          > > - I'm using MachScreen to draw the screen. Since I only wanted an integer format, I set the format to %4u. It has to be set to a floating point format to display properly %5.0f
          > >
          > > So, it was strictly a MachScreen thing. I'll chalk it up to the challenge of learning a couple different systems at the same time (Mach internals, plug-ins, screen design).
          > >
          > > Rege
          > >
          > > --- In mach1mach2cnc@yahoogroups.com, "Andy Wander"<ohawiseguyeh@> wrote:
          > >> Sorry, I have never done a plugin.
          > >>
          > >>
          > >>
          > >> I know from experience in regular scripting/macros that you cannot write to
          > >> a regular LED, only to a UserLED, and likewise OEMDROs are what is used.
          > >>
          > >>
          > >>
          > >> Maybe Brian or Art will jump in here.
          > >>
          > >>
          > >>
          > >>
          > >>
          > >>
          > >>
          > >> Andy Wander
          > >>
          > >> _____
          > >>
          > >> From: mach1mach2cnc@yahoogroups.com [mailto:mach1mach2cnc@yahoogroups.com]
          > >> On Behalf Of pghcncguy
          > >> Sent: Monday, May 27, 2013 9:34 PM
          > >> To: mach1mach2cnc@yahoogroups.com
          > >> Subject: [mach1mach2cnc] Re: Using User LEDs and DROs from a Plugin
          > >>
          > >>
          > >>
          > >>
          > >>
          > >> Andy,
          > >>
          > >> Neither of those are defined.
          > >>
          > >> I'm using the Wizard plug-in and it only defines SetLED and SetDRO, it
          > >> doesn't get the OEM or User version.
          > >>
          > >> There's a function in MachDevice.cpp to define them:
          > >>
          > >> extern "C" __declspec(dllexport) void SetSetDRO(VoidShortDouble pFunc)
          > >> {
          > >> SetDRO = pFunc;
          > >> }
          > >>
          > >> Should I just do the same for "SetSetUserDRO"? It make sense that it has to
          > >> be defined, but I'm not sure what Mach will recognize.
          > >>
          > >> Thanks,
          > >> Rege
          > >>
          > >> --- In mach1mach2cnc@yahoogroups.com
          > >> <mailto:mach1mach2cnc%40yahoogroups.com> , "Andy Wander"<ohawiseguyeh@>
          > >> wrote:
          > >>> try this format instead:
          > >>>
          > >>>
          > >>>
          > >>> SetUserLed (my_dro_id, value)
          > >>>
          > >>> SetOemDRO (my_led_id, value)
          > >>>
          > >>>
          > >>>
          > >>> Andy Wander
          > >>>
          > >>> _____
          > >>>
          > >>> From: mach1mach2cnc@yahoogroups.com
          > >> <mailto:mach1mach2cnc%40yahoogroups.com>
          > >> [mailto:mach1mach2cnc@yahoogroups.com
          > >> <mailto:mach1mach2cnc%40yahoogroups.com> ]
          > >>> On Behalf Of pghcncguy
          > >>> Sent: Monday, May 27, 2013 6:33 PM
          > >>> To: mach1mach2cnc@yahoogroups.com<mailto:mach1mach2cnc%40yahoogroups.com>
          > >>> Subject: [mach1mach2cnc] Using User LEDs and DROs from a Plugin
          > >>>
          > >>>
          > >>>
          > >>>
          > >>>
          > >>> I'm doing my first plugin and trying to use User DRO's and User LED's for
          > >>> input and output.
          > >>>
          > >>> I used MachScreen to edit an existing screen set to add a new screen with
          > >> my
          > >>> DRO's and LED's on them. I started the DRO's at 1001 and LEDs and 1001 as
          > >>> well. (I've also added buttons starting at 10,001 but haven't tried to do
          > >>> anything with them yet.)
          > >>>
          > >>> In the plug-in I'm doing SetDRO(my_dro_id, value) and SetLED(my_led_id,
          > >>> value) but neither seems to be doing anything to the DRO's and LED's.
          > >>>
          > >>> I feel like I must be missing something, but haven't been able to figure
          > >> it
          > >>> out.
          > >>>
          > >>> Any insights would be appreciated.
          > >>>
          > >>> Thanks,
          > >>> Rege
          > >>>
          > >>>
          > >>>
          > >>>
          > >>>
          > >>> [Non-text portions of this message have been removed]
          > >>>
          > >>
          > >>
          > >>
          > >>
          > >> [Non-text portions of this message have been removed]
          > >>
          > >
          > >
          > >
          > > ------------------------------------
          > >
          > > www.machsupport.com - Web site AccessYahoo! Groups Links
          > >
          > >
          > >
          > >
          >
        • Brian Barker
          If I had to guess it is Mach3 :( Mach3 is sharing a pointer to the guts of Mach and you can make it fail at will.. it is harder to make it work as you would
          Message 4 of 8 , May 30, 2013
          • 0 Attachment
            If I had to guess it is Mach3 :( Mach3 is sharing a pointer to the guts
            of Mach and you can make it fail at will.. it is harder to make it work
            as you would like then it is to make it fail.. So you are going to see
            some of that as you develop and poke around.

            Thanks
            Brian


            On 5/29/2013 7:57 PM, pghcncguy wrote:
            > Thanks Brian, I did get that working.
            >
            > The next thing was figuring out how to handle button presses in the plugin. Fortunately, I found that one fairly quickly searching the forums.
            >
            > I did post on the Mach support forms about getting an "Art Error" when I did a blocking serial port read on a thread I spawned from the plugin.
            >
            > I've worked around it, but was wondering if that was an issue with my code or an architecture thing with Mach. Any insights?
            >
            > Thanks,
            > Rege
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.