AB ASCII Write Problem (PC to PLC Communication)

R

Thread Starter

Ram

Hi,
I am the process of creating an application where PC sends commands to a Allen Bradley PLC and PLC sends feedback to PC. It is a rs-232 communication between the PC & the PLC. I am using Channel 0 on the PLC and COM1 on PC. On the PC side it's visual basic mscomm control that sends and receives infomatiom. On the PLC side I am using ASCII read and ASCII write instrucations to get/send infomation.
Problem that I am have is with ASCII write instruction. I am getting a right command to the PLC from the PC, but I am not getting the right feedback to the PC. I kind of figured out what the problem is: It looks like that what ever ASCII characters that being sent to the PLC, are also coming back to the PC again (even if I take off any ASCII write instruction from the ladder logic) how is this possible? Can anyone tell me why is this happening and how can I prevent it? Is there any special setup I need to do in ch0 config.?

Thanks for your help in advance!
-Ram
 
J

Jean-Michel Blais

Hi,

I have programmed an application in the past that was using channel 0 in user mode to transmit a string between a scale indicator and the PLC. There may be two things you can try. First, in your ladder, use the "ASCII Clear Buffers" instruction (ACL) each time you end a transmit or receive action. The second thing you can check is in the "Channel Configuration" section in the RS Logix window. Go to the "Chan. 0-User" section and check if you have the right terminaison character set, and if the "Echo" check box is selected. If echo is selected, there may be a chance that is causes the PLC to automatically respond to the write command by sending back the string to the PC. Hope it will help you with the problem.
 
Ram,

Are you sure that the PLC is sending out the same ASCII characters that you are sending it? VB may be looping those characters in your program somehow. You should be able to just use a ASCII write instruction in your A-B PLC that is triggered every 1/2 second. However, it will only transmit the characters if they have changed since the last time. SO in other words, if you aren't getting any info in from your PLC, try changing the characters that you are trying to send periodically, and it may work.
 
Ram, I am working on a similar project and would be very grateful of any information which you may have collected especially some ASCII sample code. Many thanks, Donie.
 
Top