BobH Posted February 19, 2019 Report Share Posted February 19, 2019 Hello, I am writing a communication program. I receive a string of data and need to compare it with a couple of parameters. Anyone? example : i receive : /X354,Y653,Z345/ my PLC needs to recognize : /X... , Y..... , Z.... / in the future i also need to parse this and display the values in different text boxes. thx in advance Quote Link to comment Share on other sites More sharing options...
Ofir Posted April 16, 2019 Report Share Posted April 16, 2019 first configure the PLC to be a TCP-Server After that insert to the ladder the element to receive data from the client. The "Received Buffer" should be very long so your incoming message can be fully received with no problem. The "Length received" integer and "Received message" bit will be use to parse your message and get your information. After receiving your buffer you would like to parse the massage, for that you first need to create the general form of the message your PLC receives. You said you will send a message that looks like "/X300,Y300,Z300/" while the numbers are the only one who change, so this is the general message form and in the places your numbers appears I put a different variable for each number. After that you should put the ladder element for parsing your message, and add your number to the HMI. You can use a program called Hercules, to simulate TCP connection as a client, this is how I checked that my application works. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.