I am new to LabVIEW. I am communicating with LV via a robot. The robot is constantly sending updates of its position to LV via TCP/IP. The robot sends LV these positions as seperate messages as strings. In LV, I want to count how many messages (strings) it receives in 1 second. Anyone have any ideas on how to do that?
Thanks in advance for any help!
Use the Search Replace string function, telling it to replace all found instances, and the returned function will tell you how many it replaced. You don't need to actually used the replaced string.
I guess I also failed to mention I need to display the resulting number of strings per second as a DBL. How would I do that?
With either a feedback node, to track how much time has gone by over a period of time. Or you use something like the Elapsed Timer VI, which will only trigger once every set amount of time. So either calculate how much time has gone by, or set a known about of time to go by and use that in your calculation.
What does "it didn't work" actually mean? If you want suggestions, please post your latest VI so we can see what you've tried. Post it with the incoming data saved as a constant or as default data in a control so we can see what the data looks like.
Well I mean it doesn't count how many strings are received per second. I can't post it because it has too many things in it. The data is just an incoming string that starts with "10....", so I tried what Hoovah suggested, and searched "10" but all it is doing is saying "0.0001" and stays that way. Attached is a screenshot of my code.
How fast is your loop running? If it is running once a millisecond, and you get 10 strings, then your calculations are going to be .0001. (And don't you want to take the number of string and DIVIDE BY the time to get strings / second? Right now you are seconds per string.)