Jump to content

Recommended Posts

Posted

Hey all,

 

The PLC I'm using is an Unistream 7".

 

I'm writing an application where the PLC needs to communicate with a server through a TCP connection.

Communication is established through a Restfull API;

- PLC asks the server when needed for a list of all the configured items on the server.

  This list is JSON-formatted, will be parsed by the PLC and then loaded into a DTI for further use..

- PLC sends updates to server when an item has changed state.

- Server sends commands to the PLC when an item needs to change state.

 

Setting up the TCP client Rx was a breeze!

Communicating with the server works like a charm if the received messages are smaller than the receiving buffertag of the TCP client Rx FB!

(e.g. commands from server to PLC)

If larger then the buffertag, the message will be truncated.

(e.g. List of items send by server to PLC)

=> According the help-file: due to insufficient buffer size (user buffer)

 

I noticed that a buffertag can be defined as a maximum of around 1600 bytes.

I was wondering why this limit?

And then again, if I could enlarge the buffer to say 3500 bytes and my list grows eventually beyond this limit..

 

So.. How do I receive a message that's larger then my predefined receivebuffer?

What am I missing?

 

Tnx in advance,

 

SRO

 

 

Posted

TCP Communication is usually limited to 1536 bytes per chunk (packet), which is also known as MTU.

You will not loose the received data. Once you have read the data from the buffer, then reading from that socket again, will read the next bytes.

  • 2 weeks later...
Posted

Indeed,

the buffertag wasn't responsible for losing the received data.

 

My problem was because of the write limitation of the "append to file"-FB.

Maximum allowed size is 950 bytes.

Since I was just copying my receive buffer directly to the txt-file,

I wasn't able to retrieve all the data from the buffer!

 

Tnx for the feedback :)

 

SRO

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
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.