Hello Guest it is April 19, 2024, 12:58:39 PM

Author Topic: OEMtrig  (Read 4108 times)

0 Members and 1 Guest are viewing this topic.

Offline Holk

*
  •  16 16
    • View Profile
OEMtrig
« 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 

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: OEMtrig
« Reply #1 on: February 21, 2021, 04:04:52 AM »
you have to create two scripts.

first lets say it is M333.M1s

Code: [Select]
SetTRiggerMacro 334            'Set Macro M334 for OEM-Code 301

M333 Needs to be added to init string

the entire macro will be M334.M1S
Code: [Select]
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
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Holk

*
  •  16 16
    • View Profile
Re: OEMtrig
« Reply #2 on: February 21, 2021, 05:02:41 AM »
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 ?

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: OEMtrig
« Reply #3 on: February 21, 2021, 05:27:11 AM »
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 :
Code: [Select]
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]
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Holk

*
  •  16 16
    • View Profile
Re: OEMtrig
« Reply #4 on: February 21, 2021, 05:46:38 AM »
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 ?

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: OEMtrig
« Reply #5 on: February 21, 2021, 06:11:23 AM »
yes thats it.
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Holk

*
  •  16 16
    • View Profile
Re: OEMtrig
« Reply #6 on: February 21, 2021, 07:03:31 AM »
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

Offline Holk

*
  •  16 16
    • View Profile
Re: OEMtrig
« Reply #7 on: February 21, 2021, 07:14:57 AM »
One more... when i push start it say in status Line... cannot reverse run from present feedhold 🤔

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: OEMtrig
« Reply #8 on: February 21, 2021, 09:41:15 AM »
try to use this, only to see witch Trigger Comes up:

Code: [Select]

( 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



anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline Holk

*
  •  16 16
    • View Profile
Re: OEMtrig
« Reply #9 on: February 21, 2021, 11:33:05 AM »
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