LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert variable into text string

Solved!
Go to solution

Hi, can somebody help me insert variables into a text string? I am using the "Basic Serial Write and Read.vi in labview.

 I need to send the following string to the serial port:

 

- AT$$INPUT1SMSPHONE=phone1,phone2,phone3

- AT$$INPUT1SMS_WSEC=5

- AT$$INPUT1SMS_DATAON=TYPE SMS MESSAGE HERE


How do I make a vi with phone1,phone2,phone3 and TYPE SMS MESSAGE HERE as variables and send it to the serial port?

If somebody could do an example vi it would be fantastic.

Kind regards,

 

Mark

0 Kudos
Message 1 of 4
(5,705 Views)

markwtc,

 

Use the Format into String.vi.  I attached an example (LV86) and png.  Basically, replace your string tokens (phone1, phone2, etc) with "%s" format specifier.  There are a million ways to format variables into strings using this vi.  Dig through the help and have fun!

 

-cb

Download All
Message 2 of 4
(5,701 Views)
Solution
Accepted by topic author markwtc

Thank you for your prompt reply. Your example is perfect thanks mate.

 

Cheers,

 

Mark

0 Kudos
Message 3 of 4
(5,688 Views)

Then please mark -cb's message as the solution to your question rather than your own thank you message.  If you go to the Options menu to the upper right of your message, you'll be able to unmark yours as the solution.  Then go to cb's message and mark it as the solution.

0 Kudos
Message 4 of 4
(5,678 Views)