Hello,
Why not use ethernet?
I give support to Unitronics OPLC's and Cognex Vision Systems at Isotron in the Netherlands, and made already communication with it together.
I always used the ethernet, and not the serial.
But you can go with Modbus, or native mode, depending on the task you will do.
Attached 2 examples, one for Modbus and one for native mode.
If you need more, let me know.
Remco Labordus
Cognex Insight with Vision OPLC Modbus TCP.zip
cognex unitronics.vlp