annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

scan for string

Risolto!
Vai alla soluzione

HI erveryone,

 

I am working with the Scan from String fuction, but I have a problem. The string that I have as input is "temp=32.2", so I am using the Scan function as follows:

 

snippet1.png

 

But as output 1 I have "temp=32.2" and 0 in the output 2.

 

Does anyone have an idea of how to separate "temp" in output1 and 32.2 in output2?

 

Thanks for your help

Raymundo Cassani
0 Kudos
Messaggio 1 di 8
3.510Visualizzazioni

Try a format of "%4s=%f"

0 Kudos
Messaggio 2 di 8
3.506Visualizzazioni

Thank you for early answer, but, what happens if my string is size-variable? I mean for some readings I have temp=32.2 for others something like: voltage=122.1,  current=12, or humd=51.2 

Raymundo Cassani
0 Kudos
Messaggio 3 di 8
3.502Visualizzazioni
Soluzione
Accettato da autore argomento rCassani

The you need to program around it, for example as follows. There are many ways to do this...

 

 

Messaggio 4 di 8
3.500Visualizzazioni

thank you

Raymundo Cassani
0 Kudos
Messaggio 5 di 8
3.493Visualizzazioni

Just make a small change to your format string, easy to do when you construct the format string from the dialog in the right-click menu.

 

ScanStringExample.png

Messaggio 6 di 8
3.485Visualizzazioni

he wants the leading string too, maybe....

0 Kudos
Messaggio 7 di 8
3.477Visualizzazioni

@altenbach wrote:

he wants the leading string too, maybe....


That sits in the first output. 

0 Kudos
Messaggio 8 di 8
3.473Visualizzazioni