Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started 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.
-
in Config -> Ports&Pins -> Input Signals you can define Inputs directly to jog axis.
might be the easier way.
-
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...
-
i have tested this Little code:
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.
-
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?
-
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.
-
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.
-
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.
-
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.
-
not 100% sure but i think you can just type in 245 in the buttonpress window in the brain without using the Dropdown list.
-
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.
-
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.