Hello Guest it is April 29, 2024, 01:00:14 AM

Author Topic: Execute Button Script with button configured screen designer  (Read 903 times)

0 Members and 1 Guest are viewing this topic.

Execute Button Script with button configured screen designer
« on: January 23, 2024, 06:02:52 AM »
Hi Graham, the script you made works great I tried it.
I would like to ask you, since I control the start cycle from an external button via Modbus and Brains.
I tried to command the button by setting execute button script at the lobe termination, but it doesn't work.
can you help me?
« Last Edit: January 23, 2024, 06:13:40 AM by Giuno85 »

Offline Graham Waterworth

*
  • *
  •  2,673 2,673
  • Yorkshire Dales, England
    • View Profile
Re: Execute Button Script with button configured screen designer
« Reply #1 on: January 23, 2024, 09:31:13 AM »
Mach3 brains is not my strong point maybe one of the other members can help you on this one.
Without engineers the world stops

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Execute Button Script with button configured screen designer
« Reply #2 on: January 25, 2024, 08:40:43 AM »
as far i know there is no direct way to run a VB Script via brain.

your screen button is excecuting your VB instructions and at the the end is call's
the DoButton for Start.

your brain will only excecute the DoButton Start and not the Butttonscript witch is "behind"
the button on your screen.

a possible way might be to set a OEMLed in your brain and the macropump script, witch
is running continious, will react to this OEMLed and excecute the VB commands + do
the start.

vou have to make sure that the code will be only done once if the OEMLed comes true.


and pls avoid double post's. 
« Last Edit: January 25, 2024, 08:42:29 AM by TPS »
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Execute Button Script with button configured screen designer
« Reply #3 on: January 25, 2024, 11:51:55 AM »
thank you very much for the reply, I also published the topic on the forum in the screen designer section.
So I have no way to call a new button created on machscreen with my brain?

Is it possible to call an assigned hotkey with the brain?

the problem is that I customized the start call by doing other things and that's why I modified the button

sorry, I created several posts because it is a topic that touched more than one topic in the forums  :-[ :-[
« Last Edit: January 25, 2024, 11:57:56 AM by Giuno85 »

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Execute Button Script with button configured screen designer
« Reply #4 on: January 25, 2024, 12:27:03 PM »
you can copy your code from Start Button into macropump 1 to 1.

example for macropump.m1s:
Code: [Select]
If ((GetUserLed(1500) = True) And (GetUserLed(1501) = False)) Then
'insert your button code here
'.
'.

'Start machine
DoOEMButton(1000)
End If
'make sure we run the code only one
SetUserLED(1501,GetUserLed(1500))


then modify your brain that the modbus input set's UserLed(1500)
and make sure macropump is enabled in Config->General Config
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Execute Button Script with button configured screen designer
« Reply #5 on: January 26, 2024, 04:44:50 AM »
Thanks for the reply, can I also recall the LED button from the button on the screen?

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Execute Button Script with button configured screen designer
« Reply #6 on: January 26, 2024, 08:08:16 AM »
the LED (green frame arround start button) will come up automaticly when programm is running.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Execute Button Script with button configured screen designer
« Reply #7 on: January 26, 2024, 08:39:18 AM »
I was talking about calling the GetUser Led(1500) by programming the start cycle button with machscreen design as well as calling it with brain and external button.
If you assigned the button as per the attached image, is it correct?

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Execute Button Script with button configured screen designer
« Reply #8 on: January 26, 2024, 08:50:25 AM »
in standard 1024 screenset this small led ring arround the button is assigned to OEMled(804)
witch is the program start LED.

so if you assign it to OEMLed(1500), witch is only a onoe to one copy of your modbus input,
it will only light green as long you press your extrenal start button and will not show that programm
is running.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Execute Button Script with button configured screen designer
« Reply #9 on: January 26, 2024, 09:03:18 AM »
I'm sorry, I explained myself poorly.
what I would like to do is run the program you wrote before

If ((GetUserLed(1500) = True) And (GetUserLed(1501) = False)) Then
'insert your button code here
'.
'.

'Start machine
DoOEMButton(1000)
End If
'make sure we run the code only one
SetUserLED(1501,GetUserLed(1500))



 both from the external button and from the start cycle button to the panel what I would like to know is how to assign the button that you told me to call with brain to the panel button