Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: Holk on February 21, 2021, 01:33:01 AM
-
Hi...
I have a question.
I would like to have 5 buttons to work, and the first one i have set to OEMtrig#1000, set all in pin and ports... and it work, when i push it start the machine, but i would like it to turn on the led in the button when i push, and the 4 other should be turn off, so i have try to make a little script, but i this its here some is wrong
If isactive (oemtrig1) then
activatesignal(output2)
end if
And so on...
but the light do not turn on, the machine start when i push but no light, i have write in the file name in the ini string, so it should be loaded, and i have set it to load when " reset "
Any good ideas ?
Just to test i have change the activ low, just to see if they work, and all 5 buttons do work, so i think it the script or ?
Thank you in advance
-
you have to create two scripts.
first lets say it is M333.M1s
SetTRiggerMacro 334 'Set Macro M334 for OEM-Code 301
M333 Needs to be added to init string
the entire macro will be M334.M1S
If IsActive (OEMTRIG1) Then
activatesignal(output2)
End If
this will do the necessary code.
every OEMTRIG witch should call M334.M1s must be Setup with OEMCode 301 in System Hetkey Setup
-
Super answer...
i will try to make 2 files, but if all 5 OEMtrig should be set to 301, to read the script, then i would maybe tell in the script what OEM function i want ?
so it know that i want function 1000 on oemtrig 1 and it should turn on output 2 ?
So the first file M333 tell... when a oemtrig will be activatet, look in file 334 ?
-
i will try to make 2 files, but if all 5 OEMtrig should be set to 301, to read the script, then i would maybe tell in the script what OEM function i want ?
exactly
so it know that i want function 1000 on oemtrig 1 and it should turn on output 2 ?
so set OEMcode for OEMTRIG1 to 301 and the in the macroscript 304 :
If IsActive (OEMTRIG1) Then
DoOEMButton(1000)
activatesignal(output2)
End If
So the first file M333 tell... when a oemtrig will be activatet, look in file 334 ?
thats the was it is.[/code]
-
Do you think it could look like this
( For start function )
If IsActive (OEMTRIG1) Then
DoOEMButton(1000)
activatesignal(output2)
deactivatesignal(output3)
deactivatesignal(output4)
deactivatesignal(output5)
deactivatesignal(output6)
End If
( For stop function )
If IsActive (OEMTRIG2) Then
DoOEMButton(1003)
activatesignal(output3)
deactivatesignal(output2)
deactivatesignal(output4)
deactivatesignal(output5)
deactivatesignal(output6)
End If
and so on ?
-
yes thats it.
-
Now i have try and its almost work...
When i push it do the function, and there come light in, i have try with start, but it i then push stop nothing happen, but if i change oem code in the script so i start on another button then this work, its like it only read one button, and not read the rest
-
One more... when i push start it say in status Line... cannot reverse run from present feedhold 🤔
-
try to use this, only to see witch Trigger Comes up:
( For start function )
If IsActive (OEMTRIG1) Then
MSGBox "Trigger 1 hit!"
DoOEMButton(1000)
activatesignal(output2)
deactivatesignal(output3)
deactivatesignal(output4)
deactivatesignal(output5)
deactivatesignal(output6)
End If
( For stop function )
If IsActive (OEMTRIG2) Then
MSGBox "Trigger 2 hit!"
DoOEMButton(1003)
activatesignal(output3)
deactivatesignal(output2)
deactivatesignal(output4)
deactivatesignal(output5)
deactivatesignal(output6)
End If
-
thanks i will try later today... do you know it oemtrig should have low activ or not ? and i guess output should be with out low activ
-
low or high active depends on how your Inputs are connected.
for are quick try you can assign port/pin pin to spare Input and check on diagnostic page
via led's for right Level.
-
So i have try it... and it give the msg on all of them, and when i push there come light in, but if i push oemtrig 1 the machine start, and it i after push oem3 to stop it nothing happen, but it i reset again and push oem3 them i light and stop activate, but i can only push one oem, and then it do not react
My idea
Make a file pr oem and in the Main file write a triggermacro Line with all the file names
Oemtriggermacro 334
Oemtriggermacro 335
Oemtriggermacro 336
As example ?
Or do you have an idea why its only read one oemtrig ?
-
in the sample code oemtrig2 is for stopping not oemtrig3
you can Setup only one triggerfile
pls post your m333.m1s and m334.m1s and a screenshot of your System hotkey Setup Screen.
-
i have call it 1919 and 1920 i should not make any difference
-
little more
-
have you tryed to disable achtive Low?
-
real i think... not from keyboard
-
from the box
-
have you tryed to disable achtive Low?
-
this files are running, i have tested them.
-
Cool... when i come home today i will try your files, i can see they are little different then mine...
I write later today, thank you for help
-
So... i have try, and it work, first 1-2-3-4-5 blink and its done, i think its because all are true, maybe i should make oem1 true and 2-3-4-5 false
And oem 2 true and 1-3-4-5 false
Could that work