Description This function queries a data collector surface node to determine if it has been initialized for data collection. Note that this does not guarantee that any data has actually been collected by the surface.
Syntax data = DataCollectorSurfIsDataAvailable( surf )
Parameters data (Boolean) Return value indicating whether the data collector surface is initialized for data collection (True) or not (False).
surf As Long Node number of the data collector surface whose initialization state is 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 DataCollectorSurfGetDatumCount DataCollectorSurfIsCollectData DataCollectorSurfReadCollectedDataFile DataCollectorSurfSetCollectData DataCollectorSurfWriteCollectedDataFile
|