I am working on a project for work to record the amount of time some of our machines are not running.
These machines already have a light that comes on when they are running and we found the relay for that light has a couple extra ports on it.
My plan was to simply run some wires from the relay on the machine to the serial port in the back of the PC. (each machine has its own pc) Then make a program to monitor the serial port and write a time stamp record to a database.
Soon enough I had everything working on my test bed. I would connect pins 1 & 4 (sending comm event 5) if the machine was down and 7 & 8 (sending comm event 3) when the machine is running.
Initial testing on the machine showed it was working well too, but it was all short lived.
The next machine we installed everything on would write several records in a second for a few seconds every time the machine started or stopped.
The status would alternate as well meaning that the pc was receiving a comm event 3 & 5 repeatedly.
The first machine is still running fine, but we have had more & more machines pop up with this same issue.
I am more of a programming guy, and this is my first time getting into 'hardware', although I would like to do it more.
I am really running out of ideas on why this is happening. My last guess is the fact that the wire going from the pc to the relay is running next to very high voltage lines for the machine (480v). Could this be causing signals to run through the wire. (I am using unshielded cat5 cable)
Go easy on me I am no electronics guru.
Thanks for any help.
These machines already have a light that comes on when they are running and we found the relay for that light has a couple extra ports on it.
My plan was to simply run some wires from the relay on the machine to the serial port in the back of the PC. (each machine has its own pc) Then make a program to monitor the serial port and write a time stamp record to a database.
Soon enough I had everything working on my test bed. I would connect pins 1 & 4 (sending comm event 5) if the machine was down and 7 & 8 (sending comm event 3) when the machine is running.
Initial testing on the machine showed it was working well too, but it was all short lived.
The next machine we installed everything on would write several records in a second for a few seconds every time the machine started or stopped.
The status would alternate as well meaning that the pc was receiving a comm event 3 & 5 repeatedly.
The first machine is still running fine, but we have had more & more machines pop up with this same issue.
I am more of a programming guy, and this is my first time getting into 'hardware', although I would like to do it more.
I am really running out of ideas on why this is happening. My last guess is the fact that the wire going from the pc to the relay is running next to very high voltage lines for the machine (480v). Could this be causing signals to run through the wire. (I am using unshielded cat5 cable)
Go easy on me I am no electronics guru.
Thanks for any help.
Last edited: