You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old February 16th, 2017, 07:08 PM   #1
notarealuser
Member
United States

notarealuser is offline
 
Join Date: Dec 2015
Location: the internet
Posts: 4
Tech Using the rs232 ascii functions on an slc5/03

Hello,

I am an apprentice and ee student and I have been trying get a slc 5/03 to report temperature data and system status history at a fixed time interval into a microcontroller based system for a self learning project.

I have all the data structures setup and functioning properly, and the ascii instructions seem fairly straight forward and capable of doing everything I want them to do.

HOWEVER, when I go to actually do a AWT ascii write, I seem to not be sending data. Even hyperterminal shows no data being sent. I've checked my rs232 settings like stop bits and baud rate.

When I turn on chan 0 system on I get a repeating string of nonsense but when chan 0 is off I get absolutely no rs232 output.

Clearly I'm missing something. Anyone care to throw me some ideas to work with? is there a better method to see what my slc is actually sending out other than hyperterminal?
  Reply With Quote
Old February 16th, 2017, 09:06 PM   #2
notarealuser
Member
United States

notarealuser is offline
 
Join Date: Dec 2015
Location: the internet
Posts: 4
it is worth mentioning that my chan0 system driver is disabled in channel configuration and my chan0 user driver is set for ascii, but my ascii commands are all faulted out with 04.

which means my channel configuration is not set to user.

I'm 99% sure I have all the 'hard' stuff right, and I am missing something blindingly obvious.
  Reply With Quote
Old February 16th, 2017, 09:31 PM   #3
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 13,002
Welcome to the Forum !

On the General communication setup tab, in the lower Channel 0 section, set the Mode to "User".

Leave the Channel 0 System Mode on DF1 Full Duplex. I think that "Shutdown" disables Channel 0 entirely.

Set the Channel 0 User Mode to ASCII and configure your speed, serial framing, and termination characters.

Now re-examine your repeating string of nonsense. It's probably because of a mismatch in the serial data rate, or the serial framing.

In general when you see mostly 0xFF, it means that the port is transmitting more slowly than you expect, so the UART is seeing mostly 1's.

What sort of microcontroller are you using ? Does it have an internal or external UART ?
  Reply With Quote
Old February 16th, 2017, 09:34 PM   #4
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 13,002
Also: Ditch Hyperterminal, get yourself RealTerm. Tricky to set up, but it's a real engineering tool while Hyperterminal is a frustrating Windows utility. Ask me how I know it'll silently cut out 1/3 of repeat characters in a binary data stream.

And: If you plan to do a lot of RS-232 work, invest in a Stratus Engineering EZ-Tap. Best value for the money for serial intercept, by a lot.
  Reply With Quote
Old February 16th, 2017, 10:59 PM   #5
notarealuser
Member
United States

notarealuser is offline
 
Join Date: Dec 2015
Location: the internet
Posts: 4
Thanks, you nailed it. So obvious it hurts! I was starting to wonder if the module wasnt defective as s;33/3 was defaulting to 1 even after I factory reset the card before and after I downloaded my program. But presumably s:33/3 is 1 by factory default and in my previous program settings.

I'm still having some kind of issues but I have an output and it is repeatable and of the same structure I intended it to have. So I have my mount molehill for this weekend.

I'm trying to send the data to an arduino mega. It will probably be replaced at some point by something not hilariously cheap, but at that point I will be much more ready to reprogram that part of the project in a more serious language on more serious hardware.

Sometimes I'm all but certain I'm building a Rube Goldberg machine(SLC > Serial > Arduino > TCP/IP > Webserver > Android App. But regardless I enjoy it and I consider it part of becoming a well rounded technical professional. I've really learned alot about how to learn quickly working on this project.

great tip on REALTERM. Thank you very much.
  Reply With Quote
Old February 16th, 2017, 11:02 PM   #6
notarealuser
Member
United States

notarealuser is offline
 
Join Date: Dec 2015
Location: the internet
Posts: 4
And that has to be a good horror story, dealing with the repeating binary stream, do share. Was it on a professional job? I can image some highly uncomfortable hard to explain amounts of downtime before you get to the point where you catch that.
  Reply With Quote
Old February 17th, 2017, 11:06 AM   #7
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 13,002
Hyperterminal had a strange bug where if you typed the same character three times in a row, the third byte would not be transmitted. It only showed up if you had a corrupted saved configuration file, so it was a bear to find the issue.

And Hyperterminal isn't very good at handling unprintable hex data.

So I use RealTerm. Its GUI is all hacked together and its documentation can be sparse, but I'm confident that when I send and receive hex bytes that I'm getting what I expect.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
PLC5 and Factory talk view studio 7 jasonm LIVE PLC Questions And Answers 12 October 15th, 2014 04:19 PM
S7-1500 CM541 Serial RS232 ASCII help surajchem LIVE PLC Questions And Answers 0 July 21st, 2014 09:51 PM
Micrologix 1100, ascii string, ethernet, rs232 lloydsteve LIVE PLC Questions And Answers 1 April 17th, 2009 11:37 PM
s7 200 and printer SHYAMAL LIVE PLC Questions And Answers 6 August 12th, 2008 01:47 AM
RS232 ASCII String - How to put in a register? donl517 LIVE PLC Questions And Answers 5 July 27th, 2006 05:39 PM


All times are GMT -5. The time now is 08:34 AM.


.