取消
顯示結果 
搜尋替代 
您的意思是: 

Insert variable into text string

已解決!
前往解決方案

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 積分
1 條訊息(共 4 條)
7,384 檢視

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

2 條訊息(共 4 條)
7,380 檢視
解決方案
接受者 markwtc

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

 

Cheers,

 

Mark

0 積分
3 條訊息(共 4 條)
7,367 檢視

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 積分
4 條訊息(共 4 條)
7,357 檢視