LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert backslash code text to actual control codes within a string.

Hi

 

I am probably overlooking something quite simple here. I am reading in commands from  a .txt file, one of my commands is used to specify the termination charcters that I want added to the end of all subsequent serial communications message strings. So my .txt file command may read: Termination Characters=\r\n

 

In my Labview code I need to be able to convert the \r\n text to a real carriage return\line feed string that I can then contacenate onto the end of my message string.

 

I am aware of of how string controls and indicators can be made to display the \ codes but that is not my probem here as I am actually not using any controls or indicators anyway. I'm simply reading the control code text from a file  and want to convert them to "real" control codes for inclusion in another string, as if I had contacenated the carriage return and line feed constants to another string within LabVIEW.

 

In otherwords how can I parse the  backslash codes so they result in their constant equivalents?

 

Hope this makes sense

 

 

Thanks

 

Tristan

0 Kudos
Message 1 of 3
(2,629 Views)

Take a look at the code below, it uses the Search and Replace String function to do what you are trying to do.  Let me know if this doesnt help.

 

 

 

 

 

 

 

 

 

Message Edited by jmcbee on 03-13-2009 10:52 AM
Message 2 of 3
(2,619 Views)

... and if the cr lf are not always together...

 

 

Ben 

Message Edited by Ben on 03-13-2009 11:59 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 3
(2,614 Views)