Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Winch on May 23, 2021, 04:10:48 PM

Title: scripting
Post by: Winch on May 23, 2021, 04:10:48 PM
Hi, hope this is the right place. I am trying to set up a semi automatic control for welding and want to move the axis by button and joystick but with some conditionals. I need to use VB script and so far have tried dooembutton (307). I have used this as button code and also saved it as a macro and called it from button code. neither work. I used oem 114, (mist) just to check my coding and that worked fine.
I tried jog on and off, no joy when run from button or macro but worked if run from VB editor.
I am curious to know why this is.
is there some way to move an axis without specifying a destination in script?
Thanks in advance.
Title: Re: scripting
Post by: TPS on May 24, 2021, 04:15:56 AM
in Config -> Ports&Pins -> Input Signals you can define Inputs directly to jog axis.

might be the easier way.
Title: Re: scripting
Post by: Winch on May 24, 2021, 03:35:34 PM
Thanks for that, it does not explain why I don’t seem to be able to use oem code 307 in script however if I use a joystick via the inputs you suggest I can inhibit it using oem 290 and might be able to do what I want. Need a bit more time to check...
Title: Re: scripting
Post by: TPS on May 25, 2021, 01:35:49 AM
i have tested this Little code:

Code: [Select]
DoOEMButton(307)
DoOEMButton(309)
Message "i am here"

in a button here, and it worked the only Problem is that the OEMButton's 307... will only start the jog movement,
witch Needs to be stopped via OEMButton's 334....

i allways did "extrenal" Jogging via Brains, not by VBScript.
Title: Re: scripting
Post by: Winch on June 08, 2021, 01:36:17 PM
Thanks TPS, been playing with brains, that is the way to go as you suggest. Having an issue though, can’t get oem trigger to work from brains. The output lights green but does not operate the button I have assigned it to. If I use a hard wired input to the same oem trigger it works the button. Do you know what I might be doing wrong?
Title: Re: scripting
Post by: TPS on June 08, 2021, 01:41:45 PM
for the Moment i am not able to catch what you have assigned to what.

you are talking about OEMTriggers and Outputs witch light green ? sorry no idea.

some screenshots may help.
Title: Re: scripting
Post by: Winch on June 08, 2021, 03:15:46 PM
Ok, I have some logic in brains with a terminator from the drop down list as oem trigger 2.
When I watch the brains run the terminator goes green as I expect when the conditions are met.
In the hot keys drop down I assign oem trigger 2 to a button say oem114 just to test but it does not operate.
If however I set an input pin in ports and pins to oem trigger 2 and switch the input high it operates the button 114.
So it seems the oem trigger works via the input pin but not via brains.
I hope that makes sense, I cannot send pics at the moment.
Title: Re: scripting
Post by: TPS on June 09, 2021, 01:50:25 AM
ok now i got the Problem.

do not use an OEMTrigger as Terminator of the brain.
use the OEMButton itselve as Terminator.

it is called "Buttonpress" in Brains if you create the Terminator.
Title: Re: scripting
Post by: Winch on June 09, 2021, 04:25:40 AM
Unfortunately the buttons I want to use are not on the button press list, 245 for instance. So I guess I am back to trying to find out why the oemtrigger #2 does not work for me. The drop down list offers 15 of these oem triggers so plenty of scope for customisation.
I am aware this has progressed somewhat from the original topic, should I repost under the brains topic?
Thanks for your speedy replies.
Title: Re: scripting
Post by: TPS on June 09, 2021, 04:56:38 AM
not 100% sure but i think you can just type in 245 in the buttonpress window in the brain without using the Dropdown list.
Title: Re: scripting
Post by: Winch on June 09, 2021, 05:07:33 AM
You are right, that works, so my problem solved. Would be nice to understand how the oemtrigger is meant to work sometime. Tried reading up on it but info seems sketchy.
Thanks again.
Title: Re: scripting
Post by: TPS on June 09, 2021, 06:26:59 AM
basicly OEMTriggers are used like regular input's but they Special functionalty

1st. you can assign in Config->System hotkeys oemcodes to a OEMtrigger witch will be done once if OEMTrigger comes true

2nd. you can define a triggermacro by SetTriggerMacro(number)

normaly done this way.

-add for example in Config->General Config ->Initialisation string  M333, that means every time you reset M333.M1s is called

-within M333.M1s add the VB code SetTriggerMacro(334)

-assign in Config->System hotkeys oemcodes to a OEMtrigger the code 301 witch means run triggermacro

so every time the OEMTrigger Comes True the VB Code within M334.M1S will run once.

hope i was able to explain the Basics of OEMTriggers in my bad bavarian english. 

Title: Re: scripting
Post by: junglecruisefullmovie on July 24, 2021, 07:18:45 AM
Watch Jungle Cruise Full Movie Download (https://junglecruisefullmovie.com/)
Watch Jungle Cruise Full Movie Free (https://junglecruisefullmovie.com/)
Watch Jungle Cruise Full Movie Online (https://junglecruisefullmovie.com/)
Jungle Cruise Movie 2021 (https://junglecruisefullmovie.com/)
Jungle Cruise Full Movie HD (https://junglecruisefullmovie.com/)
Jungle Cruise Full Movie Free (https://junglecruisefullmovie.com/)
Watch Jungle Cruise Full Movie HD (https://junglecruisefullmovie.com/)
Jungle Cruise Full Movie Free Download (https://junglecruisefullmovie.com/)
Jungle Cruise Download Online (https://junglecruisefullmovie.com/)
Jungle Cruise Full Movie Download (https://junglecruisefullmovie.com/)
Jungle Cruise Download (https://junglecruisefullmovie.com/)
Watch Jungle Cruise Online (https://junglecruisefullmovie.com/)
Jungle Cruise Online (https://junglecruisefullmovie.com/)
Jungle Cruise Full Movie Online (https://junglecruisefullmovie.com/)
Jungle Cruise Full Movie (https://junglecruisefullmovie.com/)
Watch Jungle Cruise (https://junglecruisefullmovie.com/)
https://junglecruisefullmovie.com (https://junglecruisefullmovie.com/)
Jungle Cruise Full HD Movie online (https://junglecruisefullmovie.com/)
Jungle Cruise Movie online (https://junglecruisefullmovie.com/)
Jungle Cruise 2021 (https://junglecruisefullmovie.com/)
Jungle Cruise Full Movie 2021 (https://junglecruisefullmovie.com/)
Jungle Cruise Movie online Free (https://junglecruisefullmovie.com/)
https://junglecruisefullmovie.com (https://junglecruisefullmovie.com/)
junglecruisefullmovie.com (https://junglecruisefullmovie.com/)
Jungle Cruise Full Movie (https://junglecruisefullmovie.com/)