|
OptoMMP3
|
Encapsulation class for assisting streaming implementations using the OptoMMP streaming capability. More...
Public Member Functions | |
| delegate void | ProcessStream (StreamMessage Message) |
| Delegate to process the stream message. More... | |
| OptoMMPStream () | |
| Constructor More... | |
| void | Open (Int32 i32UdpPort, ProcessStream MessageHandler) |
| Open the OptoMMPStream object More... | |
| Int32 | Start () |
| Start the stream object on the PC side. More... | |
| void | Stop () |
| Stop the background thread. More... | |
| void | Close () |
| Close the whole object. More... | |
Static Public Member Functions | |
| static Boolean | ProcessMessageasBrainStream (StreamMessage Message, out EndPoint endpoint, out short i16SequenceId, out Single[] faryAnalog, out UInt32[] u32aryCounters, out UInt64 u64DigitalStates, out UInt64 u64OnLatches, out UInt64 u64OffLatches, out UInt64 u64ActiveCounters) |
| Process a message returned as a callback. This handles the default "streaming" configuration of the Opto MMP device. More... | |
| static Boolean | ProcessMessageasBrainStreamUint32Array (StreamMessage Message, out EndPoint endpoint, out Int16 i16SequenceId, out UInt32 u32ExpectedMmpAddress, Int32 i32ExpectedU32Ints, out UInt32[] u32aryValues) |
| Process a message returned as a callback. This handles a customer stream of just 32-bit unsigned integers. The data may be casted as 32-bit signed integers too. More... | |
| static Boolean | ProcessMessageasBrainStreamSingleArray (StreamMessage Message, out EndPoint endpoint, out Int16 i16SequenceId, out Int32 i32ExpectedMmpAddress, Int32 i32ExpectedSingles, out Single[] f32aryValues) |
| Process a message returned as a callback. This handles a custom stream of floats (aka Singles). More... | |
| static Boolean | ProcessMessageasBrainStreamRawBytes (StreamMessage Message, out EndPoint endpoint, out int i32DataLength, out Byte[] byary) |
| Process a message returned as a callback. This handles a custom stream of floats (aka Singles). More... | |
Encapsulation class for assisting streaming implementations using the OptoMMP streaming capability.
This functionality is available with any Opto 22 Ethernet based I/O brain.
This library is currently built with the 3.5 SP1 .Net Framework.
This library supports Windows 7 Professional, Windows 8.1 Professional. Please use an Intel "Core 2" or AMD Athlon II or Phenom (or newer) microprocessor.
| Opto22.StreamsHelper.OptoMMPStream.OptoMMPStream | ( | ) |
Constructor
| void Opto22.StreamsHelper.OptoMMPStream.Close | ( | ) |
Close the whole object.
| void Opto22.StreamsHelper.OptoMMPStream.Open | ( | Int32 | i32UdpPort, |
| ProcessStream | MessageHandler | ||
| ) |
Open the OptoMMPStream object
| i32UdpPort | The PC UDP port to receive data on. |
| MessageHandler | Delegate call-back routine to handle the received message. |
|
static |
Process a message returned as a callback. This handles the default "streaming" configuration of the Opto MMP device.
Many Opto MMP devices may be configured to stream at one thread. Each device may be determined by comparing the "EndPoint" information.
Since this is UDP, the receiver should inspect the "endpoint" address to ensure it can identify the correct sender of this message.
| Message | The message given by the callback. |
| endpoint | The source of the message. |
| i16SequenceId | Sequence ID of this message, a value from 0 to 15. |
| faryAnalog | 64 analog values of the brain. |
| u32aryCounters | Value of the enabled digital input counters (from 64 point map) |
| u64DigitalStates | 64-bit compressed value of all the 64-point digital states. 1 == on. |
| u64OnLatches | 64-bit compressed value of all the 64-point digital on latches. 1 == latched. |
| u64OffLatches | 64-bit compressed value of all the 64-point digital off latches. 1 == latched. |
| u64ActiveCounters | 64-bit compressed value of all the active counter states. 1 == enabled. |
|
static |
Process a message returned as a callback. This handles a custom stream of floats (aka Singles).
Many Opto MMP devices may be configured to stream at one thread. Each device may be determined by comparing the "EndPoint" information.
Since this is UDP, the receiver should inspect the "endpoint" address to ensure it can identify the correct sender of this message.
| Message | The message given by the callback. |
| endpoint | The source of the message. |
| i32DataLength | Length of the data in bytes. |
| byary | The data received. |
|
static |
Process a message returned as a callback. This handles a custom stream of floats (aka Singles).
Many Opto MMP devices may be configured to stream at one thread. Each device may be determined by comparing the "EndPoint" information.
Since this is UDP, the receiver should inspect the "endpoint" address to ensure it can identify the correct sender of this message.
| Message | The message given by the callback. |
| endpoint | The source of the message. |
| i16SequenceId | Sequence ID of this message, a value from 0 to 15. |
| i32ExpectedMmpAddress | The OptoMMP address reported. |
| i32ExpectedSingles | The number of expected singles in the response. |
| f32aryValues |
|
static |
Process a message returned as a callback. This handles a customer stream of just 32-bit unsigned integers. The data may be casted as 32-bit signed integers too.
Many Opto MMP devices may be configured to stream at one thread. Each device may be determined by comparing the "EndPoint" information.
Since this is UDP, the receiver should inspect the "endpoint" address to ensure it can identify the correct sender of this message.
| Message | The message given by the callback. |
| endpoint | The source of the message. |
| i16SequenceId | Sequence ID of this message, a value from 0 to 15. |
| u32ExpectedMmpAddress | The expected Opto MMP address of the packet. |
| i32ExpectedU32Ints | Expected number of 32-bit integers to receive. |
| u32aryValues | The values received. |
| delegate void Opto22.StreamsHelper.OptoMMPStream.ProcessStream | ( | StreamMessage | Message | ) |
Delegate to process the stream message.
| Message | A raw message buffer containing the data that arrived on the UDP socket. |
| Int32 Opto22.StreamsHelper.OptoMMPStream.Start | ( | ) |
Start the stream object on the PC side.
| void Opto22.StreamsHelper.OptoMMPStream.Stop | ( | ) |
Stop the background thread.