2 methods, Record.item(), Name – Campbell Scientific LoggerNet-SDK Software Development Kit User Manual

Page 152: Description, Com return values, Visual basic, Record._newenum()

Advertising
background image

Section 18. CsiDataSource Control Reference

18.5.2 Methods

Record.Item()

Name

Record.Item(id) As Value

Description

This method returns a reference to a value found by the specified ID. A broker
can be referenced by an integer (a Long) or by the name of the broker (a
String). If the number is less than zero or is greater than the number of
brokers, then the COM error E_CSI_ARRAY_OUT_OF_BOUNDS will be
returned. If the broker cannot be found by name, then the COM error
E_CSI_NOT_FOUND will be returned.

COM Return Values

Table of Possible Values

Code Meaning

S_OK

Success: Normal return

E_CSI_ARRAY_OUT_OF_BOUNDS

Error: Array out of bounds

E_CSI_NOT_FOUND

Error: Couldn't find the broker by name
in the broker map

E_CSI_FAIL

Error: Wrong variant type passed to this
method or unexpected error

Visual Basic

Return Type
value

Example
Number value (like an array):
Long iterator

For iterator = 0 to myRecord.Count – 1

... = myRecord(iterator).value

Next iterator

Referencing the Broker by name:
DIM valueName as String

valueName = "battTemp"

DIM value as long
value = myRecord("battTemp").value

OR

value = myRecord(valueName).value

Record._NewEnum()

Name

Record._NewEnum()

18-28

Advertising