Hello Guest it is July 12, 2020, 04:52:09 PM

Author Topic: Mach4 Button OFFLINE  (Read 13444 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach4 Button OFFLINE
« Reply #90 on: January 31, 2018, 07:17:00 AM »
I use a CSMIO/IP-A and experience no problem in attaching any listed signal to a chosen I/O pin. CS Labs do not appear to impose any undue restrictions on this.

 OSIG_ENABLEx are normally used to enable drives and there is no problem assigning output pins via Mach4's Output Signals configuration.

OSIG_ENABLE0 is normally generated by the core, so it is debatable whether users should be directly programming it.

Allan
Re: Mach4 Button OFFLINE
« Reply #91 on: February 01, 2018, 02:47:54 AM »
Hi,
I have the screenshot, with this configuration the relay turns on and off ONLY when I press ENABLE / DISABLE in Mach4.
The m210 and m211 macros have no effect on the relay.
Re: Mach4 Button OFFLINE
« Reply #92 on: February 01, 2018, 03:05:01 AM »
Hi,
that looks right. Just try scanning the complete Output Signals page just to make sure that no other output signal has been attached to the
same pin.

Also would you copy and post one of the macros, m210 say. Mainly to check that I have programmed it right, although it works here.

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #93 on: February 01, 2018, 03:24:41 AM »
CSMIO does not allow you to use the same PIN twice.
When a PIN number is assigned, it disappears from the list.

function m210()
local inst=mc.mcGetInstance()
local hsig,rc=mc.mcSignalGetHandle(inst,mc.OSIG_ENABLE0)
mc.mcSignalSetState(hsig,0)
end
if (mc.mcInEditor()==1) then
    m210()
end
Re: Mach4 Button OFFLINE
« Reply #94 on: February 01, 2018, 04:22:36 AM »
Hi,
well that looks alright too.

Further you have an on screen LED to reflect OSIG_ENABLE0 and the LED worked...didn't it? So the macros work in Mach but can't be communicated to
the controller.

Despite what Allan says I don' think the controller recognizes OSIG_ENABLE0. If you're reading this Allan would you be kind enough to
test whether indeed the CSMIO device can recognize OSIG_ENABLE0.

In the mean time we'll have to try something else.

May I suggest using OSIG_OUTPUT10....surely the CSMIO device will recognize user output. Remove OSIG_ENABLE0 from the macros
and substitute OSIG_OUTPUT10. Now on Machs Output Signals page disable Enable#0 and enable Output#10 and attach CSMIO's Out.1

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #95 on: February 01, 2018, 04:41:31 AM »
OK done.
with this your last solution WORKS !!!!!
m210 and m211 macros WORK !!!
P.S. YES the led connected to ENABLE # 0 has worked.
The use of the macro only had a visual effect, the relay did not work.
you are a great .. !!
now..?
what will be the next step?
I think it will be necessary to memorize the position of the DRO axes on Mach4?
Re: Mach4 Button OFFLINE
« Reply #96 on: February 01, 2018, 05:33:43 AM »
Craig

Of course CSMIO recognises OSIG_ENABLE0 - I use it to enable Motor 0. I think the issue you were having may be a conflict with the core, as the signal was changing in response to Enable/Disable, as it normally does.

Though Mach's LED reacted in response to OSIG_ENABLE0, it would have been interesting to know if the LED on the CSMIO itself also reacted, proving that the command was reaching the controller.

Though the CSMIO is not perfect, it performs very solidly on the basic functions such as I/O.
Allan
Re: Mach4 Button OFFLINE
« Reply #97 on: February 01, 2018, 05:34:49 AM »
Hi,
that's good news. There are still some unanswered questions.....why does the controller not recognize OSIG_ENABLE0.
Are there other Mach output signals that it will not recognize?
Is there similar limitations on input signals?

These are fundamental questions which will occur again and again when programming Mach. If you can't answer them or get an answer for them
you will waste a lot of time in the future.

As to the rest of the code:
Button Event- if the servos are enabled, disable them and remember the machine coordinates of the current position
                     if the servos are disabled calculate a G53 move which will restore the machine to the machine coordinates prior to being disabled and then re-enable the servos.

You will need to set up a folder where you can write and debug code without putting it in the screen load script and potentially screw Mach up while you mess around.
In your profile folder make a new folder OfflineButton. This is where you will put your code and work on it.

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #98 on: February 01, 2018, 05:44:07 AM »
Hi,
the evidence is that the device does not connect OSIG_ENABLE0 to an output pin. The last twenty or more posts in this thread have been about this very issue.
Given that its not my device I can't email the manufacturer and ask WTF?

If you can see what OP is doing wrong by all means.....

In the mean time would you be kind enough to attempt to attach OSIG_ENABLE0 to a spare output pin on your controller and see if you can get it to work?
I tried every thing I can think of, at least from the other side of the world, and I've given up, I think the controller or its plugin is faulty.

Craig
My wife left with my best friend...
     and I miss him!
Re: Mach4 Button OFFLINE
« Reply #99 on: February 01, 2018, 05:48:45 AM »
Yes @joeaverage , it's exactly the behavior I want!!
you understood perfectly!!!
now I have to go to work, but I will follow the developments and update as soon as possible.