Given the fact you say the problematic function is serialport.write(xxx), I understand your Modbus PLC is not working with Modbus TCP, so you can be under 232 or 485...
Are you sure that the Modbus PLC you are trying to communicate to is configured to use 232?
If not you will need an adaptor from 232 to 485 in your PC.
Apart of that, it would be a good idea to get a MODBUS sniffer to attach it to your network and see what is happening with the packages that are sent/received...
Take a look at those links:
I've searched "Modbus sniffer" in google to find them.
PS: keep in mind that Modbus (as almost all the fieldbusses out there) require that the addresses are well positioned... double check them.
The typical problems I encountered working with Modbus have been:
1. bad addresses.
2. resistors wrong placed.