question

nitya avatar image
nitya asked PaintedMagentaFeather answered

How to retrieve the FilteredStreamResults in Spirent TestCenter using TCL API?

Hi,

 

I am trying to retrieve the results of FilteredStream. I followed the steps,

 

Option1:

stc::subscribe -Parent project1 -ResultParent port1 -ConfigType Analyzer -resulttype FilteredStreamResults

stc::get analyzer1 -children-analyzer32BitFilter

stc::get analyzer1 -children-filteredStreamResults

 

There are no Filter Handle returned when I tried priniting it.

 

Option2:

stc::subscribe -Parent project1 -ResultParent port1 -ConfigType Analyzer -resulttype FilteredStreamResults

set result [stc::get $resinfo -resultHandleList]    <<< does not return anything

array set tx_counts [stc::get $result ]

 

puts "X: [array get rx_counts]" returns the below error message since the $result is empty handle

 

**** stcerror in get: invalid handle "": should have been obtained using create or get ****

 

All the project handle and port handle details are correct.

 

Can some one help what is wrong in the above code?

 

iTesttraffic generation
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

PaintedMagentaFeather avatar image
PaintedMagentaFeather answered

I have exactly the same issue - resultHandleList is empty despite both analyzer and generator are running and system says that filter is there (I cannot subscribe to RxStreamSummary results because of that). There is no FilteredStreamResults child under port.Analyzer nor Analyzer. Are there any other limitations like you cannot subscribe to more than 1 result data set?

10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Yaseen avatar image
Yaseen answered Yaseen posted

Hi Nitya,

 

Could you please share your configuration file, seems the analyzer32BitFilter is not included in the configuration you have applied to chassis. Subcribing to the results will not add handles in the anaylzer, we need to first start the traffic for the results to get generated.

 

After the traffic is started successfully you can see that the required handles will returned for the filteredstreamresults.

 

Hope this helps!

 

Thanks,

Yaseen

 

 

 

 

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

cnguyen avatar image cnguyen commented ·

Hi,

 

To get Filter handle you must start traffic and make sure it is running.  One thing you must remember that should wait several seconds before get Filter handle.

Here is the detailed code for your case that it works well.

 

    # 1. Subscribe
    set resultList {}    
    foreach port [stc::get project1 -children-port] {
        lappend resultList [stc::subscribe -parent project1 -resultType FilteredStreamResults -configType Analyzer -resultParent $port]
    }

  
    #  2. Start traffic    
    set genList {}
    foreach port [stc::get project1 -children-port] {
        lappend genList [stc::get $port -children-Generator]
    }
    set anaList {}
    foreach port [stc::get project1 -children-port] {
        lappend anaList [stc::get $port -children-Analyzer]
    }   
    stc::perform AnalyzerStart -ExecuteSynchronous true -analyzerList $anaList
    stc::perform GeneratorStart -ExecuteSynchronous true -GeneratorList $genList
    after 3000
    
    # 3. get filter handle   
    foreach result $resultList {
        set check "STOPPED"        
        foreach gen $genList {            
            if { [string compare $check "RUNNING"] != 0 } {
                set check [stc::get $gen -state]
            }
        }    
        if { [string compare $check "RUNNING"] == 0 } {
            set handle [stc::get $result -ResultHandleList]
            if  { [string length $handle] > 0 } {
                puts $handle
            } else {
                puts "Error happened"
            }
            
        } else {
            puts "Generator is stopped"
        }
    }

 

Hope this helps!

 

Thanks,

Cuc
   

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.