I'm trying to read values from an industrial scale via sr232 and I've managed to get it working when connected to a pc, however when I connect it to an arduino, the arduino doesn't seem to be receiving anything. The scale is able to send the measured value when being prompted through commands or automatically after being toggled. Even when toggled the rx led of the sr232 to ttl module won't blink.
I've been going at this for a while and don't know if the problem lies within the code I've written or if its got something to do with the electronics.
For context,
The scale is analogic but uses a trasducer (specifically an aed9101d) to turn the signal digital, uses external 24V power.
Using an arduino uno.
Using a sr232 to ttl converter with a max3232 powered with the arduino.
Using 9600 bauds, 8 bits, even parity and 1 stop bit.
Using termite/serial port monitor from pc for debugging.
Small programs using serial communication between pc and arduino show no apparent issues.
The following is a small program I've tested with the pc which mimics the scale.
Is the serial port of your scales set up to use any hardware handshaking? I think you can check this if you set your serial port flow control parameter in your PC terminal program to none (or similar).
Can you change your scale parameters to use no parity? If so, I would suggest using a software serial port to communicate with the scale rather than try and use the hardware serial port for both comms to the scale and serial printing.
On retrospective It does feel like talking to a wall, so it very well may be the handshaking signals you speak of. I'll rummage through the house and see if i find one or I'll get one tomorrow. I'll get back when I test it. Thank you.
In the Arduino sketch, it may not be a great idea to 'force' a delay after the msv? is sent to the scale. It might be better to go straight to trying to read the serial output from the scale immediately without a delay.
When you say you have tested the Arduino code with the PC, do you simply mean from the serial monitor in the Arduino IDE? If so, you may be making an assumption about the timing of the response from the scale which is not accurately represented when you are simulating the communication with the Arduino from the serial monitor.
Another way to test this would be to write a separate piece of code (such as in Processing) that emulates the scale in terms of waiting for the msv? command and then responding with a value and try to get the Arduino to communicate with the Processing sketch. This may be a better simulation of how the scale really responds.
You can do this with a USB to RS232 cable, so that the Processing sketch on the computer really communicates with the Arduino in the same way that the scale would.
I've also tried to communicate with the scale with no delays to no avail. I added the delay afterwards with the addition of the physical button to not send several instances of the command when I press it.
I've handled communication with the computer through a sr232 to usb adapter with no connection to arduino IDE, but I've done the simulation of weights by manually inputting a number and hitting enter in the termite terminal as I'm only trying to check if comms work.
Also, I think I've found a null modem but It's also female to female so I'll see if I can splice it.