thanks hood I see the software is fairly extensive to say the least!!
would you mind working through an example with me?
lets say I use OEM trigger #1 for a panel mounted N/O push switch with lamp for Feed Hold.
How do I find the Hot key code being used for feed hold already?
or do I create my own code, say 'alt F' (2150) and then assign that code to feed hold command?
once there is and external switch activating feed hold, can an output be linked to it to illuminate the switch lamp?
sorry if this is all fairly elementary, but I racked my brains navigating the software, probably not realizing how it all interacts.
Hot Keys and OEM Codes are different things, Hot Keys are aissigned in the screenset and were basically a way to use a keyboard key as a shortcut to operate a button, for example feed hold or start or whatever. They were handy back in the days of people only having the option of the parallel port and thus limited available I/O.
I personally dislike using hotkeys as there is always the potential to press a keyboard key by mistake and the machine will start to do something. Previously I used HotKeys with a keyboard emulator to add buttons to my panels but as said these days are gone now as there are plenty of ways to get real digital I/O into Mach nowadays.
Ok OEM codes are the codes that are internally assigned in Mach for different buttons, LEDs, DROs etc. You can use them via VB Code, Brains or the OEM Triggers.
Dave has linked to the Wiki page of the OEMs, there is also a xls file pinned near the top of the forum that I made from the wiki, it allows you to have it on your computer for reference without requiring to visit the wiki.
Now your example, personally I would do it via the macropump or possibly a Brain, both would use the inbuilt modbus of the CSMIO controller.
So say for example your button is on Input 5 of the main IP-A and the output (for the LED) is again on the main IP-A and is output 5.
In the macropump you could have something like this
If GetInBit(90,5) Then ' Input on IP-A that switch is connected to
DoOemButton(1001) 'OEM Code for FeedHold (Pause in wiki)
End If
If GetOemLED (805) Then 'OEM code for Pause LED
SetOutBit(90,5) 'Turn on Output on IP-A that the LED is connected to
Else
ReSetOutBit(90,5) 'Turn Off the output on IP-A that the LED is connected to
End If
To use the macropump you first need to enable in General Config page. You can go to Operator menu then Edit VB Script. The Editor will open and you can type in your VB and then save it as macropump.m1s, saving it to the macro folder of the profile you are using.
The macropump loads with Mach so you need to restart Mach everytime you alter the macropump.
In a Brain you could do similar, it is a kind of simple ladder and works well, just do not make it too long as it will be a nightmare to read and edit later on as it doesnt size very well. You can only have one macropump per profile but you can have as many Brains as you wish and thus it is much better to have 20 small brains than one big one, mainly for the reason mentioned above.
I will attach a Brain doing the same as the macropump above in a wee while.
Hood