Opto22.Controller
Controller .Net Software Development Kit for SNAP-PAC
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Opto22.Controller.Controller.Item Class Reference

Item class for configuring and submitting grouped item reads. More...

Public Types

enum  eItemTypes {
  eItemTypes.invalid = 0, eItemTypes.integer32, eItemTypes.pinteger32, eItemTypes.integer64,
  eItemTypes.pinteger64, eItemTypes.float32, eItemTypes.pfloat32, eItemTypes.uptimer,
  eItemTypes.puptimer, eItemTypes.downtimer, eItemTypes.pdowntimer, eItemTypes.stringvariable,
  eItemTypes.pstringvariable, eItemTypes.integer32table, eItemTypes.pinteger32table, eItemTypes.integer64table,
  eItemTypes.pinteger64table, eItemTypes.float32table, eItemTypes.pfloat32table, eItemTypes.stringtable,
  eItemTypes.pstringtable, eItemTypes.chart, eItemTypes.pchart, eItemTypes.powerupclear,
  eItemTypes.firmwareversion, eItemTypes.partnumber, eItemTypes.stackdepth, eItemTypes.volatilememory,
  eItemTypes.nonvolatilememory, eItemTypes.filememory, eItemTypes.uptimeseconds, eItemTypes.strategyname,
  eItemTypes.strategytimestamp, eItemTypes.strategydatestamp, eItemTypes.autorunstatus, eItemTypes.timedate,
  eItemTypes.startchart, eItemTypes.pstartchart, eItemTypes.stopchart, eItemTypes.pstopchart,
  eItemTypes.suspendchart, eItemTypes.psuspendchart, eItemTypes.continuechart, eItemTypes.pcontinuechart,
  eItemTypes.chartsrunningcount, eItemTypes.writedatetimefromlocalpctime, eItemTypes.writedatetimefromuserdata, eItemTypes.getobjectinfo,
  eItemTypes.getmessagequeuecount, eItemTypes.getmessagequeue, eItemTypes.clearallmessages, eItemTypes.apoint,
  eItemTypes.papoint, eItemTypes.dpoint, eItemTypes.pdpoint, eItemTypes.startstrategy,
  eItemTypes.stopstrategy, eItemTypes.pid, eItemTypes.ppid
}
 Item types. To retrieve data from ReadGroupItems(), see the GetData() overloads of Opto22.Controller.Controller.Item. More...
 
enum  eAnalogPointAttributes { eAnalogPointAttributes.invalid = 0, eAnalogPointAttributes.eu = 1, eAnalogPointAttributes.minimum, eAnalogPointAttributes.maximum }
 Analog point attributes More...
 
enum  eDiscretePointAttributes {
  eDiscretePointAttributes.invalid = 0, eDiscretePointAttributes.state = 1, eDiscretePointAttributes.onlatch, eDiscretePointAttributes.offlatch,
  eDiscretePointAttributes.counter
}
 Discrete point attributes More...
 
enum  ePidAttributes {
  ePidAttributes.input, ePidAttributes.setpoint, ePidAttributes.output, ePidAttributes.gain,
  ePidAttributes.integral, ePidAttributes.derivative, ePidAttributes.scanrate, ePidAttributes.automanual
}
 PID attributes, all items are group read only. More...
 

Public Member Functions

 Item ()
 Constructor More...
 
void Reset ()
 Reset the item object for reuse. More...
 
String GetTag ()
 Retrieve the item tag name. More...
 
eItemTypes GetItemType ()
 Retrieve the item tag type. More...
 
Int32 GetStartIndex ()
 Retrieve the item's table start index. Only useful if this is a table type. More...
 
Int32 GetNumberofElements ()
 Retrieve the number of elements requested from the table. Only useful if the item is a table type. More...
 
Boolean GetData (out Boolean bValue)
 Retrieve the data as an bValue. Returns false if the data type mismatches or is incorrect. More...
 
Boolean GetData (out Int32 i32)
 Retrieve the data as an Int32. Returns false if the data type mismatches or is incorrect. More...
 
Boolean GetData (out Int64 i64)
 Retrieve the data as an Int64. Returns false if the data type mismatches or is incorrect. More...
 
Boolean GetData (out Single f32)
 Retrieve the data as a Single. Returns false if the data type mismatches or is incorrect. More...
 
Boolean GetData (out String s)
 Retrieve the data as a string. Returns false if the data type mismatches or is incorrect. More...
 
Boolean GetData (out Int32[] i32ary)
 Retrieve the data as an Int32 array. Returns false if the data type mismatches or is incorrect. More...
 
Boolean GetData (out Int64[] i64ary)
 Retrieve the data as an Int64 array. Returns false if the data type mismatches or is incorrect. More...
 
Boolean GetData (out Single[] f32ary)
 Retrieve the data as a Single array. Returns false if the data type mismatches or is incorrect. More...
 
Boolean GetData (out String[] sary)
 Retrieve the data as a string array. Returns false if the data type mismatches or is incorrect. More...
 
Boolean GetData (out eChartStatus ChartStatus)
 Retrieve the data as a chart status enumeration. Returns false if the item was set with an incorrect enumeration (type). More...
 
Boolean GetAnalogData (Item.eAnalogPointAttributes AnalogAttribute, out Single f32Value)
 analog point and pointer to analog point attribute fetch More...
 
Boolean GetDiscreteData (Item.eDiscretePointAttributes DiscreteAttribute, out Boolean bValue)
 discrete point and pointer to analog point attribute fetch More...
 
Boolean GetDiscreteData (Item.eDiscretePointAttributes DiscreteAttribute, out Int32 i32Value)
 discrete point and pointer to discrete point 32-bit integer attribute fetch More...
 
Boolean GetPidData (Item.ePidAttributes PidAttribute, out Single f32Value)
 Access data from a PID or pointer to a PID read. More...
 
Boolean GetPidData (Item.ePidAttributes PidAttribute, out Boolean bValue)
 Access data from a PID or pointer to a PID read. More...
 
Boolean SetAnalogRead (String sNewTag, eItemTypes eNewType, eAnalogPointAttributes[] earyNewAnalogAttributes, Int32 i32AttributeLength)
 Set an analog point read with attributes. Use for grouped reads. More...
 
Boolean SetDiscreteRead (String sNewTag, eItemTypes eNewType, eDiscretePointAttributes[] earyNewDiscreteAttributes, Int32 i32AttributeLength)
 Configure a discrete point read. Use for grouped reads. More...
 
Boolean SetPidRead (String sNewTag, eItemTypes eNewType, ePidAttributes[] earyNewAttributes, Int32 i32AttributeLength)
 Set a PID to read. Use for grouped reads. More...
 
Boolean SetRead (String sNewTag, eItemTypes eNewType)
 Set an Item to Read (for non-table types). Use for grouped reads. More...
 
Boolean SetRead (String sTag, eItemTypes eType, Int32 i32StartIndex, Int32 i32Elements)
 Set an Item to Read (for table types). Use for grouped reads. More...
 

Properties

Boolean SuccessfulRead [get]
 Retrieve the success flag, only valid when ReadList() or WriteList() return true. More...
 
Int32 ErrorResult [get]
 Retrieve the adjoining error code when a GetSuccessStatus or GetStatus(bSuccess) return a false value. More...
 

Detailed Description

Item class for configuring and submitting grouped item reads.

This object must be used in the context of a single thread.

Member Enumeration Documentation

Analog point attributes

Enumerator
invalid 

Invalid (not configured value).

eu 

Engineering units.

minimum 

Current minimum value.

maximum 

Current maximum value.

Discrete point attributes

Enumerator
invalid 

Invalid (not configured value).

state 

Discrete point state.

onlatch 

Discrete point turn-on latch status.

offlatch 

Discrete point turn-off latch status.

counter 

Discrete counter. Feature must be configured on discrete point.

Item types. To retrieve data from ReadGroupItems(), see the GetData() overloads of Opto22.Controller.Controller.Item.

Enumerator
invalid 

An invalid tag type.

integer32 

[ReadGroupItems(), Read32BitIntegerVariable(), Write32BitIntegerVariable()] 32-Bit Integer Variable (returns an Int32 type)

pinteger32 

[ReadGroupItems(), Read32BitIntegerVariable(), Write32BitIntegerVariable()] Pointer to a 32-Bit Integer Variable (returns an Int32 type)

integer64 

[ReadGroupItems(), Read64BitIntegerVariable(), Write64BitIntegerVariable()] 64-Bit Integer Variable (returns an Int64 type)

pinteger64 

[ReadGroupItems(), Read64BitIntegerVariable(), Write64BitIntegerVariable()] Pointer to a 64-Bit Integer Variable (returns an Int64 type)

float32 

[ReadGroupItems(), Read32BitFloatVariable(), Write32BitFloatVariable()] 32-Bit Float (returns a Single type)

pfloat32 

[ReadGroupItems(), Read32BitFloatVariable(), Write32BitFloatVariable()] Pointer to a 32-Bit Float (returns a Single type)

uptimer 

[ReadGroupItems(), ReadUpTimerVariable(), WriteUpTimerVariable()] Up-Timer (returns a Single type)

puptimer 

[ReadGroupItems(), ReadUpTimerVariable(), WriteUpTimerVariable()] Pointer to an Up-Timer (returns a Single type)

downtimer 

[ReadGroupItems(), ReadDownTimerVariable(), WriteDownTimerVariable()] Down-Timer (returns a Single type)

pdowntimer 

[ReadGroupItems(), ReadDownTimerVariable(), WriteDownTimerVariable()] Pointer to a Down-Timer (returns a Single type)

stringvariable 

[ReadGroupItems(), ReadStringVariable(), WriteStringVariable()] String Variable (returns a String type)

pstringvariable 

[ReadGroupItems(), ReadStringVariable(), WriteStringVariable()] Pointer to a String Variable (returns a String type)

integer32table 

[ReadGroupItems(), Read32BitIntegerTable(), Write32BitIntegerTable()] 32-Bit Integer Table (returns an Int32[] type)

pinteger32table 

[ReadGroupItems(), Read32BitIntegerTable(), Write32BitIntegerTable()] Pointer to a 32-Bit Integer Table (returns an Int32[] type)

integer64table 

[ReadGroupItems(), Read64BitIntegerTable(), Write64BitIntegerTable()] 64-Bit Integer Table (returns an Int64[] type)hell

pinteger64table 

[ReadGroupItems(), Read64BitIntegerTable(), Write64BitIntegerTable()] Pointer to a 64-Bit Integer Table (returns an Int64 type)

float32table 

[ReadGroupItems(), Read32BitFloatTable(), Write32BitFloatTable()] 32-Bit Float Table (returns a Single[] type)

pfloat32table 

[ReadGroupItems(), Read32BitFloatTable(), Write32BitFloatTable()] Pointer to a 32-Bit Float Table (returns a Single[] type)

stringtable 

[ReadGroupItems(), ReadStringTable(), WriteStringTable()] String Table (returns a String[] type).

pstringtable 

[ReadGroupItems(), ReadStringTable(), WriteStringTable()] Pointer to a String Table (returns a String[] type)

chart 

[ReadGroupItems(), ReadStringTable(), WriteStringTable()] Chart status, returns eChartStatus)

pchart 

[ReadGroupItems(), ReadStringTable(), WriteStringTable()] Pointer to a chart, returns eChartStatus)

powerupclear 

Internal operation performed when opening a connection to a controller.

firmwareversion 

[ReadItem()] Firmware version of the controller (returns a String type)

partnumber 

[ReadItem()] Returns connected device's part number (returns a String type)

stackdepth 

[ReadItem()] Stack depth (returns an Int32)

volatilememory 

[ReadItem()] Volatile memory available. (returns an Int32)

nonvolatilememory 

[ReadItem()] Non-volatile memory available. (returns an Int32)

filememory 

[ReadItem()] Amount of file memory available (does not include MicroSD). (returns an Int32)

uptimeseconds 

[ReadItem()] Time in seconds since controller has been continuously running in seconds. (returns and Int32)

strategyname 

[ReadItem()] Name of the strategy. Blank if a strategy is not found. (returns String)

strategytimestamp 

[ReadItem()] Timestamp of the strategy. Blank if a strategy is not found. (returns String)

strategydatestamp 

[ReadItem()] Datestamp of the strategy. Blank if a strategy is not found. (returns String)

autorunstatus 

[ReadItem()] Autorun status. Non-zero indicates autorun. (returns Int32)

timedate 

[ReadItem()] controller's data and time. (returns String)

startchart 

[WriteChartStatus()] Start a chart. (Data is the name of the chart).

pstartchart 

[WriteChartStatus()] Start a chart. (Data is the name of the chart).

stopchart 

[WriteChartStatus()] Stop a chart. (Data is the name of the chart).

pstopchart 

[WriteChartStatus()] Stop a chart. (Data is the name of the chart).

suspendchart 

[WriteChartStatus()] Suspend a chart. (Data is the name of the chart).

psuspendchart 

[WriteChartStatus()] Suspend a chart. (Data is the name of the chart).

continuechart 

[WriteChartStatus()] Continue a chart. (Data is the name of the chart).

pcontinuechart 

[WriteChartStatus()] Continue a chart. (Data is the name of the chart).

chartsrunningcount 

[ReadItem()] Number of charts running. (returns Int32, the number of charts running). Note, zero charts running means the strategy is effectively stopped unless serial interrupts are enabled or an HMI is responsible for starting charts.

writedatetimefromlocalpctime 

[WriteControllerDateTimeUsingPcLocalTime()] Set the date and time from the PC's current local time. No data is required.

writedatetimefromuserdata 

[WriteDateTimeFromUser()] Set the date and time from user data.

Provide a 6 element integer table with the following values, lowest to highest index: (Month 1-12, Day 0 though 6, Year modulo 100, Hour (0-23), Min (0-59), Sec (0-59)

getobjectinfo 

Internal operation.

getmessagequeuecount 

[ReadItem()] retrieve the number of messages currently in the message queue. Returns an Int32 for data.

getmessagequeue 

[ReadItem()] Retrieve the messages in the message queue. Returns an controller.MessageEntry[]. Up to 1000 messages may be returned. This may take a 'long' time.

clearallmessages 

[ReadItem()] Clears all messages from the messages queue.

apoint 

[ReadGroupItems(), WriteAnalogPointAttribute()] Analog point. Additional attributes used with this type.

papoint 

[ReadGroupItems(), WriteAnalogPointAttribute()] Pointer to an analog point. Additional attributes used with this type.

dpoint 

[ReadGroupItems(), WriteDiscretePointAttribute()] Digital point. Additional attributes used with this type.

pdpoint 

[ReadGroupItems(), WriteDiscretePointAttribute()] Pointer to a digital point. Additional attributes used with this type.

startstrategy 

[WriteStartControllerStrategy()] Start strategy. If the strategy is running, it is first stopped and then started.

stopstrategy 

[WriteStopControllerStrategy()] Stop strategy.

pid 

[ReadGroupItems()] Read a SNAP-PAC based PID. Since this abstracts to an I/O read operation, this may take a considerable amount of time to process.

ppid 

[ReadGroupItems()] Read a SNAP-PAC based PID via a pointer. Since this abstracts to an I/O read operation, this may take a considerable amount of time to process.

PID attributes, all items are group read only.

Enumerator
input 

PID Input.

setpoint 

PID Setpoint.

output 

PID Output.

gain 

PID Gain.

integral 

PID Integral.

derivative 

PID Derivative.

scanrate 

PID Scanrate.

automanual 

PID Auto/Manual setting.

Constructor & Destructor Documentation

Opto22.Controller.Controller.Item.Item ( )

Constructor

Member Function Documentation

Boolean Opto22.Controller.Controller.Item.GetAnalogData ( Item.eAnalogPointAttributes  AnalogAttribute,
out Single  f32Value 
)

analog point and pointer to analog point attribute fetch

Returns
Boolean Opto22.Controller.Controller.Item.GetData ( out Boolean  bValue)

Retrieve the data as an bValue. Returns false if the data type mismatches or is incorrect.

Parameters
bValuebValue read from controller.
Boolean Opto22.Controller.Controller.Item.GetData ( out Int32  i32)

Retrieve the data as an Int32. Returns false if the data type mismatches or is incorrect.

Parameters
i32Int32 read from controller.
Boolean Opto22.Controller.Controller.Item.GetData ( out Int64  i64)

Retrieve the data as an Int64. Returns false if the data type mismatches or is incorrect.

Parameters
i64Int64 read from controller.
Boolean Opto22.Controller.Controller.Item.GetData ( out Single  f32)

Retrieve the data as a Single. Returns false if the data type mismatches or is incorrect.

Parameters
f32Single read from controller.
Boolean Opto22.Controller.Controller.Item.GetData ( out String  s)

Retrieve the data as a string. Returns false if the data type mismatches or is incorrect.

Parameters
sString read from controller.
Boolean Opto22.Controller.Controller.Item.GetData ( out Int32[]  i32ary)

Retrieve the data as an Int32 array. Returns false if the data type mismatches or is incorrect.

Parameters
i32aryInt32 array.
Boolean Opto22.Controller.Controller.Item.GetData ( out Int64[]  i64ary)

Retrieve the data as an Int64 array. Returns false if the data type mismatches or is incorrect.

Parameters
i64aryInt64 array.
Boolean Opto22.Controller.Controller.Item.GetData ( out Single[]  f32ary)

Retrieve the data as a Single array. Returns false if the data type mismatches or is incorrect.

Parameters
f32arySingle array.
Boolean Opto22.Controller.Controller.Item.GetData ( out String[]  sary)

Retrieve the data as a string array. Returns false if the data type mismatches or is incorrect.

Parameters
saryString array.
Boolean Opto22.Controller.Controller.Item.GetData ( out eChartStatus  ChartStatus)

Retrieve the data as a chart status enumeration. Returns false if the item was set with an incorrect enumeration (type).

Parameters
ChartStatusChart status interpreted from controller data.
Boolean Opto22.Controller.Controller.Item.GetDiscreteData ( Item.eDiscretePointAttributes  DiscreteAttribute,
out Boolean  bValue 
)

discrete point and pointer to analog point attribute fetch

Returns
Boolean Opto22.Controller.Controller.Item.GetDiscreteData ( Item.eDiscretePointAttributes  DiscreteAttribute,
out Int32  i32Value 
)

discrete point and pointer to discrete point 32-bit integer attribute fetch

Returns
eItemTypes Opto22.Controller.Controller.Item.GetItemType ( )

Retrieve the item tag type.

Returns
Int32 Opto22.Controller.Controller.Item.GetNumberofElements ( )

Retrieve the number of elements requested from the table. Only useful if the item is a table type.

Returns
Boolean Opto22.Controller.Controller.Item.GetPidData ( Item.ePidAttributes  PidAttribute,
out Single  f32Value 
)

Access data from a PID or pointer to a PID read.

Parameters
PidAttributeAttribute requested.
f32ValueValue fetched.
Returns
False if attribute is incorrect or the read was not successful.
Boolean Opto22.Controller.Controller.Item.GetPidData ( Item.ePidAttributes  PidAttribute,
out Boolean  bValue 
)

Access data from a PID or pointer to a PID read.

Parameters
PidAttributeAttribute requested.
bValueValue fetched.
Returns
False if attribute is incorrect or the read was not successful.
Int32 Opto22.Controller.Controller.Item.GetStartIndex ( )

Retrieve the item's table start index. Only useful if this is a table type.

Returns
String Opto22.Controller.Controller.Item.GetTag ( )

Retrieve the item tag name.

Returns
void Opto22.Controller.Controller.Item.Reset ( )

Reset the item object for reuse.

Boolean Opto22.Controller.Controller.Item.SetAnalogRead ( String  sNewTag,
eItemTypes  eNewType,
eAnalogPointAttributes[]  earyNewAnalogAttributes,
Int32  i32AttributeLength 
)

Set an analog point read with attributes. Use for grouped reads.

Parameters
sNewTagAnalog point name.
eNewTypeParameter type, only apoint and papoint types supported.
earyNewAnalogAttributesArray of analog point attributes to fetch.
i32AttributeLengthVolume of attributes to fetch.
Returns
True if the analog read is properly configured.
Boolean Opto22.Controller.Controller.Item.SetDiscreteRead ( String  sNewTag,
eItemTypes  eNewType,
eDiscretePointAttributes[]  earyNewDiscreteAttributes,
Int32  i32AttributeLength 
)

Configure a discrete point read. Use for grouped reads.

Parameters
sNewTagDiscrete point name.
eNewTypeType, only dpoint and pdpoint allowed.
earyNewDiscreteAttributesArray of discrete attributes to retrieve.
i32AttributeLengthAttribute length.
Returns
True if the discrete configuration is correct.
Boolean Opto22.Controller.Controller.Item.SetPidRead ( String  sNewTag,
eItemTypes  eNewType,
ePidAttributes[]  earyNewAttributes,
Int32  i32AttributeLength 
)

Set a PID to read. Use for grouped reads.

Parameters
sNewTagName of the PID.
eNewTypeUse either ePidAttributes.pid or ePidAttributes.ppid.
earyNewAttributesArray of requested attributes.
i32AttributeLengthLength of requested attributes.
Returns
True if the PID read is correct.
Boolean Opto22.Controller.Controller.Item.SetRead ( String  sNewTag,
eItemTypes  eNewType 
)

Set an Item to Read (for non-table types). Use for grouped reads.

Parameters
sNewTagTag name.
eNewTypeThe Object type.
Boolean Opto22.Controller.Controller.Item.SetRead ( String  sTag,
eItemTypes  eType,
Int32  i32StartIndex,
Int32  i32Elements 
)

Set an Item to Read (for table types). Use for grouped reads.

Parameters
sTagTag name.
eTypeThe Object type.
i32StartIndexStart element of the table (table indices start from zero).
i32ElementsNumber of table elements to read.

Property Documentation

Int32 Opto22.Controller.Controller.Item.ErrorResult
get

Retrieve the adjoining error code when a GetSuccessStatus or GetStatus(bSuccess) return a false value.

Boolean Opto22.Controller.Controller.Item.SuccessfulRead
get

Retrieve the success flag, only valid when ReadList() or WriteList() return true.


The documentation for this class was generated from the following file: