Hello Guest it is April 18, 2019, 11:14:21 AM

Author Topic: Signal scripts while disabled.  (Read 152 times)

0 Members and 1 Guest are viewing this topic.

Offline sx3

*
  •  37 37
    • View Profile
Signal scripts while disabled.
« on: February 24, 2019, 10:32:33 AM »
Hi guys,

Yesterday we implemented the drawbar to Mach and I noticed something I can't really understand.
The drawbar have 2 limit switches and 2 buttons.

When mach is enabled, the drawbar works perfect, buttons enable outputs and the limit switches disables them.
However, when mach is disabled, the signal script do enable the output and the drawbar starts to clamp/unclamp and here's where the strange stuff comes in. The signal script don't listen for the limit switches, making the draw bar trying to move further than the end positions.

We ended up starting the signal script with a check of mach state, and only let it continue the script if mach is enabled, which ofcourse is good, since we don't want anything to be able to move while disabled.

But I'm curious why the signal script let an output to enable, but discards the mcSignalWait while mach is disabled?
IMHO Either all should work or nothing should work, not parts of signal scripts.
« Last Edit: February 24, 2019, 10:36:12 AM by sx3 »

Offline sx3

*
  •  37 37
    • View Profile
Re: Signal scripts while disabled.
« Reply #1 on: February 26, 2019, 10:04:57 AM »
Any comments? :)
Re: Signal scripts while disabled.
« Reply #2 on: February 27, 2019, 03:29:23 PM »
Hi,
you say you have two buttons, are they physical buttons or on screen buttons?

Craig
My wife left with my best friend...
     and I miss him!

Offline sx3

*
  •  37 37
    • View Profile
Re: Signal scripts while disabled.
« Reply #3 on: February 27, 2019, 03:30:59 PM »
Physical, connected to a ESS board
Re: Signal scripts while disabled.
« Reply #4 on: February 27, 2019, 03:32:56 PM »
Hi,
how do they get handled? Do you have them in SigLib{} for instance?

Craig
My wife left with my best friend...
     and I miss him!

Offline sx3

*
  •  37 37
    • View Profile
Re: Signal scripts while disabled.
« Reply #5 on: February 27, 2019, 03:34:45 PM »
Hi,
Yes, as they are Signals scripts they are in the SigLib{} of the load screen script.
Re: Signal scripts while disabled.
« Reply #6 on: February 27, 2019, 03:48:38 PM »
Hi,
I was thinking that if they were connected to two GUI buttons instead because  GUI buttons can
be enabled/disabled with the machine.

As an example I have attached a picture of the available enable states for a GUI button.

What I'm thinking is that if you connect your physical button inputs to two GUI buttons, they wouldn't even
have to be visible, then you can control when the buttons are operable, or more directly when the code
associated with each button executes.

Craig
My wife left with my best friend...
     and I miss him!

Offline sx3

*
  •  37 37
    • View Profile
Re: Signal scripts while disabled.
« Reply #7 on: February 27, 2019, 03:54:24 PM »
Hi,
Thats one way of solving it! As for us we added a check of state in the script to determ weither machine was enabled or not which is working aswell.
The topics main purpose is to understand why mach allow an output to enable but discards mcSignalWait while disabled.
Re: Signal scripts while disabled.
« Reply #8 on: February 27, 2019, 03:58:04 PM »
Hi,

Quote
The topics main purpose is to understand why mach allow an output to enable but discards mcSignalWait while disabled.

Good question....I don't know either.

Craig
My wife left with my best friend...
     and I miss him!

Offline smurph

*
  • *
  •  1,077 1,077
  • "That there... that's an RV."
    • View Profile
Re: Signal scripts while disabled.
« Reply #9 on: February 28, 2019, 04:23:46 PM »
mcSignalWait() used to require that the control was enabled.  The reason was because mcSignaWait() used to be ONLY used by the Industrial MacroB functions and ONLY on the general purpose input and output signals.  In the newer builds, this requirement has been removed and mcSignalWait() will work on ALL input and output signals. 

If you check the return code from mcSignalWait() it would have told you MERROR_NOT_ENABLED.  This is why it is ALWAYS important to check the return code.  :)

Steve