LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

number to string .... string to number

I've got the following problem :

I have to configure a Spectrum Analyser by tcp-ip ... on the server
application all the measurement specifications are resambled and put in to a
string (start date; stop date, min freq, max freq, mon freq, min carrier
level, .... ) ... I receive the whole string perfectly on the remote
application but when I want to Scan the String I got stuck on the start date
.... -) its a time and date that must be recovered from the string ... but
the Scan string function can't get further then the , of the time .... I
tried to change the time to an integer (before sending it) but then the time
just isn't right anymore ....

Can anyone help me please?
0 Kudos
Message 1 of 3
(3,239 Views)
If I understand the problem correctly, you have a string of text with the
various desired substrings separated by commas and you are trying to parse
out the substrings. If that is the task, try using the Match Pattern vi.
Use a constant "," as the "regular expression", feed the full string into
the "string" input. The output "before substring" will be the first
substring (the start date). Feed the output "after substring" to the
"string" input of a second Match Pattern vi (similarly wired with a "," to
the "regular expression"). The "before substring" output of this second
Match Pattern vi will have the second substring (the stop date). Continue
this pattern until all substrings are retrieved. (For a cleaner
implementation, you could put a single Match Pattern vi
in a while loop
testing for string length of the "after substring" output going to zero as
the exit criteria and feed the "before substring" to an output tunnel of the
while loop. This would give an array of strings at the output tunnel.)

Hope this helps.

Jim



Do_It_To_Me wrote in message
news:q5_U4.14185$jO1.20714@afrodite.telenet-ops.be...
> I've got the following problem :
>
> I have to configure a Spectrum Analyser by tcp-ip ... on the server
> application all the measurement specifications are resambled and put in to
a
> string (start date; stop date, min freq, max freq, mon freq, min carrier
> level, .... ) ... I receive the whole string perfectly on the remote
> application but when I want to Scan the String I got stuck on the start
date
> ... -) its a time and date that must be recovered from the string ... but
> the Scan string function can't get further then the , of the time .... I
> tried to change the time to an integer (before sending it) but
then the
time
> just isn't right anymore ....
>
> Can anyone help me please?
>
>
0 Kudos
Message 2 of 3
(3,239 Views)
Do_It_To_Me wrote:

> I've got the following problem :
>
> I have to configure a Spectrum Analyser by tcp-ip ... on the server
> application all the measurement specifications are resambled and put in to a
> string (start date; stop date, min freq, max freq, mon freq, min carrier
> level, .... ) ... I receive the whole string perfectly on the remote
> application but when I want to Scan the String I got stuck on the start date
> ... -) its a time and date that must be recovered from the string ... but
> the Scan string function can't get further then the , of the time .... I
> tried to change the time to an integer (before sending it) but then the time
> just isn't right anymore ....
>
> Can anyone help me please?

It may be more effiecient to simply strip the st
art date / stop date out of the

string (Use string subset) before you send it to scan string.
Depending on what you want to do with the start / stop date
you may just want to split the two apart and display.

Or if the length of the start date is fixed (it should) you can
edit the format string and only get the number of characters
in the date. For example:

Format string is %3s %3s
Input string is "Thisisatest" (without the quotes)
Output string1 is "Thi"
output String2 is "sis"

You have to be careful though because a blank space will terminate the string.
Using the same setup above but the string is "This is a test" will return
Output string1 is "Thi"
output String2 is "s" <- is got the "s" from "This" the blank after the
"s" terminated the scan.

The Scan string and Scan for Tokens are powerful functions but difficult to
understand
Kevin Kent
0 Kudos
Message 3 of 3
(3,239 Views)