Hello Guest it is March 28, 2024, 11:06:19 AM

Author Topic: Activating/Deactivating E-Stop from within VB?  (Read 8252 times)

0 Members and 1 Guest are viewing this topic.

Activating/Deactivating E-Stop from within VB?
« on: August 03, 2010, 03:43:46 PM »
I'm trying to find a way to temporarily activate the E-Stop during the execution of a script.

I want to do something like:

code...
activate E-Stop
more code...
deactivate E-stop
finish code...

Seems like it should be easy enough to do, but I haven't been able to find anything after a fair bit of digging around, so I'm starting to wonder if this is something I can do.

Any thoughts?

-Matt
Re: Activating/Deactivating E-Stop from within VB?
« Reply #1 on: August 03, 2010, 04:03:55 PM »
Hi,

No offense, but I think either there is a terminology issue here - Or perhaps you want to rethink the desire to disable estop via software.

E-stop circuits are supposed to external to mach and all hardware based. My understanding is that multiple countries have safety regulations which prohibit having software as part of the E-Stop facilities. An E-Stop facility has to always work and can never be disabled. This is not the same as the machine being disabled- when an estop circuit says "don't run", the machine is disabled - but the e-stop logic circuit is not - it is doing it's job of keeping the machine from running.

I suspect the reason that there is no script API for "disabling e-stop" is that this would be a safety problem (and in contradiction of various regulatory agencies).

Consider:
1) mach disables e-stop
2) run some script that causes movement etc - and it goes wrong....
3) operator lunges for e-stop button only to find it is not working (estop is disabled)... very bad mojo.

Now then, if instead of estop, you mean that you want to make Mach3 change states between "ready" and "not ready" - that you can do from a script - it's the reset OEM button call which does this.
Note that you will not be able to make mach "ready" if the e-stop input signal is active - which is how things should be.

Just my 2 cents worth...

Dave


Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com
Re: Activating/Deactivating E-Stop from within VB?
« Reply #2 on: August 03, 2010, 04:17:24 PM »
Dave - you're right, I was using the wrong terminology.

I'm looking to change the state between read & not-ready from within a script.  I know you can create a standalone button to do this, but I haven't been able to write the code to do it within a script.
Re: Activating/Deactivating E-Stop from within VB?
« Reply #3 on: August 03, 2010, 04:55:12 PM »
Ah, ok then ....

Get the latest Programmer's ref manual (v0.22) from the documentation page of machsupport.com
Look at the DoOEMButton() function description, then
see the magic numbers in tables near the end - I think you want button 1021.

Dave
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Activating/Deactivating E-Stop from within VB?
« Reply #4 on: August 03, 2010, 05:04:39 PM »
Dobutton(21)      toggles the estop. If you want a safety then add in a reference to the led in your code

Re: Activating/Deactivating E-Stop from within VB?
« Reply #5 on: August 03, 2010, 06:10:57 PM »
Be aware that DoButton is deprecated - please do not use it for new code.
The older DoButton call is slated to go away in Mach3 V4.

Use DoOEMButton instead.

Dave

Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Activating/Deactivating E-Stop from within VB?
« Reply #6 on: August 03, 2010, 06:57:03 PM »
HIYA Dave, Just to mention that Fanuc learned a valuable lesson long ago about depreciating old code. After that mess they put it back in(;-) pronto.

Just a thought,(;-)
Re: Activating/Deactivating E-Stop from within VB?
« Reply #7 on: August 03, 2010, 07:59:11 PM »
Terry,
The fact is that DoButton should not be used for new code. Period. End of story. No If's, And's or but's about it.  8)
The poster was clearly writing a new script.
There is simply no % in writing new code that uses deprecated APIs.

I just report the decisions as I've been told them:
On V4 the plan is to allow two types of scripts to run:
1) V4 API mode - this will use calls that use the new resource numbering scheme. So these scripts will HAVE to be all new (or rewritten versions of old scripts).

2) V3 compatibility mode - this will be (most of the) existing scripts using V3 API calls.
My understanding of current plans is that DoButton, Get/SetDRO and Get/SetLED et all, are going to be disabled in v4 - including the V3 API mode in V4.   

It's literally been years since the old style calls were deprecated - ever since the DoOEMButton, GET/SET-OEM/User-LED/DRO functions calls were added - that's been a very long time.

I've been in the software game since the late 1960's. - You can believe me when I say that I understand the issues around API changes.

If you want to see some of the issues you're fond of complaining about resolved, you'll have to get used to using some new calls. Some things just can not be fixed using the old API calls - that's a fact.

In all cases,  the use of deprecated calls is a bad idea for new code.

(and it doesn't matter how nice an old API looks on the shelf next to the worn out buggy whip...  :P )

Dave

HIYA Dave, Just to mention that Fanuc learned a valuable lesson long ago about depreciating old code. After that mess they put it back in(;-) pronto.

Just a thought,(;-)
:P
Author of the MachStdMill Extensions for Mach3
www.CalypsoVentures.com

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Activating/Deactivating E-Stop from within VB?
« Reply #8 on: August 04, 2010, 07:10:56 PM »
HIYA DAVE, If you fail to learn from history you are doomed to repeat it. NOT a problem for me as I have NEVER had a problem with dobutton or DoOemButton both work just fine and I bet the old "real" problems people have complained about over the years will still be there in V4.

Here is my point IF you can fix it with a NEW CALL why can't you fix the OLD CALL to work JUST like the NEW call without calling it something new OR just call the NEW CALL  the same thing as the OLD CALL and then do away with the old code. That way ALL the old programs still work.

IF you improved the old WHEEL so it rolled better would you call the new wheel  a "BOX "or still call it a wheel????

PROBLEM SOLVED buggerwhipper style (;-)

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Activating/Deactivating E-Stop from within VB?
« Reply #9 on: August 04, 2010, 08:08:05 PM »
OH heck I forgot, I have been in the machine tool  game since the late 60s-- You can believe me when I say that I understand the issues around MACHINE CODE changes.

(;-) TP