Hi all,
I'm from KMtronic LTD, Bulgaria (
http://www.sigma-shop.com). We specialize in computer controlled USB and RS485 relays.
One day a friend of mine asked me to find a way control it from Mach3.
Our relays are using BIN(HEX) format RS232 commands and at this moment they do not support MODBUS protocol.
I spent some time and found very nice article wrote by Mr. Henrik Olsson about Serial communication with Mach3 using external DLL.
To make everything simpler, we add function to this Serial DLL for easier control relays.
All in tree steps:
1. Connect USB relay to PC and install the drivers.
http://www.ftdichip.com/Drivers/VCP.htm2. Download DLL and place it in your Mach3 install folder (usually C:\Mach3)
http://www.kmtronic.com/software/Mach3/KMtronicDLL.zip3. Add to your macro or button script ON or OFF command
Command's format:
a = Relay(5,1,"ON") - where "
5" is USB COM port, "
1" is relay number, "
ON" is command, which turns ON the relay number 1 connected to COM5
a = Relay(5,1,"OFF") - where "
5" is USB COM port, "
1" is relay number, "
OFF" is command, which turns OFF the relay number 1 connected to COM5
Note- every script where you use commands has to start with this declaration:
Declare Function Relay Lib "KMSerial.dll" (ByVal comPort As Integer,ByVal numberRelay As Integer,ByVal command As String) As Boolean
We have USB relays with one, two, eight and more relay channels.
Photos:



I will thankful for any suggestions or recommendations from Mach3 users because this is a new area for us.
Thank you in advance,
Krasen