I’m using socketTest V3.0.0 to test the communication. When I have an active connection and try to type something I can not find if the data is received.
This is the watch table I use to watch the variables. The status says: 7006 which means the connection is active and ready to receive data. But when I type something in socketTest nothing changes on the watch table. I use port 4000 on TCP.
I managed to get data through. By setting ADHOC to “true” instead of “false”. But there is still a problem where the first two characters are cut of. For example: I send: ‘123456789’ I receive: ‘3456789’. By putting two spaces in front of the send data I am able to receive everything but I don’t like that method. if anyone knows how to receive all the data without losing the first two characters that would be great!
Change the data type of recvData(DATA) to ARRAY of BYTE (probably ARRAY of Char will also work, but I’m not sure).
Or disable optimized block access of the TSEND_DB block. You can find this setting by right clicking on the block in the project tree → Properties → Attributes → Uncheck “Optimized block access”.
When disabling ad-hoc mode (ADHOC = false):
Make sure the LEN parameter is set. Only when LEN is equal to RCVD_LEN the data will be available.
When I’m in class you can always ask me to help with this or when you have other questions about Siemens .