RS232/485 Serial C++ Example Code

Hello,
is there any example code how to read/write on a RS232 or RS485 module based on the “C++ OptoMMP Software Development Kit for SNAP PAC” code? We have SNAP-SCM-232 and SNAP-SCM-485-422 modules.

Thanks.

Hello uca,

Welcome to the OptoForums! I’m not sure that SDK is what you need for what you’re doing – unless you’re just trying to configure the modules (which is an OptoMMP function, which could also be done using PAC Manager).

How best to read/write your serial data to/from that module will depend on what else you have going on there. What brain/controller do you have on that same rack w/the modules, perhaps SNAP-PAC-EB2 or SNAP-PAC-R1 or 2?

FYI – once you have those SCM modules configured, you can access them from anywhere via TCP/IP using the IP address for your brain/controller, and the port number of the particular module & port (those numbers start at 22500 by default).

I like [U][B]PuTTY[/B][/U] as a test tool. You can use PuTTy from your computer to open a connection to the port on your module and see that the LEDs on it flash when you send stuff out, or see what’s coming in, before you add another layer of complication via your software – whether it’s software you’re writing yourself in C++ or some OptoScript/Action Blocks you’s written in your strategy (on an Opto 22 controller) using a [URL=“http://www.opto22.com/community/showthread.php?t=673”][U][B]tcp comm handle[/B][/U] to connect.

Can you tell us a little more about your application?

Cheers,

-OptoMary