mjarvas Posted December 2, 2020 Report Share Posted December 2, 2020 I'm using a Unistream 10.1" built-in for a project where I have to communicate with using an UAC-CX-01RS2 RS232 module. I created a simple test project after watching the communication tutorial video. It seems that something is not right. The PLC doesn't receive the full message sent by the other party. The first character(s) are missing. Usually 1 or 2 but sometimes even 3 or 4 characters. I checked the signals with a logic analyzer and they are there on the dedicated pin of the DB9 connector plugged into the PLC. Communication speed and parameters are set properly. Maybe I did something not proper in the Unilogic software but I couldn't find another example. I attached the project. Could anybody please have a look at it? Is it a software problem or maybe my RS232 module is faulty? Thanks in advance for your help. Comm_test.ulpr Link to comment Share on other sites More sharing options...
DaveE Posted December 3, 2020 Report Share Posted December 3, 2020 Just a thought, because its hard to tell, but how many characters are you sending I had a similar issue when my buffer length was too short, therefore it was clipping the message off Link to comment Share on other sites More sharing options...
mjarvas Posted December 4, 2020 Author Report Share Posted December 4, 2020 I don't think it's the buffer length. I use a 40 byte long buffer and the message is only 8 byte. And the weird thing that the beginning of the message is missing and not the end. But I can try it with longer buffer. Link to comment Share on other sites More sharing options...
DaveE Posted December 4, 2020 Report Share Posted December 4, 2020 Hmm seem also to remember some issue with the timing that I had, not sure exactly what now but what fixed it was starting a timer from when the first byte was received before moving on Link to comment Share on other sites More sharing options...
mjarvas Posted December 5, 2020 Author Report Share Posted December 5, 2020 Thanks. I try to have a look at this on Monday and let you know the result. Link to comment Share on other sites More sharing options...
mjarvas Posted December 7, 2020 Author Report Share Posted December 7, 2020 Thanks DaveE for the tip. It works now. Basically I used a condition not to call the Com RX function until 50ms elapsed from receiving the first byte. No bytes has been lost since then. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now