06-12-2013 10:04 AM
I am trying to log the serial data showing up in a text box indicator to a plain text file. I have accomplished this task, but now I need to make sure that a partial string will never be printed to the file. I need a way to scan the data and print it to the text file without only printing a part of the string. I have tried scanning for the \r\n termination characters but still, no luck. I am fairly new to Labview so any help would be appreciated. I am sure that this is easier than I am making it out to be.
Solved! Go to Solution.
06-12-2013 10:14 AM
I would check the string and search for a pattern (in your case, the End of Line Constant that can be found at the Programming >> String palette).
If the pattern is found, then you use the information. Otherwise, simply ignore it.
Take a look at the String functions inside the Programming Palette. Your journey starts there 😄
Regards
06-12-2013 10:26 AM
That is what I thought I should do, however I'm not exactly sure how to do that. I have tried using case structures, but I am not exactly sure how to use them correctly. Can you tell me a little more about how I would go about doing this?
Thanks
06-12-2013 10:34 AM
You can use the Search/Split String to locate the EOL characters.
06-12-2013 10:38 AM
So I don't need to use any case structures then?
06-12-2013 10:44 AM
You will probably need a case structure for when the EOL was or was not found. But the case structure should not be comparing any strings.
06-12-2013 10:53 AM
I'm sorry but as I said I am fairly new to Labview and don't have a firm understanding of how to wire the case structures to test for a condition. Can you tell me if I am on the right track? I uploaded a screenshot of my block diagram.
06-12-2013 12:39 PM
Delete the string going to the case structure and wire the Offset Past Match indicator to the Case Structure to indicate anything after 0 --> (1...). You'll have to modify your case structure to handle the integers.
06-12-2013 01:03 PM
Ok, so there are two conditions..
1: EOL has occurred
2: EOL has not occurred
Keeping printing to the file until EOL occurs
Do nothing if EOL occurs
How do you signify "do nothing" in Labview
06-12-2013 01:18 PM - edited 06-12-2013 01:19 PM
On the 0... (told you incorrectly before) case, just don't wire anything into it.