|
OptoMMP2
|
Encapsulation class for embedded strategy oriented streaming (for streaming features not supported by OptoMMPStream). More...
Public Member Functions | |
| DateTime | GetLastMessageTimeStamp () |
| Returns the last time any message was received from the device. More... | |
| DateTime | GetLastHeartbeatTimeStamp () |
| Returns the last time a heartbeat message was received. More... | |
| DateTime | Get64DigitalStatesAndLatches (out long i64DigitalStates, out long i64DigitalOnLatches, out long i64DigitalOffLatches) |
| Retrieve 64 digital states and latches. More... | |
| DateTime | Get64AnalogStates (out Single[] f32aryAnalog64States) |
| Retrieve the 64-point analog states. More... | |
| DateTime | GetAnalog64MaxMin (out Single[] f32aryAnalog64Max, out Single[] f32aryAnalog64Min) |
| Retrieve the Analog 64-point Maximum and Minimum values. More... | |
| DateTime | GetHDDigitalStates (out int[] i32aryHDDigitalStates) |
| Retrieve the High-Density Digital States More... | |
| DateTime | GetLower256AnalogStates (out Single[] f32aryLower256AnalogStates) |
| Get a copy of the lower 256 analog states (high-density analog included). More... | |
| DateTime | GetUpper256AnalogStates (out Single[] f32aryUpper256AnalogStates) |
| Get a copy of the uppper 256 analog states (high-density analog included) More... | |
| OptoStrategyStream () | |
| Constructor More... | |
| void | Open (int i32UdpPort, string sSourceIpAddress) |
| Configures the object to receive an OptoStrategy Stream. More... | |
| void | Close () |
| Close the object. More... | |
| void | Start () |
| Start the a background thread that processes the stream data. More... | |
| void | Stop () |
| Stop the background thread. More... | |
| void | Example () |
| Example using the OptoStreamsHelper More... | |
Public Attributes | |
| uint | u32NumberOfDroppedPackets = 0 |
| Counts how many times a packet from an unwanted host is received More... | |
Encapsulation class for embedded strategy oriented streaming (for streaming features not supported by OptoMMPStream).
Requires a SNAP-PAC-R1/2 Controller running a special strategy "Streaming Strategy." The strategy uses scratchpad resources to configure the stream. See the notes within this strategy for additional configuration information.
Since this is employed with the strategy, there will be a bit more jitter for high frequency applications. If you're running in the 100ms range, you may have a 1 to 2 ms jitter. This may vary slightly depending on module configuration and which particular data you have enabled. Less enabled data means more consistent updates. More enabled data means more jitter (less consistent updates).
This library is currently built with the 3.5 SP1 .Net Framework.
This library supports XP Professional, Vista Business, and Windows 7 Professional.
You should use an Intel "Core 2" or AMD Athlon II or Phenom (or newer) microprocessor.
| Opto22.StreamsHelper.OptoStrategyStream.OptoStrategyStream | ( | ) |
Constructor
| void Opto22.StreamsHelper.OptoStrategyStream.Close | ( | ) |
Close the object.
| void Opto22.StreamsHelper.OptoStrategyStream.Example | ( | ) |
Example using the OptoStreamsHelper
class Program { static void Main(string[] args) { OptoStrategyStream StrategyStream = new OptoStrategyStream();
Console.WriteLine("First Pass"); StrategyStream.Open(5001, "10.192.54.74"); StrategyStream.Start();
int i32Counter = 0; while (i32Counter < 15) { Thread.Sleep(1000); i32Counter++; }
StrategyStream.Stop(); Console.WriteLine("Second Start"); StrategyStream.Start(); i32Counter = 0; while (i32Counter < 30) { // todo: use the get functions to retrieve the data Thread.Sleep(1000); i32Counter++; }
StrategyStream.Close();
Console.WriteLine("Second Open"); StrategyStream.Open(5001, "10.192.54.74"); StrategyStream.Start();
i32Counter = 0; while (i32Counter < 15) { // todo: use the get functions to retrieve the data Thread.Sleep(1000); i32Counter++; }
StrategyStream.Stop(); Console.WriteLine("fourth Start"); StrategyStream.Start(); i32Counter = 0; while (i32Counter < 30) { // todo: use the get functions to retrieve the data Thread.Sleep(1000); i32Counter++; }
StrategyStream.Close(); } }
| DateTime Opto22.StreamsHelper.OptoStrategyStream.Get64AnalogStates | ( | out Single[] | f32aryAnalog64States | ) |
Retrieve the 64-point analog states.
| f32aryAnalog64States | Analog values. |
| DateTime Opto22.StreamsHelper.OptoStrategyStream.Get64DigitalStatesAndLatches | ( | out long | i64DigitalStates, |
| out long | i64DigitalOnLatches, | ||
| out long | i64DigitalOffLatches | ||
| ) |
Retrieve 64 digital states and latches.
| i64DigitalStates | 64-point digital states. |
| i64DigitalOnLatches | 64-point on latches. |
| i64DigitalOffLatches | 64-point off latches. |
| DateTime Opto22.StreamsHelper.OptoStrategyStream.GetAnalog64MaxMin | ( | out Single[] | f32aryAnalog64Max, |
| out Single[] | f32aryAnalog64Min | ||
| ) |
Retrieve the Analog 64-point Maximum and Minimum values.
| f32aryAnalog64Max | Array of the maximum values. |
| f32aryAnalog64Min | Array of the minimum values. |
| DateTime Opto22.StreamsHelper.OptoStrategyStream.GetHDDigitalStates | ( | out int[] | i32aryHDDigitalStates | ) |
Retrieve the High-Density Digital States
| i32aryHDDigitalStates | Array of digital states (32-points per module supported) |
| DateTime Opto22.StreamsHelper.OptoStrategyStream.GetLastHeartbeatTimeStamp | ( | ) |
Returns the last time a heartbeat message was received.
| DateTime Opto22.StreamsHelper.OptoStrategyStream.GetLastMessageTimeStamp | ( | ) |
Returns the last time any message was received from the device.
| DateTime Opto22.StreamsHelper.OptoStrategyStream.GetLower256AnalogStates | ( | out Single[] | f32aryLower256AnalogStates | ) |
Get a copy of the lower 256 analog states (high-density analog included).
| f32aryLower256AnalogStates | Values from the first 8 module positions. |
| DateTime Opto22.StreamsHelper.OptoStrategyStream.GetUpper256AnalogStates | ( | out Single[] | f32aryUpper256AnalogStates | ) |
Get a copy of the uppper 256 analog states (high-density analog included)
| f32aryUpper256AnalogStates |
| void Opto22.StreamsHelper.OptoStrategyStream.Open | ( | int | i32UdpPort, |
| string | sSourceIpAddress | ||
| ) |
Configures the object to receive an OptoStrategy Stream.
This is an enhanced strategy oriented streaming function that operates on PAC-R controllers. The controller must have the strategy downloaded and running.
| i32UdpPort | The service port to use on this computer. |
| sSourceIpAddress | IP address of the controller which is the source of the data. |
| void Opto22.StreamsHelper.OptoStrategyStream.Start | ( | ) |
Start the a background thread that processes the stream data.
| void Opto22.StreamsHelper.OptoStrategyStream.Stop | ( | ) |
Stop the background thread.
| uint Opto22.StreamsHelper.OptoStrategyStream.u32NumberOfDroppedPackets = 0 |
Counts how many times a packet from an unwanted host is received