NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Parse Lots Of Text Being Returned From A Function

I am using a StepType our Company developed which is used to get information on available access points our portable router can see.  After I send a status command the device will send a long list of access points (see example below).  How do I parse this output to get the RSSI for a particular SSID.  For example in the sample below how would I return the value of RSSI, -63dBm for SSID WKRP1?  Your thoughts on how to tackle this problem.  Thanks.

 

BSS 0:
SSID: \x00
BSSID: 00:1c:b1:88:b9:80
Channel: 1
RSSI: -72 dBm
bssType: Infrastructure
Security: wep-on

 

BSS 1:
SSID: WKRP1
BSSID: 00:0a:b8:7f:85:10
Channel: 4
RSSI: -63 dBm
bssType: Infrastructure
Security: wpa-psk-tkip

 

sdc#

0 Kudos
Message 1 of 4
(4,883 Views)

Personally, I would pass the entire string into a VI and pase it in LabVIEW.  You can then use Regular Expressions or simple searches to get the information you want.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(4,879 Views)

Can it be done without Labview in particular from Teststand?  If so, how? 

0 Kudos
Message 3 of 4
(4,854 Views)

Hi Tony,

 

It can be done without LV but i feel its always easy to do in LV or any C based language.But if the requirement is minor and can be easily done through TestStand then its fine avoiding a vi or a dll.

 

I am attaching a example sequence which gives RSSI value from your example text.

This is what i did :

use split function to split all values into a string array.

Looked for a split string which contains RSSI

Took the next string which had RSSI value and converted it to number using val function.

 

 

If the text of interest  is always in a  fixed position then you can use functions like mid or left  to grep the required text of interest.

Then use function like val( str) which converts this to a number.

 

Hope this helps.

 

Ravi

 

 

0 Kudos
Message 4 of 4
(4,831 Views)