In fact if you insert with an additional debug line as below, it will make it easier seeing what gets scanned into the vars, should it fail

xhc-hb04.tcl: 97

#  if [catch {scan $line "%d %s %s %s%s" owner type dir value pinname} msg] {
  if [catch {scan $line "%d %d %s %s %s %s %d %d" Comp Inst Type Dir Value Name Epsilon Flags} msg] {
     puts stderr "FAILED pin_exists: $Comp $Inst $Type $Dir $Value $Name $Epsilon $Flags"


On 18/08/16 09:05, [email protected] wrote:
As far as I can see, the test is a very crude one and should be easily amended.

It takes the output from `halcmd show pin <pin-name>` and selects line 2 of that output
This will only exist, if the pin exists.

As a further check it ensures that this line conforms to the format for a pin print out and is not something else, like an error message

I don't have one of these pendants so cannot test it.

I would have thought that  at
xhc-hb04.tcl: 97

substituting the existing line so
#  if [catch {scan $line "%d %s %s %s%s" owner type dir value pinname} msg] {
  if [catch {scan $line "%d %d %s %s %s %s %d %d" Comp Inst Type Dir Value Name Epsilon Flags} msg] {

would scan to a format recognised and return 1 (OK)

If you are willing to test, we may be able to fix it simply

regards


On 17/08/16 21:22, Håkan Båstedt wrote:
I just got the XHC-HB04 to work on my 3040 milling machine.

I used the config in sim.axis.xhc-hb04/xhc-hb04-layout2_mm.ini
and in the sim/axis the wheel works but none of the
buttons. When starting machinekit there comes a number of
lines, like
xhc-hb04: found XHC-HB04 device
xhc
-hb04: !!! <xhc-hb04.button-goto-zero> pin does not exist, continuing
xhc
-hb04: !!! <xhc-hb04.button-half> pin does not exist, continuing
xhc
-hb04: !!! <xhc-hb04.button-home> pin does not exist, continuing


and so on for all buttons, the rest is not so important.

This can be traced to the "pin_exists" function in xhc-hb04.tcl
where the output of "show pin" is analyzed and fails because
the syntax is no longer what is expected by the tcl script.

With that sorted the sim worked.

Trying to insert this to my machine config,
I had to redo the pin_exists exercise.Then there were a few
duplicate definitions
""Pin x was already linked to signal y", so removing those
got it finally going. Seems to work fine.

I think it was a bit too troublesome to set up the pendant
and I have spent a fair amount of time googling this topic,

What can be done to ease the setup and use of the HB04?
Fixing the tcl script, okay.
There are examples of configs for at least two other pendants
in machinekit.io but that is so different from the hb04 config
files that it is like two different worlds. The tcl script
obscures what is actually needed. Perhaps it would
be better to write a HB04 config example without tcl.




--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit
---
You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to