Opto22.Controller
Controller .Net Software Development Kit for SNAP-PAC
|
PAC-DEV-CONTROLLER-DOTNET; Controller .Net Software Development Kit for SNAP-PAC .Net Framework 4.0 Windows 7, Windows 8/8.1, More...
Inherits IDisposable.
Classes | |
class | Item |
Item class for configuring and submitting grouped item reads. More... | |
class | MessageEntry |
This object type is returned when reading the control controller's message queue. More... | |
Public Types | |
enum | FastDataAccessEnumerations { FastDataAccessEnumerations.NotSet = -1, FastDataAccessEnumerations.Version1 = 0, FastDataAccessEnumerations.Version2 = 1 } |
Enumerations for the generation of data access commands More... | |
enum | eChartStatus { eChartStatus.Stopped, eChartStatus.Running, eChartStatus.Suspended } |
Chart status enumerations. Simpler to use than the numeric version. More... | |
enum | ErrorResponse { ErrorResponse.Success = 0, ErrorResponse.ArgumentFault, ErrorResponse.ItemFault, ErrorResponse.CommunicationFault } |
List of response codes from data accessing methods. More... | |
Public Member Functions | |
Controller () | |
Constructor More... | |
void | Dispose () |
Dispose More... | |
ErrorResponse | OpenSession (String sHost, Int32 i32Port, Int32 i32CommunicationTimeoutMs) |
Open a communication session with a SNAP-PAC Controller. If a TCP session was open, this method will close the old session and attempt to connect. More... | |
void | CloseSession () |
Close the tcp session to the controller. More... | |
ErrorResponse | ReadGroupItems (Item[] aryItems, Int32 i32ItemListStartIndex, Int32 i32NumberOfItemsToRead) |
Read an item list as a group. This is the preferrable method when reading a large number of objects. More... | |
ErrorResponse | ReadItemPuc () |
Power up clear. Note, this function is performed automatically when the object is successfully connected. More... | |
ErrorResponse | ReadItem (Controller.Item.eItemTypes eType, out Int32 i32Value) |
Read single 32-bit integer non-variable item. More... | |
ErrorResponse | ReadItem (Controller.Item.eItemTypes eType, out String sValue) |
Read non-variable string parameters. More... | |
ErrorResponse | Read32BitIntegerVariable (String sTag, Boolean bTagIsPointer, out Int32 i32Variable) |
Read 32-bit integer variable. More... | |
ErrorResponse | Read64BitIntegerVariable (String sTag, Boolean bTagIsPointer, out Int64 i64Variable) |
Read 64-bit integer variable. More... | |
ErrorResponse | Read32BitFloatVariable (String sTag, Boolean bTagIsPointer, out Single f32Variable) |
Read 32-bit float variable. More... | |
ErrorResponse | ReadUpTimerVariable (String sTag, Boolean bTagIsPointer, out Single f32Variable) |
Read up timer variable. More... | |
ErrorResponse | ReadDownTimerVariable (String sTag, Boolean bTagIsPointer, out Single f32Variable) |
Read down timer variable. More... | |
ErrorResponse | ReadStringVariable (String sTag, Boolean bTagIsPointer, out String sVariable) |
Read string variable. More... | |
ErrorResponse | Read32BitIntegerTable (String sTag, Boolean bTagIsPointer, Int32 i32StartIndex, Int32 i32Quantity, out Int32[] i32aryTable) |
Read 32-bit integer table. More... | |
ErrorResponse | Read64BitIntegerTable (String sTag, Boolean bTagIsPointer, Int32 i32StartIndex, Int32 i32Quantity, out Int64[] i64aryTable) |
Read 64-bit integer table. More... | |
ErrorResponse | Read32BitFloatTable (String sTag, Boolean bTagIsPointer, Int32 i32StartIndex, Int32 i32Quantity, out Single[] f32aryTable) |
Read 32-bit float table. More... | |
ErrorResponse | ReadStringTable (String sTag, Boolean bTagIsPointer, Int32 i32StartIndex, Int32 i32Quantity, out String[] saryTable) |
Read string table. More... | |
ErrorResponse | ReadChartStatus (String sTag, Boolean bTagIsPointer, out eChartStatus eStatus) |
Read chart status. More... | |
ErrorResponse | WriteControllerDateTimeUsingPcLocalTime () |
Update controller's date/time using PC's local date/time. More... | |
ErrorResponse | WriteStopControllerStrategy () |
Stop controller strategy. More... | |
ErrorResponse | WriteStartControllerStrategy () |
Start controller strategy. More... | |
ErrorResponse | WriteClearControllerMessageQueue () |
Clear controller message queue. More... | |
ErrorResponse | WriteAnalogPointAttribute (String sTag, Boolean bTagIsPointer, Controller.Item.eAnalogPointAttributes eAnalogAttribute, Single f32Value) |
Write analog float attribute. More... | |
ErrorResponse | WriteDiscretePointAttribute (String sTag, Boolean bTagIsPointer, Controller.Item.eDiscretePointAttributes eDiscreteAttribute, Boolean bState) |
Write discrete point boolean attribute. More... | |
ErrorResponse | WriteUpTimerVariable (String sTag, Boolean bTagIsPointer, Single f32Value) |
Write a up timer variable. More... | |
ErrorResponse | WriteDownTimerVariable (String sTag, Boolean bTagIsPointer, Single f32Value) |
Write a down timer variable. More... | |
ErrorResponse | Write32BitFloatVariable (String sTag, Boolean bTagIsPointer, Single f32Value) |
Write a 32-bit float variable. More... | |
ErrorResponse | Write32BitFloatTable (String sTag, Boolean bTagIsPointer, Single[] f32aryValues, Int32 i32ControllerStartIndex, Int32 i32WriteLength) |
Write 32-bit float table. More... | |
ErrorResponse | Write32BitIntegerVariable (String sTag, Boolean bTagIsPointer, Int32 i32Value) |
Write an 32-bit integer variable. More... | |
ErrorResponse | Write32BitIntegerTable (String sTag, Boolean bTagIsPointer, Int32[] i32aryValues, Int32 i32ControllerStartIndex, Int32 i32WriteLength) |
Write 32-bit integer table. More... | |
ErrorResponse | WriteDateTimeFromUser (Int32[] i32aryValues) |
Write controller date/time via supplied data. More... | |
ErrorResponse | Write64BitIntegerVariable (String sTag, Boolean bTagIsPointer, Int64 i64Value) |
Write a 64-bit integer. More... | |
ErrorResponse | Write64BitIntegerTable (String sTag, Boolean bTagIsPointer, Int64[] i64aryValues, Int32 i32ControllerStartIndex, Int32 i32WriteLength) |
Write a 64-bit integer table. More... | |
ErrorResponse | WriteChartStatus (String sTag, Controller.Item.eItemTypes eType) |
Modify the status of a controller chart. More... | |
ErrorResponse | WriteStringVariable (String sTag, Boolean bTagIsPointer, String sValue) |
Write a string variable. More... | |
ErrorResponse | WriteStringTable (String sTag, Boolean bTagIsPointer, String[] sary, Int32 i32ControllerStartIndex, Int32 i32WriteLength) |
Write a string table. More... | |
Boolean | PopMessageLogged (out String sMessage) |
Removes the newest logged message off the event log. Oldest messages are flushed if the list becomes too full. More... | |
Static Public Member Functions | |
static Item[] | NewItemList (Int32 i32ItemQuantity) |
Create a new item list. More... | |
Protected Member Functions | |
virtual void | Dispose (Boolean bDisposing) |
Clean up resources. More... | |
Properties | |
Boolean | FragmentedTransmissions [get] |
Returns if fragmented transmissions is configured. Only valid after a successful communication opening to the controller. More... | |
FastDataAccessEnumerations | DataAccessMethod [get] |
Retrieve controller data protocol grouped data access method. More... | |
Int32 | CommunicationTimeout [get, set] |
Communication timeout in units of milliseconds. 100 millisecond minimum enforced. Normally this value is usually 1000 milliseconds or larger. More... | |
Int32 | MessageLogCount [get] |
Returns how many messages are logged in the queue. More... | |
PAC-DEV-CONTROLLER-DOTNET; Controller .Net Software Development Kit for SNAP-PAC .Net Framework 4.0 Windows 7, Windows 8/8.1,
List of response codes from data accessing methods.
Enumerator | |
---|---|
Success |
Successful operation. |
ArgumentFault |
An argument of the method (attribute or type) is not supported by this method. |
ItemFault |
If the method accesses a table, the indexes specified may be out of range. If the method contains a controller tag, the tag does not exist on the controller, the tag is misspelled or case incorrect. |
CommunicationFault |
A communication fault occurred. Close the communication using CloseSession(); backoff for at least one second and attempt to connect using OpenSession(). |
Opto22.Controller.Controller.Controller | ( | ) |
Constructor
void Opto22.Controller.Controller.CloseSession | ( | ) |
Close the tcp session to the controller.
void Opto22.Controller.Controller.Dispose | ( | ) |
Dispose
|
protectedvirtual |
Clean up resources.
bDisposing |
|
static |
Create a new item list.
i32ItemQuantity | The maximum number of items in this list. |
ErrorResponse Opto22.Controller.Controller.OpenSession | ( | String | sHost, |
Int32 | i32Port, | ||
Int32 | i32CommunicationTimeoutMs | ||
) |
Open a communication session with a SNAP-PAC Controller. If a TCP session was open, this method will close the old session and attempt to connect.
sHost | Host name (fully qualified domain name) in host name or IPV4 dot format (like 1.2.3.4). |
i32Port | Port number, typically 22001. |
i32CommunicationTimeoutMs | Initial communication timeout, typically 1000 ms. |
Boolean Opto22.Controller.Controller.PopMessageLogged | ( | out String | sMessage | ) |
Removes the newest logged message off the event log. Oldest messages are flushed if the list becomes too full.
sMessage | Storage of the topmost message. |
ErrorResponse Opto22.Controller.Controller.Read32BitFloatTable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Int32 | i32StartIndex, | ||
Int32 | i32Quantity, | ||
out Single[] | f32aryTable | ||
) |
Read 32-bit float table.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
i32StartIndex | Controller table start index. |
i32Quantity | Number of elements to read. |
f32aryTable | When return is true and bSuccess is true, the value read from the controller. |
ErrorResponse Opto22.Controller.Controller.Read32BitFloatVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
out Single | f32Variable | ||
) |
Read 32-bit float variable.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
f32Variable | When return is true and bSuccess is true, the value read from the controller. |
ErrorResponse Opto22.Controller.Controller.Read32BitIntegerTable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Int32 | i32StartIndex, | ||
Int32 | i32Quantity, | ||
out Int32[] | i32aryTable | ||
) |
Read 32-bit integer table.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
i32StartIndex | Controller table start index. |
i32Quantity | Number of elements to read. |
i32aryTable | When return is true and bSuccess is true, the table read from the controller. |
ErrorResponse Opto22.Controller.Controller.Read32BitIntegerVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
out Int32 | i32Variable | ||
) |
Read 32-bit integer variable.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
i32Variable | When return is true and bSuccess is true, the value read from the controller. |
ErrorResponse Opto22.Controller.Controller.Read64BitIntegerTable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Int32 | i32StartIndex, | ||
Int32 | i32Quantity, | ||
out Int64[] | i64aryTable | ||
) |
Read 64-bit integer table.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
i32StartIndex | Controller table start index. |
i32Quantity | Number of elements to read. |
i64aryTable | When return is true and bSuccess is true, the value read from the controller. |
ErrorResponse Opto22.Controller.Controller.Read64BitIntegerVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
out Int64 | i64Variable | ||
) |
Read 64-bit integer variable.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
i64Variable | When return is true and bSuccess is true, the value read from the controller. |
ErrorResponse Opto22.Controller.Controller.ReadChartStatus | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
out eChartStatus | eStatus | ||
) |
Read chart status.
sTag | Case sensitive name of the chart to interrogate. |
bTagIsPointer | True if the tag is a pointer variable to a chart. |
eStatus | Status of the chart. Valid only when the method returns a successful status. |
ErrorResponse Opto22.Controller.Controller.ReadDownTimerVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
out Single | f32Variable | ||
) |
Read down timer variable.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
f32Variable | When return is true and bSuccess is true, the value read from the controller. |
ErrorResponse Opto22.Controller.Controller.ReadGroupItems | ( | Item[] | aryItems, |
Int32 | i32ItemListStartIndex, | ||
Int32 | i32NumberOfItemsToRead | ||
) |
Read an item list as a group. This is the preferrable method when reading a large number of objects.
This method applies to 32/64-bit integers, 32-bit floats, up/down timers, string variables, 32/64-bit tables, 32-bit float tables, string tables, discrete points and analog points.
aryItems | The preconfigured item array with read values. |
i32ItemListStartIndex | Start index of the item array to use. |
i32NumberOfItemsToRead | The number of items from the start index to read from. |
ErrorResponse Opto22.Controller.Controller.ReadItem | ( | Controller.Item.eItemTypes | eType, |
out Int32 | i32Value | ||
) |
Read single 32-bit integer non-variable item.
eType | Use autorunstatus, chartsrunningcount, filememory, getmessagequeuecount, nonvolatilememory, stackdepth, uptimeseconds, and volatilememory. |
i32Value | Returned value from operation. |
ErrorResponse Opto22.Controller.Controller.ReadItem | ( | Controller.Item.eItemTypes | eType, |
out String | sValue | ||
) |
Read non-variable string parameters.
eType | Use firmwareversion, partnumber, strategydatestamp, strategyname, strategytimestamp, or timedate. |
sValue |
ErrorResponse Opto22.Controller.Controller.ReadItemPuc | ( | ) |
Power up clear. Note, this function is performed automatically when the object is successfully connected.
ErrorResponse Opto22.Controller.Controller.ReadStringTable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Int32 | i32StartIndex, | ||
Int32 | i32Quantity, | ||
out String[] | saryTable | ||
) |
Read string table.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
i32StartIndex | Controller table start index. |
i32Quantity | Number of elements to read. |
saryTable | When return is true and bSuccess is true, the value read from the controller. |
ErrorResponse Opto22.Controller.Controller.ReadStringVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
out String | sVariable | ||
) |
Read string variable.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
sVariable | When return is true and bSuccess is true, the value read from the controller. |
ErrorResponse Opto22.Controller.Controller.ReadUpTimerVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
out Single | f32Variable | ||
) |
Read up timer variable.
sTag | Controller variable to read. |
bTagIsPointer | True if the tag is a pointer. |
f32Variable | When return is true and bSuccess is true, the value read from the controller. |
ErrorResponse Opto22.Controller.Controller.Write32BitFloatTable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Single[] | f32aryValues, | ||
Int32 | i32ControllerStartIndex, | ||
Int32 | i32WriteLength | ||
) |
Write 32-bit float table.
sTag | Tag of the float table. |
bTagIsPointer | True if the tag is a pointer. |
f32aryValues | Array of values to write. |
i32ControllerStartIndex | Starting index on the controller to begin writing at. |
i32WriteLength | Length of data to write. |
ErrorResponse Opto22.Controller.Controller.Write32BitFloatVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Single | f32Value | ||
) |
Write a 32-bit float variable.
sTag | Object name. |
bTagIsPointer | True when tag is a pointer. |
f32Value | Value to write. |
ErrorResponse Opto22.Controller.Controller.Write32BitIntegerTable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Int32[] | i32aryValues, | ||
Int32 | i32ControllerStartIndex, | ||
Int32 | i32WriteLength | ||
) |
Write 32-bit integer table.
sTag | 32-bit integer array tag. |
bTagIsPointer | True if tag is a pointer. |
i32aryValues | Array of values. |
i32ControllerStartIndex | Starting index on the controller to write too. |
i32WriteLength | Quantity of values to write. |
ErrorResponse Opto22.Controller.Controller.Write32BitIntegerVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Int32 | i32Value | ||
) |
Write an 32-bit integer variable.
sTag | Tag of the integer. |
bTagIsPointer | True if tag is a pointer. |
i32Value | Value to write. |
ErrorResponse Opto22.Controller.Controller.Write64BitIntegerTable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Int64[] | i64aryValues, | ||
Int32 | i32ControllerStartIndex, | ||
Int32 | i32WriteLength | ||
) |
Write a 64-bit integer table.
sTag | 64-bit controller table name. |
bTagIsPointer | True if tag is a pointer. |
i64aryValues | Array of values to write. |
i32ControllerStartIndex | Controller start index to begin writing too. |
i32WriteLength | Length of values to write. |
ErrorResponse Opto22.Controller.Controller.Write64BitIntegerVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Int64 | i64Value | ||
) |
Write a 64-bit integer.
sTag | 64-bit integer tag. |
bTagIsPointer | True if tag is a pointer. |
i64Value | Value to write. |
ErrorResponse Opto22.Controller.Controller.WriteAnalogPointAttribute | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Controller.Item.eAnalogPointAttributes | eAnalogAttribute, | ||
Single | f32Value | ||
) |
Write analog float attribute.
sTag | Analog point tag. |
bTagIsPointer | Use apoint or papoint. |
eAnalogAttribute | Use eu. |
f32Value | Value read. |
ErrorResponse Opto22.Controller.Controller.WriteChartStatus | ( | String | sTag, |
Controller.Item.eItemTypes | eType | ||
) |
Modify the status of a controller chart.
sTag | Controller name of a chart. |
eType | Use startchart, pstartchart, continuechart, pcontinuechart, suspendchart, psuspendchart, stopchart, or pstopchart. Use continuechart to resume a suspended chart. |
ErrorResponse Opto22.Controller.Controller.WriteClearControllerMessageQueue | ( | ) |
Clear controller message queue.
ErrorResponse Opto22.Controller.Controller.WriteControllerDateTimeUsingPcLocalTime | ( | ) |
Update controller's date/time using PC's local date/time.
ErrorResponse Opto22.Controller.Controller.WriteDateTimeFromUser | ( | Int32[] | i32aryValues | ) |
Write controller date/time via supplied data.
i32aryValues | Int32[6] of time data. |
ErrorResponse Opto22.Controller.Controller.WriteDiscretePointAttribute | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Controller.Item.eDiscretePointAttributes | eDiscreteAttribute, | ||
Boolean | bState | ||
) |
Write discrete point boolean attribute.
sTag | Name of the discrete point. |
bTagIsPointer | True when tag is a pointer. |
eDiscreteAttribute | Use state. |
bState | State to write. |
ErrorResponse Opto22.Controller.Controller.WriteDownTimerVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Single | f32Value | ||
) |
Write a down timer variable.
sTag | Object name. |
bTagIsPointer | True when tag is a pointer. |
f32Value | Value to write. |
ErrorResponse Opto22.Controller.Controller.WriteStartControllerStrategy | ( | ) |
Start controller strategy.
ErrorResponse Opto22.Controller.Controller.WriteStopControllerStrategy | ( | ) |
Stop controller strategy.
ErrorResponse Opto22.Controller.Controller.WriteStringTable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
String[] | sary, | ||
Int32 | i32ControllerStartIndex, | ||
Int32 | i32WriteLength | ||
) |
Write a string table.
sTag | Controller string table name. |
bTagIsPointer | True if the tag is a pointer to a string table. |
sary | String array. |
i32ControllerStartIndex | Controller string table beginning index. |
i32WriteLength | Quantity of strings to write. |
ErrorResponse Opto22.Controller.Controller.WriteStringVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
String | sValue | ||
) |
Write a string variable.
sTag | Name of the controller's string variable. |
bTagIsPointer | True if tag is a pointer. |
sValue | String to write. |
ErrorResponse Opto22.Controller.Controller.WriteUpTimerVariable | ( | String | sTag, |
Boolean | bTagIsPointer, | ||
Single | f32Value | ||
) |
Write a up timer variable.
sTag | Object name. |
bTagIsPointer | True when tag is a pointer. |
f32Value | Value to write. |
|
getset |
Communication timeout in units of milliseconds. 100 millisecond minimum enforced. Normally this value is usually 1000 milliseconds or larger.
|
get |
Retrieve controller data protocol grouped data access method.
|
get |
Returns if fragmented transmissions is configured. Only valid after a successful communication opening to the controller.
|
get |
Returns how many messages are logged in the queue.