Hello Guest it is March 28, 2024, 09:35:57 PM

Author Topic: scripting  (Read 1552 times)

0 Members and 1 Guest are viewing this topic.

scripting
« 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.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: scripting
« Reply #1 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.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: scripting
« Reply #2 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...

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: scripting
« Reply #3 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.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: scripting
« Reply #4 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?

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: scripting
« Reply #5 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.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: scripting
« Reply #6 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.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: scripting
« Reply #7 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.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: scripting
« Reply #8 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.

Offline TPS

*
  •  2,501 2,501
    • View Profile
Re: scripting
« Reply #9 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.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.