YES, this can be done, but it helps if you have the exact equipment to Verify the operation as you are developing the code.
I've come up with an "RS_232-485 Slave Simulator" in LabVIEW that will
just listen on a Serial Port and capture the Requests,
Parse them, and, if desired, provide a Hard-Coded response.
The KEY is that the Serial Parameters must all be the SAME:
Baud, Parity, Bits, Stop-bits, etc. My default is 9600, None, 8, 1
This ALSO works for the 'special' RS-232 devices that
use an '=' and '#' as the first character of the message.
This is very handy when setting up new equipment or software,
writing Software Drivers for legacy equipment,
and as a troubleshooting tool for existing systems.
=
A few issues that can trip you up:
- Some RS-485 devices have the + and - identification of the communication lines WRONG,
- Not ALL devices need or will use the 'extra stop bit' when using No-Parity,
- Be aware when some DATA is using HEX codes versus ASCII codes - looks the same at first!