I have just ordered a K8056 8-relais board, which I plan to control through its serial connector. My question is: where can I get a cable that has a DB9 plug on one side and the necessary loose ends on the other side for connecting to the K8056 board? Or is something like that included with the board? I thought that maybe I can just buy a normal DB9-DB9 cable and cut it in the middle, but this seems a rather barbaric way forward and anyway I wouldn’t know which line is which. please help!
As cable with 8 of 9 conductors (+ ground) is not very easy to find and otherwise rather expensive, it won’t be the first time that I buy a cable and cut off one plug at one end… With a multimeter you can easily find which conductor is connected to which pin.
Alternatively you can get a DB9 connector and “make” a cable.
Thank you Laserguy and MostlyHarmless. I have heeded your advice: I have cut a serial cable in half, and connected the output to PIN3 and PIN5 to the board. In the meantime, I have assembled the board, soldered the 200 pieces (drove me half-crazy…) and all the relais seem to work fine as tested with the on-board button.
Now I am trying to connect to the PC. I have a USB-to-serial adapter which results in COM7 being activated. I tried the velleman software, but it crashes with “runtime error 8002”. Maybe it’s incompatible with Win7-64bit. Anyway, I will need to run serial commands from a PHP script, hence it does not matter.
Can you guys help me with the parameters? I need just 4 commands: relais 1 ON, relais 1 OFF, relais 2 ON, and relais 2 OFF. Can you give me some hints on the syntax that I should use to execute these commands through the serial interface? I guess it would be something like:
$Relais1On = chr(13)."1"."whatdoiknow";
Any help would be greatly appreciated!!!
Due to the age of the software, it expects ‘COM1’ or ‘COM2’, otherwise it does not see a COM-port.
If you can change the COM-port#, it should work fine.
The command sequence is explained in the K8056 part list or you can check the source code of the demo program.