Navigation: Scripting Reference Manual > Functions & Subroutines > DataCollectorSurfIsCollectData

 

DataCollectorSurfIsCollectData

 

Contact Us: fredsupport@photonengr.com

 

Description

This function queries a data collector surface to retrieve the state of its data collection Active flag.

 

Syntax

active = DataCollectorSurfaceIsCollectData( surf )

 

Parameters

active (Boolean)

Return value indicating whether the data collector surface is set to collect data (True) or not (False).

 

surf As Long

Node number of the data collector surface being queried.

 

Example

The example below demonstrates how to identify active and initialized data collector surfaces in the model and report to the output window the collected data statistics of each collector to the output window.

 

Sub Main

          

    Dim tStats As T_COLLECTED_DATA_STATS

    Dim dataType As String

    dataType = "Irradiance"

    Print ""

    Print "Data type stats being queried: " & dataType

    Print "NodeID" & Chr(9) & "Avg" & Chr(9) & "Count" & Chr(9) & "min" & Chr(9) & "max" & Chr(9) & "StdDev" & Chr(9) & "Total" & Chr(9) & "Full Name"

 

    Dim curNode As Long, success As Boolean

    For curNode = 5 To GetEntityCount()-1

        'Is the current entity a surface?       

        If IsSurface( curNode ) Then

            'Is the current surface a data collector?           

            If IsDataCollectorSurf( curNode ) Then

                'Is the data collector set to collect data?

                If DataCollectorSurfIsCollectData( curNode ) Then

                    'Is the data collector initialized? Doesn't guarantee non-zero data has been collected.                 

                    If DataCollectorSurfIsDataAvailable( curNode ) Then

                       

                        success = DataCollectorSurfGetDataStats( curNode, dataType, tStats )

                        Print curNode;

                        Print tStats.avg;

                        Print tStats.count;

                        Print tStats.min;

                        Print tStats.max;

                        Print tStats.stdev;

                        Print tStats.total;

                        Print GetFullName( curNode )

 

                    End If

                End If

            End If

        End If

    Next

 

End Sub

 

See Also

Data Collector Surface Scripting

DataCollectorSurfGetDataStats

DataCollectorSurfGetDatum

DataCollectorSurfGetDatumCount

DataCollectorSurfIsDataAvailable

DataCollectorSurfReadCollectedDataFile

DataCollectorSurfSetCollectData

DataCollectorSurfSetDatum

DataCollectorSurfWriteCollectedDataFile

 

 

 

 

 

 

Copyright © Photon Engineering, LLC