Hello Guest it is April 11, 2021, 02:27:48 PM

Author Topic: Adding outputs controlled by custom buttons  (Read 902 times)

0 Members and 1 Guest are viewing this topic.

Adding outputs controlled by custom buttons
« on: March 17, 2018, 09:33:27 AM »
My first post here.

I have built a  Plasma table from scratch which works well.

I am now adding some extra functionality to it.

It uses a UC400ETH notion controller.


I wish to add a custom button to my mach screen.

I am using the spindle relay on my breakout board to trigger my plasma, I would like that when the custom button is clicked another output operates whenever the spindle does.

Reason for this,  I have mounted a visible laser to the plasma torch and i want the laser to operate instead of the plasma cutter, giving a visual 'Dry run'.

I know I can do this with a mechanical switch but I would like to use Mach3 to control it.

I have used Machscreen to add a button and then I assume I need to write a brain or some VB to complete the task.

If someone could point me in the right direction I'd very much appreciate it.

Offline TPS

*
  •  2,097 2,097
    • View Profile
Re: Adding outputs controlled by custom buttons
« Reply #1 on: March 17, 2018, 10:16:19 AM »
declare Standard code of your button as 34 (execute Basic stript)

then einter this vb code to script


If IsActive(OUTPUT1) Then
  DeactivateSignal(OUTPUT1)
Else
  ActivateSignal(OUTPUT1)
End If
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Adding outputs controlled by custom buttons
« Reply #2 on: March 17, 2018, 11:24:00 AM »
Thanks for the prompt reply.


Re: Adding outputs controlled by custom buttons
« Reply #3 on: March 18, 2018, 01:22:52 PM »
I tried this with some success, I could turn  output 3 on but it didn't turn off again.
Output 1 and 6 did nothing.

What am I missing?

Offline TPS

*
  •  2,097 2,097
    • View Profile
Re: Adding outputs controlled by custom buttons
« Reply #4 on: March 19, 2018, 05:12:38 AM »
sorry Little mistake, right code:

If IsOutputActive(OUTPUT1) Then
  DeactivateSignal(OUTPUT1)
Else
  ActivateSignal(OUTPUT1)
End If

it will only work for Outputs witch are enabled in Config -> Ports&Pins -> Outputs
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Adding outputs controlled by custom buttons
« Reply #5 on: March 19, 2018, 08:02:39 AM »
Thanks Again