Sign in to follow this  
Followers 0
iyad

CP1L-RXD Problem - Please Help

11 posts in this topic

Hi all, i have CP1L-M30D with CP1W-CIF01 serial option board i use RXD to receive data from Host computer, here my program LD CF113 (P_on) RXD D130 #0100 &8 i not use A392.14 (Reception Complete Flag) cause it never going ON but data from Host Computer never receive complete by PLC, when i send 8 lenght data PLC just receive 4 lenght data(LSB) and sometimes 3 data leght for example when i send 12345678, PLC just Receive 8765 (in ascii) and sometimes 876(in ascii) please help

Share this post


Link to post
Share on other sites
Hi All, i've resolved my problem before but now i get new one, i change my program befor with LD 0.00 AND A392.14 RXD D130 #0100 &10 LD 392.14 OR 100.06 OUT 100.06 and data have receieved Complete by PLC . but why 100.06 never going to ON?

Share this post


Link to post
Share on other sites
Hi Iyad Perhaps you need to have the syntax LD A392.14?? Regards Morten

Share this post


Link to post
Share on other sites
Hi Morten Thanks for your reply yes i use A392.14, in my post before LD 0.00 AND A392.14 RXD D130 #0100 &10 LD 392.14 =====> typing miss,here right one : LD A392.14 OR Q100.06 OUT Q100.06 but why Q100.06 never going on altough data have received complete by PLC? Edited by iyad

Share this post


Link to post
Share on other sites
I think there is a misunderstanding of the Reception Completion Flag. The Reception Completion Flag turns on when there is a message in the buffer of the port that matches the End Code set in the port setup. You can select 1) a specific number of bytes, 2) CRLF, or 3) a single character that you specify. Lets say you set CRLF as the End Code. When your data 12345678<CRLF> is recieved, the Reception Completion Flag turns on. At that point, you should execute the RXD instruction. The RXD instruction will reset the Reception Completion Flag, so when viewing the ladder, you normally will not see the bit on, because it turns on and off quickly (typically in a single scan). Also, please use the Port 1 Reception Counter (A394) to know how many bytes are in the buffer.

Share this post


Link to post
Share on other sites
Hi PMCR, Thanks for your replay, when my program like here : LD A392.14 OR Q100.03 OUT Q100.06 would Q100.06 turn ON when data received complete? actually i would make a machine with stepper motor will run when data received by PLC and data received on DM130 is many pulse to rotate the motor (after converted), so i need A392.14 to start the stepper? could you give me any option suggestion? Thanks Iyad

Share this post


Link to post
Share on other sites
If you post your CX-P file, it may be easier for everyone to see what you are doing, and what you have configured. Including mnemonic descriptions is fine some of the time, but for what you are asking, you need to post you config settings as well.

Share this post


Link to post
Share on other sites
The Reception Completion flag will turn on when 8 bytes are in the buffer if you have Received Bytes selected, with a value of 8 for the end code. I really do not like this method. If your device sends 4 bytes, then becomes unplugged, stops transmitting, etc, you now have 4 bytes in the PLC serial buffer. The next time your devices sends data, it sends the normal 8 bytes. So now you have 12 bytes in the buffer. If your RXD instruction is set for 8 bytes, it will read the first 8 bytes, leaving the remaining 4. In this case, you have an incomplete message, and the cycle will repeat. If you cannot use a terminator (which is the method that I would recommend if possible), please use the Reception Counter (A394 for port 1) as the 3rd parameter of the RXD instruction. This will prevent the situation I have described above. As far as your need to turn on an output, simply use a SET instruction on an internal bit (W0.00 for example) just before the RXD instruction as shown below. This will turn on in the same scan as the RXD instruction. Reset the W0.00 elsewhere in ladder.

Share this post


Link to post
Share on other sites
Hi PMCR, thanks for your reply, i have solve for my problem with end code CRLF, and now machine working properly thanks fror your support Thanks and Regards Iyad Edited by iyad

Share this post


Link to post
Share on other sites
On 9/11/2009 at 4:23 AM, PMCR said:

The Reception Completion flag will turn on when 8 bytes are in the buffer if you have Received Bytes selected, with a value of 8 for the end code. I really do not like this method. If your device sends 4 bytes, then becomes unplugged, stops transmitting, etc, you now have 4 bytes in the PLC serial buffer. The next time your devices sends data, it sends the normal 8 bytes. So now you have 12 bytes in the buffer. If your RXD instruction is set for 8 bytes, it will read the first 8 bytes, leaving the remaining 4. In this case, you have an incomplete message, and the cycle will repeat. If you cannot use a terminator (which is the method that I would recommend if possible), please use the Reception Counter (A394 for port 1) as the 3rd parameter of the RXD instruction. This will prevent the situation I have described above. As far as your need to turn on an output, simply use a SET instruction on an internal bit (W0.00 for example) just before the RXD instruction as shown below. This will turn on in the same scan as the RXD instruction. Reset the W0.00 elsewhere in ladder.

I'm having the same issue using the RXD instruction. My problem is I don't see anything come through to the PLC when I try to send a byte to the PLC from the PC. I am able to receive on the PC side when a byte is sent from the PLC using the TXD instruction. One other problem I'm having is the serial communication error (A392.12) is always on and I cannot figure out why. I'm attaching captures of CP1L settings, RS-232 communication cable that was wired up, and the RXD and TXD code I'm using if someone could help me out.

CP1L Settings Capture.JPG

RS232 cable wired up Capture.JPG

Serial Comm Error Capture.JPG

TXD-RXD program Capture.JPG

Share this post


Link to post
Share on other sites

Hello,

calebyaj

you can try a simple p´rogram like this bellow  for me it works well and you can keep the settings in the same way you show on pic above

well about you said that you set to receive 8 byte and sent "12345678" but received "9876" it is because each nuber use 2 bytes acording ASCII

I hope i can help you

txd.jpg

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