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 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 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