Sign in to follow this  
Followers 0
Guest Eyoung4321

How To Read Ascii Data From Slc5/04

9 posts in this topic

Hello, I am completely new to the world of PLC's, and after reading through several forums about PLC's, specifically the SLC5/04, I am still very much in the dark. I am looking for the simplest way to connect a SLC5/04 to a PC running Windows 2000 in such a way that I can read ascii values stored in the PLC. Is it possible to use a serial cable (RS232) to accomplish this? And if so, what format would it come across in and how would I be able to interpret the data? If there is a reference that I can look at to answer these questions, I would greatly appreciate a link. Thanks in advance, Edward

Share this post


Link to post
Share on other sites
The quick answer to your question: Yes, it (probably) can be done. But - how difficult will it be? To answer this one, we need to know some more facts. What does the ASCII data look like? Specifically, is it stored in simple bytes, or in strings? Either way, how long is each data "record" going to be? (2 bytes - 40 characters?) Are all the records of data the same length or do the lengths vary? How did the ASCII data get into the SLC in the first place? (In other words, do you personally have any control over its format?) Is the data in the SLC stored in an ASCII-type file; or in a STRING-type file? (The SLC-5/04 supports both. And incidentally, thank you for telling us up-front what type of processor you're using). And most important of all - what program will be running on your PC to handle this data? Will the PC program need to "query" the SLC and ask for a specific data record - or will the SLC continuously "post" the data records out through the communication port? What budget do you have to work with? (Suppose - just for the sake of argument - that you needed the RSLinx Pro software package - list price about $1600. Would you be able to handle that?) Will you be able to program the SLC using the DataHighway+ connection - thereby leaving the "comm port" free for experiments? (If you were planning on programming through the "comm port" - change your plans. And if you don't already have a DataHighway+ programming connection, add about $2000 to your budget). There may be (many) more questions along these lines as things move forward. Finally (at least for now), what type of deadline are you facing for successful completion of this project? (As-Soon-As-Possible is NOT an acceptable answer). Honestly, this is NOT a simple "beginner" type assignment. It's probably quite do-able, but many more-experienced programmers would quietly shy away from this one if given the chance. In simple terms, this ain't going to be your basic "traffic light" type programming exercise. You're about to get your feet wet - by diving head first into the deep end of the pool. Should you choose to answer the questions above, please use examples wherever possible - such as: --------------------------------------------------------------- My data will be stored in ST9:0 through ST9:9; the lengths of the strings will vary between 2 and 60 characters. An example string would be: ST9:0 = hello, world ---- OR ------------------------------------------------------- My data will be stored in A10:0 through A10:255. The lengths of each record will always be 12 bytes long. An example record would be: A10:0 = he A10:1 = ll A10:2 = o, A10:3 = w A10:4 = or A10:5 = ld ----------------------------------------------------------- Best regards - and best of luck, Ron

Share this post


Link to post
Share on other sites
I have done quite a bit of work with the 504 and ascii. but as -guest- mentioned it may be difficult and there is much more info that is needed. It is fairly simple to have the PLC 'post' the info regularly or to have another device request a 'fixed' transmission. But, if you need to collect data from different places 'on the fly' (not known at design time) this reqires extra work to parse the request, get the info, and then transmit. But I have done all of the above and it is possible. As for the PC side a simple VB program could be written to attach a serial port, request and recieve the data, and then possibly send the data to another program. Also there used to be a program available called the "Software Wedge" that did this also. If anyone knows how to structure a system request to read/write an address (the method a panelview uses to read/write data) I would like to know.

Share this post


Link to post
Share on other sites
Yo, Monkey, This might be what you're looking for - check out Chapter 7 for starters. DF1 Protocol Manual Good luck, Ron

Share this post


Link to post
Share on other sites
Thanks Ron. This is exactly what I was looking for

Share this post


Link to post
Share on other sites
Ron, you have been very helpful with your questions - thank you. monkey, any help you could give would be greatly appreciated. I have been doing more reading, and it seems the more I read, the more I find out that I don't know - this stuff is like black magic I have a .pba and a .rss file. I think I need to get PanelBuilder to view these files, right? Also, I read about the Allen Bradley Active X Control from CimQuest (http://www.ingear.cimquest.com/allen-br1.htm). It looks like it might be what I need for simple communication between the PLC and the PC. The basic setup is that the SLC5/04 is connected to a testing assembly. The testing assembly runs a test on a product and sends the results to the PLC. I would like to write an application for the PC that would be able to pull those results from the PLC. I imagine the PC will have to poll the PLC until it detects a "finished testing" value, then pull the values. Now that I have been presented with a bunch of questions, I will have to go and find out the answers and then post better focused (hopefully :-p) questions, but I just wanted to give a quick thanks to people on this forum for their patience and generosity. Ed

Share this post


Link to post
Share on other sites
Well, you need Panelbuilder32 to view the .PBA..... RSLogix500 to view the .RSS

Share this post


Link to post
Share on other sites
Ed, If you have a .pba file, then there is probably a PanelView (which you haven't mentioned) connected to your system. If all you need to do is "display" the test result values (for example: so that an operator can read them), then setting up the PanelView to do that shouldn't be too hard. If, on the other hand, you want the PC to STORE the test result values in a database (for example: to be analyzed at some time in the future), then things will get a lot stickier. Best regards, Ron

Share this post


Link to post
Share on other sites
Ed, From taking a quick look at the active-x control you referenced, it does indeed look like it can do the job. Assuming you can program VB to use the control, you should be able to extract data from the PLC without using any extra logic in the PLC !! The Standard version ($499) will only work with DF1 point to point using the serial ports on both PLC and PC. The studio version ($999) can use the DH+ port of the PLC leaving the serial port open on the PLC (maybe your testing assembly is communicating through this port already?) But, beware you will need extra hardware on the PC side to use this option (KT card etc) If cost is not an isuue this is probably the better solution. If you use either of these solutions involving the active-x control you should get the data out exactly as it appears in the PLC (the PLC and the Active-X control should handle adding/parsing extra info needed to transfer the data - something you would have to create and do yourself if you didn't use this control) Good Luck, Monkey

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0