ddean

ASCII assistance for writing serial

8 posts in this topic

I am needing some help developing a string, and setting up communications that will be interpreted by a printer. I have thus developed my string, setup my com ports on my 1766 micrologix and setup com ports on my schmidt styliner scribing printer with win7e. Essentially this is plc to computer running software for a printer. the software has been setup to the best of my knowledge. My problem is creating a string that will be recognized as start/stop transmission at the printer. I have never done ascii so I am unfamiliar with how to get the two components talking. This is a simple application that only requires writing a string to the printer, but i have tried all that i can without any luck.
1 person likes this

Share this post


Link to post
Share on other sites
On the Micrologix end, all you have to do is build the string and use an AWA instruction to send it out the serial port. There are more details of course, but that is basically all you are doing. First thing first, figure out how to control the scribing printer. This will be much easier using a telnet type program on a computer rather than the PLC. I use this one. You can adjust the protocol settings on the fly, easily send out strings and monitor response, all without having to figure out the PLC programs. Once you know the required protocol settings and the necessary ASCII strings to get the behavior you want, then switch to the PLC. Because you will (hopefully) have controlled the printer from the computer, you'll know that any problems you are having are on the PLC, which simplifies the troubleshooting. As an optional step, you can also use the telnet program to test communications with the PLC. I've done enough serial on the Micrologix that I usually skip this step now, but if it's your first time it might be worth doing.

Share this post


Link to post
Share on other sites
Welcome to the Forum ! ZIP and post the *.RSS file that you have so far, along with any details you can summarize about the serial protocol the scribing printer expects to see. "Start/Stop" is sometimes a special sort of flow control in which unprintable characters are used to control a buffer. So that's a special use of those words that you probably don't mean to use here. Are you sending text to the printer, or just sending it "Begin Printing" sort of commands ?

Share this post


Link to post
Share on other sites
I am essentially sending a serial number, my problem is what characters to use from the plc. i have read and read. i have went through the printers manual as well, which is vague at best. it states there are common commands with ascii, but without ever doing it i don't know how to get it setup. As of this moment i am trying to use an AWT command with a string that looks like this: ^Btext^C^D I am using port 0 with my plc using internal bits toggling the instruction and it says it sends 7 characters, but i am not getting anything back on software side of the pc. I am not sure if the ports is right as there are 5 comm ports but no documentation to state which is which. the printer software has its own configuration for using the serial ports.

Share this post


Link to post
Share on other sites
http://forums.mrplc.com/index.php?/files/file/1039-ddean-program-ascii/ here is my program

Share this post


Link to post
Share on other sites
JRoss makes a suggestion I have used before...using a freeware Telnet console program to figure out the syntax out needed to get your peripheral device do the right thing. I used this method with great success when integrating a Logix CPU with Epson SCARA robots. The documentation on both ends was vague as to the complete command syntax. Use a Telnet console program to test the right overall syntax needed to go out from the PLC. You may also be able to Telnet the console from the PLC and read what actually is sent out. The PLC ASCII command may be adding characters (or leaving the command string open, which could explain if nothing happens). 1. Identify what ASCII syntax is exactly needed by the peripheral device using a Telnet console 2. Code this string command into the PLC program 3. Read the PLC ASCII string output in Telnet console to verify if any additional characters are added

Share this post


Link to post
Share on other sites
Well, it works. It was stupid. I needed a null adapter! Go figure. I did use to hyperterminal to verify plc was sending and it was. Then verified printer was working with hyperterminal and it was. Came down to the null adapter. thank you for the input and assistance.

Share this post


Link to post
Share on other sites
Great, thanks for the update! This is exactly why I use a PC to verify each end of the communications before I try to put the two pieces together!
1 person likes this

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