Message Component - Reset?

More
06 Nov 2018 08:14 #120082 by Nitram
Hello.

I have set up a message using the HAL "message" component.
Specifically it is for the spindle cover on a lathe. At the moment the message reacts so that when the cover is opened it brings up the message.
I would like the message to self-reset. That is, when the cover is closed the message goes away again by itself.
At the moment the message needs to be clicked to clear it after closing the spindle cover.
Is there a pin or parameter to enable the message component to behave in this way, i.e be "live" without latching or needing to be manually clicked to clear it?
Are there any other suggestions to achieve the same thing?

Many thanks,
Marty.

Please Log in or Create an account to join the conversation.

More
07 Nov 2018 14:45 #120170 by andypugh
Replied by andypugh on topic Message Component - Reset?
The code is here
github.com/LinuxCNC/linuxcnc/blob/master...ponents/message.comp

It actually uses the LinuxCNC error message channel (
rtapi_print_msg(RTAPI_MSG_ERR, "%s\n", messages[myidx]);
) and that has no way to auto-reset. In fact that messages themselves have no memory of where they came from or what caused them.

You might want to consider hacking the hal_manualtoolchange script. That has behaviour closer to what you want.
github.com/LinuxCNC/linuxcnc/blob/master..._manualtoolchange.py

Please Log in or Create an account to join the conversation.

More
07 Nov 2018 15:01 - 07 Nov 2018 15:06 #120172 by dgarrett
Replied by dgarrett on topic Message Component - Reset?
If you are using the axis gui, there are pins to clear notifications:
$ halcmd show pin axisui\.notifications
Component Pins:
Owner   Type  Dir         Value  Name
    73  bit   IN          FALSE  axisui.notifications-clear
    73  bit   IN          FALSE  axisui.notifications-clear-error
    73  bit   IN          FALSE  axisui.notifications-clear-info

Example test:
sim_pin axisui.notifications-clear

Ref: linuxcnc.org/docs/2.7/html/gui/axis.html#_axisui_pins
Last edit: 07 Nov 2018 15:06 by dgarrett. Reason: ref to docs

Please Log in or Create an account to join the conversation.

More
07 Nov 2018 15:04 #120174 by andypugh
Replied by andypugh on topic Message Component - Reset?
Good point, Dewey.

And with a oneshot HAL component it would be possible to toggle that pin any time that the chuck guard was lowered. That would clear every notification any time the guard was moved from open to closed, but that might actually be OK.

Please Log in or Create an account to join the conversation.

More
07 Nov 2018 23:18 - 07 Nov 2018 23:19 #120220 by Nitram
Replied by Nitram on topic Message Component - Reset?
Regarding gmocchapy, do you see the pins below as the same per the Axis example above? Excerpt below taken from the gmocchapy manual and may provide the same functionality with a oneshot component?

5.7. Error Pins
gmoccapy.error

gmoccapy.delete-message

gmoccapy.error is an bit out pin, to indicate an error, so a light can lit or even the machine may be stopped. It will be reseted with the pin gmoccapy.delete-message. gmoccapy.delete-message will delete the first error and reset the gmoccapy.error pin to False after the last error has been cleared.

Note
Messages or user infos will not affect the gmoccapy.error pin, but the gmoccapy.delete-message pin will delete the last message if no error is shown!
Last edit: 07 Nov 2018 23:19 by Nitram.

Please Log in or Create an account to join the conversation.

More
22 Jul 2019 03:45 #140144 by DeckelHead
I'd like to resurrect this thread because I'm trying to do something similar. I too am using Axis as my UI. However, I can't seem to create a 'net' between the pin and a signal in my HAL file. Inside Axis, I can do a setp on the reset, assigning a value of TRUE, and that works great. But getting this to work when my control transitions to 'machine on' just isn't happening. I'm assuming that I have missed an appropriate loadrt and/or addf, but I haven't been able to find the right mix.

Yes, this is probably a foolish question. But I am also willing to bet that some other soul reading this is probably thinking, "thank God that guy asked this question!" too. :)

Please Log in or Create an account to join the conversation.

More
22 Jul 2019 05:46 #140150 by phillc54
Replied by phillc54 on topic Message Component - Reset?
You would need to net the axisui.notifications-clear pin in the postgui halfile
The following user(s) said Thank You: DeckelHead

Please Log in or Create an account to join the conversation.

More
22 Jul 2019 15:20 #140186 by DeckelHead
Ah! That makes sense... I had looked at ordering in my INI file, but I didn't even consider that the GUI had a postgui HAL file. I'll try that.... Thanks for the heads up!

Please Log in or Create an account to join the conversation.

More
07 Dec 2019 18:29 - 03 Jan 2020 20:04 #152272 by chimeno
Replied by chimeno on topic Message Component - Reset?
Hi, I found this old thread, and I'm looking for a HAL pin output that notifies me when a message appears in the AXIS guide, any idea if it exists? does not exist.

I have to create a new output pin, I must look at the file
./src/emc/usr_intf/axis/scripts
if hal_present == 1:
    comp = hal.component ("axisui")
    comp.newpin ("jog.x", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.y", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.z", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.a", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.b", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.c", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.u", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.v", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.w", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.increment", hal.HAL_FLOAT, hal.HAL_OUT)
    comp.newpin ("notifications-out", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("notifications-clear", hal.HAL_BIT, hal.HAL_IN)
    comp.newpin ("notifications-clear-info", hal.HAL_BIT, hal.HAL_IN)
    comp.newpin ("notifications-clear-error", hal.HAL_BIT, hal.HAL_IN)
    comp.newpin ("resume-inhibit", hal.HAL_BIT, hal.HAL_IN)

added this line
comp.newpin ("notifications-out", hal.HAL_BIT, hal.HAL_OUT)

now I must connect it, I guess I should look at the
class Notification (Tkinter.Frame):

but I don't have much experience in phyton, if someone can guide me or help me ?, thanks

greeting
Chimeno
Last edit: 03 Jan 2020 20:04 by chimeno. Reason: more information

Please Log in or Create an account to join the conversation.

More
04 Jan 2020 18:16 #154007 by chimeno
Replied by chimeno on topic Message Component - Reset?
Hello again,
I am trying that when an error message occurs to be able to activate an output pin, warning, I think it would be good for linuxcnc, now I have it worked as I show in the image img2477, but when I close the application an error appears, I will not program python so I'm trying, if someone can tell me what I did wrong or how I should do it, the changes are in this fil
./src/emc/usr_intf/axis/scripts/axis.py

the lines that added
comp ['notifications'] = False
comp ["notifications"] = True
comp.newpin ("notifications", hal.HAL_BIT, hal.HAL_OUT)

in which section:
 def remove (self, widgets):
        self.widgets.remove (widgets)
        if len (self.cache) <10:
            widgets [0] .pack_forget ()
            self.cache.append (widgets)
        else:
            widgets [0] .destroy ()
        if len (self.widgets) == 0:
            self.place_forget ()
            comp ['notifications'] = False

  def error_task (self):
        error = e.poll ()
        while error:
            kind, text = error
            if kind in (linuxcnc.NML_ERROR, linuxcnc.OPERATOR_ERROR):
                icon = "error"
            else:
                icon = "info"
            notifications.add (icon, text)
            comp ["notifications"] = True
            error = e.poll ()
        self.error_after = self.win.after (200, self.error_task)

if hal_present == 1:
    comp = hal.component ("axisui")
    comp.newpin ("jog.x", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.y", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.z", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.a", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.b", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.c", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.u", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.v", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.w", hal.HAL_BIT, hal.HAL_OUT)
    comp.newpin ("jog.increment", hal.HAL_FLOAT, hal.HAL_OUT)
    comp.newpin ("notifications-clear", hal.HAL_BIT, hal.HAL_IN)
    comp.newpin ("notifications-clear-info", hal.HAL_BIT, hal.HAL_IN)
    comp.newpin ("notifications-clear-error", hal.HAL_BIT, hal.HAL_IN)
    comp.newpin ("resume-inhibit", hal.HAL_BIT, hal.HAL_IN)
    comp.newpin ("notifications", hal.HAL_BIT, hal.HAL_OUT)

greeting
Chimeno
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum