Issue with RS 232 on the brain


Hi all,

This is a two part issue :

1.I was wondering if there is a way to test if the RS232 communication on our R1 brain is working or not.

  1. Is there a way to see what string is [B]sent[/B] to the via communication handles ? I am getting a -39 error which is that there is no receiving so I ask my first question but I was wondering if the issue is whether what is being sent is “”.



I have tried to use the command “Get Number of Characters Waiting” command before using the ReceiveString Command and that commands spits out 0 during Debug mode.

Is there a similar command that I could use to check how many characters are being [B]sent[/B] ?


One relatively easy way to do what you want is to disconnect your rs232 device, and instead tie together the TX and RX pins on the R1 RS232 connector. Anything you send will then show up in the receive buffer and can be looked at with the commands you mention above. This is how I’ve done most of my debugging.

If you google “Serial Port Monitor” you will find both commercial and freeware software that will give you more diagnostic capabilities, but someone else will have to jump in with a recommendation.


Thank you sensij! We have resolved the issue that we were running into.

  1. There was a live communication and the PSG at OPTO told me to do the same thing as sensij mentioned.

  2. I do not have an answer for this one yet, however the problem we were running into was that we were going too fast through the chart and not waiting for the string to be sent work. When we inserted a time delay of 5mSec and added a decision block, it worked!

Just wanted to say thank you OPTO PSG.


FYI, assuming you’re using the built-in 232 port on your R1, there are a couple of other options for troubleshooting.

  1. Don’t forget the 232 LED on the SNAP-PAC-R1 (or -R2) itself. That will blink when there’s data.

  2. There’s an option in the memory map to turn on logging of data to/from that port. You’ll get a file that looks like this:

From my “ser:” comm handle, I was sending “testing testing 1234” – the O before each letter here = “Out” (you’ll see an “I” before “Incoming” data).

This file is generated by the PAC in the file area, I like to use Firefox to browse to that file and easily look at it:

Here’s the place in PAC Manager where you can turn this handy feature on. Be sure to turn it off when you’re done troubleshooting, because it does require resources on your SNAP-PAC you’d rather use for other things:

Hope that helps!