Sign in to follow this  
Followers 0

Logix Designer ReadSocket Message

2 posts in this topic

Hi all, I'm having a hard time with this socket service to consistently read all of my data. It seems like there is a race condition where I miss a status of the Message instruction.
If you have any insight, it would be much appreciated. Thank you.

My application data is greater than 484 bytes, it can be variable up to hundreds of thousands of bytes. I've began to notice that when there is a lot of non-zero data, I start to miss chunks when I read them and put them into my buffer array.

So I created a simplified testing application that always reads 484 bytes, and accumulates it. I manually send the plc 133164 bytes, which amounts to 276 times that the message instruction returns data. ((275 reads * 484 bytes) + (1 read * 64 bytes)).

Sometimes my program accumulates to 133164 bytes with a count of 276 reads.
Often however, it accumulates to 132680 bytes with a count of 275, 132196 bytes with a count of 274, or 131712 bytes with a count of 273.

Because it is always off by a multiple of 484 bytes, and generally only once or twice in the stream, it makes me think my program has a race condition somewhere. I couldn't find information in the socket manual about how to signal that data is ready, so I followed the message timing diagram in the help file as best I could. Maybe this is my issue. I'll attach some pictures of my current implementation (they are arranged in order of program flow). I'm planning to access KB 33672, but waiting on a quote from my AB supplier. It might have some helpful information for me.


If you would rather see the project, let me know. I have not attached it because there is a lot of socket maintenance code around it. I thought this would be the best way to show my steps directly.

Thank you all in advance,














Edited by flylikechris

Share this post

Link to post
Share on other sites

Rungs 6 and 7 (from the last image) are poorly implemented. This is embarrassing haha.

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