OptoMMP3
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Opto22.OptoMMP3.OptoMMP Class Reference

Object for communicating with Opto MMP Devices. Assembly Version 3.0.3.0. More...

Classes

struct  stPid
 When reading or writing a PID, these are the available parameters returned or written. More...
 
struct  structBrainDiagnosticInformation
 Structure of information returned by ReadBrainDiagnosticInfo(). More...
 

Public Types

enum  Connection {
  Connection.UdpIp = 1, Connection.TcpIp, Connection.UdpIpv6, Connection.TcpIpv6,
  Connection.SerialOst
}
 Connection Types for Opto MMP More...
 
enum  IoModel { IoModel.IoModel64 = 64, IoModel.IoModel512 = 512 }
 For some methods and properties, specifies when a point index is offered, which IoModel the index references. More...
 
enum  StatusWriteCommand {
  StatusWriteCommand.PowerUpClear = 1, StatusWriteCommand.ResetToDefaults, StatusWriteCommand.StoreToFlash, StatusWriteCommand.EraseFlash,
  StatusWriteCommand.ResetHardware, StatusWriteCommand.ClearDigitalEvents, StatusWriteCommand.ClearAlarmsConfig, StatusWriteCommand.ClearPPPConfig,
  StatusWriteCommand.ClearEMailConfig, StatusWriteCommand.ClearDigitalEventsExpanded, StatusWriteCommand.ClearPidLoops, StatusWriteCommand.ClearDataLog
}
 Command Values For the Status Area Write - Read/Write (see Opto 22 Form 1465). More...
 
enum  SerialParity { SerialParity.None = 0, SerialParity.Odd = 1, SerialParity.Even = 2 }
 Enumerations for a Serial Module's Parity Settings More...
 
enum  eDataCode { eDataCode.Binary = 0, eDataCode.GrayCode = 1, eDataCode.None = -1 }
 Probe data coding format enumerations. More...
 
enum  AnalogWriteOptions { AnalogWriteOptions.EngineeringUnits = 0, AnalogWriteOptions.Counts = 1, AnalogWriteOptions.AnalogTpoResolution, AnalogWriteOptions.AnalogTpoPeriod }
 Enumerations of the analog value types that may be written. More...
 
enum  AnalogWriteOptions4096 { AnalogWriteOptions4096.EngineeringUnits = 0, AnalogWriteOptions4096.Counts = 1, AnalogWriteOptions4096.TpoPeriod = 3 }
 Enumerations of the 4096-point analog value types that may be written. More...
 
enum  AnalogReadOptions { AnalogReadOptions.EngineeringUnits = 0, AnalogReadOptions.Counts, AnalogReadOptions.Minimum, AnalogReadOptions.Maximum }
 Enumerations of the analog value types that may be read. More...
 
enum  eDigitalFeature { eDigitalFeature.None = 0, eDigitalFeature.Counter = 0x1, eDigitalFeature.QuadratureSimple = 0x4, eDigitalFeature.QuadratureIndex = 0x41 }
 Digital features that may be configured in the 64-point memory map. More...
 
enum  TemperatureScale { TemperatureScale.Celsius = 0, TemperatureScale.Kelvin, TemperatureScale.Fahrenheit, TemperatureScale.Rankine }
 
enum  ePidAlgorithm {
  ePidAlgorithm.Disabled = 0, ePidAlgorithm.VelocityB_Obsolete, ePidAlgorithm.Isa_Obsolete, ePidAlgorithm.Parallel_Obsolete,
  ePidAlgorithm.Interacting_Obsolete, ePidAlgorithm.VelocityC, ePidAlgorithm.Isa, ePidAlgorithm.Parallel,
  ePidAlgorithm.Interacting
}
 Algorithm Options. More...
 
enum  ePidWriteOptions {
  ePidWriteOptions.InitializeAll = 0, ePidWriteOptions.ProcessVariable, ePidWriteOptions.Setpoint, ePidWriteOptions.PCoefficient,
  ePidWriteOptions.ICoefficient, ePidWriteOptions.DCoefficient, ePidWriteOptions.FFGain, ePidWriteOptions.OutputChangesAllowed,
  ePidWriteOptions.ProcessVariableClamps, ePidWriteOptions.OutputClamps, ePidWriteOptions.Scantime, ePidWriteOptions.OutputForceValuesWhenInputOutOfRange,
  ePidWriteOptions.ProcessVariableOptoMmpAddress, ePidWriteOptions.SetpointOptoMmpAddress, ePidWriteOptions.OutputOptoMmpAddress, ePidWriteOptions.PidAlgorithm,
  ePidWriteOptions.PidAutoManualMode, ePidWriteOptions.ConfigurationFlags, ePidWriteOptions.SupervisorPidInput
}
 PID Write Options More...
 

Public Member Functions

 OptoMMP ()
 Constructor More...
 
Int32 Open (String sHost, Int32 i32Port, Connection eType, Int32 i32InitialTimeoutMs, Boolean bPowerUpClear)
 Opens An OptoMMP Object. The UDP/IP option is strongly recommended for single-segment networks. Use TCP/IP when communicating over wireless and wide-area-network connections. For Wide-Area-Networks, larger timeouts may be needed. If using TCP/IP, an internal reconnection backoff algorithm throttles how agressive reconnections will occur at. More...
 
Int32 OpenSerialBinary (String sCommPort, Int32 i32BaudRate)
 Open a serial (binary) connection to a string of I/O units. The OptoMMP SDK uses only a Windows COM port. Your COM port may be an add-in card or a USB to Serial Converter (that emulates a COM port). More...
 
void Close ()
 Close the OptoMMP device connection. More...
 
Int32 WriteStatusCommand (StatusWriteCommand eCommand)
 Writes a Status Command to Opto MMP Address 0xffff f038 0000 (see Opto 22 Form 1465, Section "Status Area Write - Read/Write") Should a different command be needed that is not in the StatusWriteCommand enumeration, directly write the numeric value to 0xffff f038 0000. More...
 
Int32 WriteFOrCStatus (Boolean bIsFahrenheit)
 Force Brain to Report Temperature as Celsius or Fahrenheit More...
 
Int32 ReadFOrCStatus (out Boolean bIsFahrenheit)
 Read the Temperature Reporting Status of the Brain More...
 
Int32 WriteWatchdogTime (Int32 i32WatchdogTimeMs)
 Set the Communication Watchdog Timeout of the IO unit. More...
 
Int32 ReadWatchdogTime (out Int32 i32WatchdogTimeMs)
 Read the Device's Communication Watchdog Timeout More...
 
Int32 ReadDateTime (out String sDateTime)
 Read the Date and Time of the I/O Unit More...
 
Int32 WriteDateTime (String sDateTime)
 Write the Date-Time String to the IO Unit. More...
 
Int32 WriteLocalDateTime ()
 Write Local Date-Time To The IO Unit. More...
 
Int32 ReadScannerFlags (out Int32 i32ScannerFlags)
 Read the scanner flags of the control engine. More...
 
Int32 WriteScannerFlags (Int32 i32ScannerFlags)
 Write the scanner flags to the OptoMMP device. More...
 
Int32 ReadSerialModuleConfiguration (Int32 i32PortNumber, out Int32 i32TcpPort, out Int32 i32BaudRate, out SerialParity eParity, out Byte byDataBits, out Byte byStopBits, out Boolean bHardwareFlowControl, out Boolean bTestMessage, out Int32 i32Eom, out Boolean b4WireMode)
 Read the Serial (Module) Port Configuration. Only for Module based Serial Ports. Only supported on Ethernet based brains and controllers. More...
 
Int32 WriteSerialModuleConfiguration (Int32 i32PortNumber, Int32 i32TcpPort, Int32 i32BaudRate, SerialParity eParity, Byte byDataBits, Byte byStopBits, Boolean bHardwareFlowControl, Boolean bTestMessage, Int32 i32Eom, Boolean b4WireMode)
 Write the Serial Port Configuration. Only for Module based Serial Ports. Only supported on Ethernet based brains and controllers. More...
 
Int32 ReadSsiModuleConfiguration (Int32 i32PortNumber, out Int32 i32FrameSize, out Single f32ClockSpeedkHz, out Single f32InterFrameTimeUs, out Int32 i32MsbOffset, out Int32 i32DataBits, out Int32 i32ErrorBitOffset, out Boolean bErrorBitLowIsError, out eDataCode eCoding, out Boolean bEnabled)
 Read the SSI module configuration More...
 
Int32 WriteSsiModuleConfiguration (Int32 i32PortNumber, Int32 i32FrameSize, Single f32ClockSpeedkHz, float f32InterFrameTimeUs, Int32 i32MsbOffset, Int32 i32DataBits, Int32 i32ErrorBitOffset, Boolean bErrorBitLowIsError, eDataCode eCoding, Boolean bEnabled)
 Writes the SSI Module configuration More...
 
Int32 WriteBrainStreamingConfiguration (Int32 i32IntervalMs, Int32 i32UdpPortDestination, String[] saryIpAddresses, UInt32 u32OptoMMPAddress, Int32 i32LengthOfStream)
 Configure the brain streaming functionality. More...
 
Int32 EnableBrainStreaming (Boolean bEnableStreaming)
 Controls the enable/disable functionality of brain streaming. Functionality only exists on Ethernet based I/O units. More...
 
Int32 ReadBrainStreamingConfiguration (out Boolean bIsEnabled, out Int32 i32IntervalMs, out Int32 i32UdpPortDestination, out String[] saryIpAddresses, out UInt32 u32OptoMMPAddress, out Int32 i32LengthOfStream)
 Read the Brain Streaming configuration. More...
 
Int32 ScratchpadBitsRead (out UInt64 u64ScratchpadBitmask)
 Read scratchpad bits as a 64-bit bitmask. More...
 
Int32 ScratchpadBitsRead (Boolean[] baryScratchpad, Int32 i32StartIndex)
 Read Scratchpad Bits Into A Boolean Array More...
 
Int32 ScratchpadBitRead (out Boolean bState, Int32 i32Index)
 Read Scratchpad Bit More...
 
Int32 ScratchpadBitsWrite (UInt64 u64OnMask, UInt64 u64OffMask)
 Writes all 64 scratchpad bit states using turn-on and turn-off bitmasks. More...
 
Int32 ScratchpadBitsWrite (Boolean[] baryOnStates, Boolean[] baryOffStates, Int32 i32StartIndex)
 Writes All 64 Scratchpad Bitstates From "Must-On/Must-Off" (MoMo) Boolean Arrays More...
 
Int32 ScratchpadBitWrite (Boolean bState, Int32 i32Index)
 Write Scratchpad Bit More...
 
Int32 ScratchPadF32NumberofElements ()
 Maximum number of elements in the Float Scratchpad Array. More...
 
Int32 ScratchpadFloatRead (Single[] fary, Int32 i32StartFaryIndex, Int32 i32Length, Int32 i32StartScratchpadStartIndex)
 Read a block of 32-bit floating point (Single) scratchpad registers. More...
 
Int32 ScratchpadFloatWrite (Single[] fary, Int32 i32StartFaryIndex, Int32 i32Length, Int32 i32StartScratchpadStartIndex)
 Write a block of float scratchpad registers. More...
 
Int32 ScratchPadI32NumberofElements ()
 Maximum number of elements in the 32-bit Integer Scratchpad Array. More...
 
Int32 ScratchpadI32Read (Int32[] i32ary, Int32 i32StartIaryIndex, Int32 i32Length, Int32 i32StartScratchpadStartIndex)
 Read a block of 32-bit signed-integer scratchpad registers. More...
 
Int32 ScratchpadI32Write (Int32[] i32ary, Int32 i32StartIaryIndex, Int32 i32Length, Int32 i32StartScratchpadStartIndex)
 Write a block of 32-bit signed-integer scratchpad registers. More...
 
Int32 ScratchPadI64NumberofElements ()
 Maximum number of elements in the 64-bit Integer Scratchpad Array. More...
 
Int32 ScratchpadI64Read (Int64[] i64ary, Int32 i32StartIaryIndex, Int32 i32Length, Int32 i32StartScratchpadStartIndex)
 Read the 64-bit signed-integer (Int64) scratchpad registers More...
 
Int32 ScratchpadI64Write (Int64[] i64ary, Int32 i32StartIaryIndex, Int32 i32Length, Int32 i32StartScratchpadStartIndex)
 Write a block of 64-bit signed integer scratchpad registers. More...
 
Int32 ScratchPadStringNumberofElements ()
 Maximum number of elements in the String Scratchpad Array. More...
 
Int32 ScratchpadStringRead (String[] strary, Int32 i32StartStraryIndex, Int32 i32Length, Int32 i32StartScratchpadStartIndex)
 Read the string scratchpad registers. More...
 
Int32 ScratchpadStringWrite (String[] strary, Int32 i32StartStraryIndex, Int32 i32Length, Int32 i32StartScratchpadStartIndex)
 Write a block of string scratchpad registers. More...
 
Int32 ReadDigitalStates64 (out Int64 i64DigitalStatesBitmask)
 Read digital states as a 64-bit Bitmask. More...
 
Int32 ReadDigitalStates64 (out UInt64 u64DigitalStatesBitmask)
 Read digital states as a 64-bit Bitmask as a UInt64 More...
 
Int32 ReadDigitalStates64 (Boolean[] baryDigitalStates64, Int32 i32StartIndex)
 Read 64 Digital States Into A Boolean Array More...
 
Int32 ReadDigitalState64 (Int32 i32PointNumber, out Boolean bState)
 Read the individual digital state by specifying the point number. More...
 
Int32 ReadDigitalLatches64 (out Int64 i64OnLatchBitMask, out Int64 i64OffLatchBitMask)
 Read all On and Off Latch States of the 64 Point I/O Unit Rack at Bitmasks. More...
 
Int32 ReadDigitalLatches64 (out UInt64 u64OnLatchBitMask, out UInt64 u64OffLatchBitMask)
 Read all On and Off Latch States of the 64 Point I/O Unit Rack with Unsigned Bitmasks. More...
 
Int32 ReadDigitalLatches64 (Boolean[] baryOnLatches, Boolean[] baryOffLatches, Int32 i32StartIndex)
 Read all On and Off Latch States of the 64 Point I/O Unit Rack with Boolean arrays. More...
 
Int32 ReadDigitalLatch64 (Int32 i32PointNumber, out Boolean bOnLatch, out Boolean bOffLatch)
 Read the Digital Latches Selected by a Point Number. More...
 
Int32 ReadClearDigitalLatches64 (Boolean bReadAndClearLatches, out Int64 i64LatchBitmask)
 Read and clear digital latches in the 64-point area. More...
 
Int32 ReadClearDigitalLatches64 (Boolean bOnLatches, out UInt64 u64LatchBitmask)
 Read and clear digital latches in the 64-point area, with a UInt64 latch bitmask. More...
 
Int32 ReadClearDigitalLatches64 (Boolean bOnLatches, Boolean[] baryLatches, Int32 i32StartIndex)
 Read and clear digital latches in the 64-point area, with a UInt64 latch bitmask. More...
 
Int32 ReadClearDigitalLatch64 (Int32 i32PointNumber, Boolean bOnLatch, out Boolean bLatchState)
 Read and clear a digital latch. More...
 
Int32 ReadOptionallyClearCounters64 (Boolean bClear, UInt32[] u32aryCounters, Int32 i32StartIndex)
 Read and optionally clear all 64 counters. More...
 
Int32 ReadOptionallyClearCounter64 (Int32 i32PointNumber, Boolean bClear, out UInt32 u32Counter)
 Read and optionally clear a counter on the 64 point rack. More...
 
Int32 WriteDigitalStates64 (Int64 i64StateBitMask)
 Sets all of the 4-channel digital states in the 64-point rack. More...
 
Int32 WriteDigitalStates64 (Boolean[] baryStates, Int32 i32StartIndex)
 Write All 64 Digital States Using A Boolean Array. More...
 
Int32 WriteDigitalStatesMoMo64 (Int64 i64OnMask, Int64 i64OffMask)
 Writes All 64 Digital States From "Must-On/Must-Off" (MoMo) Bit Masks More...
 
Int32 WriteDigitalStatesMoMo64 (Boolean[] baryOnStates, Boolean[] baryOffStates, Int32 i32StartIndex)
 Writes All 64 Digital States From "Must-On/Must-Off" (MoMo) Boolean Arrays More...
 
Int32 WriteDigitalState64 (Int32 i32PointNumber, Boolean bOn)
 Set a single state of a 4-channel digital output, 64-point rack. More...
 
Int32 WriteDigitalEnableorDisableCounters64 (Int64 i64ActivateBitMask, Int64 i64DeactivateBitMask)
 Enable or disable a bank of counters in the 64-point rack. More...
 
Int32 WriteDigitalEnableorDisableCounters64 (Boolean[] baryActivate, Boolean[] baryDeactivate, Int32 i32StartIndex)
 Enable or Disable All 64 Digital Counters From Boolean Arrays More...
 
Int32 WriteDigitalEnableorDisableCounter64 (Int32 i32PointNumber, Boolean bActivate)
 Enable or disable a digital counter, 64-point rack. More...
 
Int32 ReadDigitalCountersStatus64 (out Int64 i64ActivateBitMask)
 Reads All 64 Counter Status. More...
 
Int32 ReadDigitalCountersStatus64 (Boolean[] baryActive, Int32 i32StartIndex)
 Read All 64 Counter Status To A Boolean Array. More...
 
Int32 ReadDigitalCounterStatus64 (Int32 i32PointNumber, out Boolean bCounterStatus)
 Read a Counter Status in the 64 Point IO Unit Memory Map. More...
 
Int32 ReadAnalogStates64 (Single[] f32aryData, Int32 i32StartingIndex)
 Read all low-density (64-point) Analog Input and Output States. More...
 
Int32 ReadAnalogState64 (Int32 i32PointNumber, out Single f32AnalogValue)
 Read an analog state via a point number. More...
 
Int32 ReadOptionallyClearAnalogMaxMin64 (Int32 i32PointNumber, Boolean bClear, out Single fMaximum, out Single fMinimum)
 Read and clear analog maximum and minimum value of a point on a 64-point rack. More...
 
Int32 WriteAnalogStates64 (Single[] f32aryValues, Boolean bEngineeringUnits, Int32 i32StartIndex)
 Set analog outputs in engineering units or counts as a 64-point bank write. More...
 
Int32 WriteAnalogState64 (Int32 i32PointNumber, AnalogWriteOptions eOption, Single fWriteValue)
 Sets a Single Analog State in Engineering Units, Counts or TPO in the 64-Point IO Unit Memory Map. More...
 
Int32 WriteDigitalPointConfiguration64 (Int32 i32PointNumber, Boolean bOutput, eDigitalFeature eFeature, Boolean bEnableWatchdog, Boolean bWatchdogValue, String sPointName)
 Write the digital point configuration. More...
 
Int32 ReadDigitalPointConfiguration64 (Int32 i32PointNumber, out Int32 i32ModuleType, out Int32 i32PointType, out Int32 i32Feature, out Boolean bWatchdogEnabled, out Boolean bWatchdogValue, out String sPointName)
 Read the Digital Point Configuration More...
 
Int32 WritePointConfiguration64 (Int32 i32PointNumber, Int32 i32PointType)
 Write/Modify Analog Point configuration or Digital Feature in 64 Point Area. More...
 
Int32 WriteAnalogPointConfiguration64 (Int32 i32PointNumber, Int32 i32PointType, Single f32HighScale, Single f32LowScale, Single f32Offset, Single f32Gain, Single f32FilterWeight, Boolean bEnableWatchdog, Single f32WatchdogValue, String sPointName)
 Write Analog Point configuration in 64 Point Area. More...
 
Int32 ReadAnalogPointConfiguration64 (Int32 i32PointNumber, out Int32 i32ModuleType, out Int32 i32PointType, out Single f32HighScale, out Single f32LowScale, out Single f32Offset, out Single f32Gain, out Single f32FilterWeight, out Boolean bEnableWatchdog, out Single f32WatchdogValue, out String sPointName)
 Read Analog Point Configuration in the 64-Point Area. More...
 
Int32 WriteAnalogLoadCellConfiguration64 (Int32 i32PointNumber, UInt32 u32FastSettle, UInt32 u32FilterWeight)
 Write analog load cell configuration in 64 Point Area. More...
 
Int32 ReadAnalogLoadCellConfiguration64 (Int32 i32PointNumber, out UInt32 u32FastSettle, out UInt32 u32FilterWeight)
 Read analog load cell configuration in the analog 64 point area (one point at a time). More...
 
Int32 ReadPointName64 (Int32 i32PointNumber, out String sPointName)
 Read the Analog or Digital Point Name, using the 64-point memory model. SNAP-PAC and Legacy Ethernet based I/O units that support a point name. More...
 
Int32 WritePointName64 (Int32 i32PointNumber, String sPointName)
 Write the Analog or Digital Point Name, using the 64-point memory model. SNAP-PAC and Legacy Ethernet based I/O units that support a point name. More...
 
Int32 WriteDigitalPointConfiguration4096 (Int32 i32PointNumber, Boolean bOutput, eDigitalFeature eFeature, Boolean bEnableWatchdog, Boolean bWatchdogValue, String sPointName)
 Write the digital point configuration (4096 points). More...
 
Int32 ReadDigitalPointConfiguration4096 (Int32 i32PointNumber, out Int32 i32ModuleType, out Int32 i32PointType, out Int32 i32Feature, out Boolean bWatchdogEnabled, out Boolean bWatchdogValue, out String sPointName)
 Read the Digital Point Configuration (4096 points). More...
 
Int32 ReadHighDensityDigitalStates (Boolean[] baryStates, Int32 i32StartIndex)
 Read All 512 High-Density Digital States (32 points per module times 16 modules). More...
 
Int32 ReadHighDensityDigitalStates (UInt32[] u32aryBitStates, Int32 i32StartIndex)
 Read All 512 High-Density Digital States To BitMask Array More...
 
Int32 ReadHighDensityDigitalState (Int32 i32PointNumber, out Boolean bState)
 Read a high-density digital state. More...
 
Int32 ReadHighDensityDigitalState (Int32 i32Module, Int32 i32Point, out Boolean bState)
 Read a high-density digital state from a module and point index. More...
 
Int32 ReadOptionallyClearHighDensityDigitalLatches (Boolean bClear, Boolean[] baryOnLatches, Boolean[] baryOffLatches, Int32 i32StartIndex)
 
Int32 ReadOptionallyClearHighDensityDigitalLatches (Boolean bClear, UInt32[] u32aryOnLatches, UInt32[] u32aryOffLatches, Int32 i32StartIndex)
 Read and Optionally Clear All 512 High-Density Latches To BitMasks (32 points per module times 16 modules) More...
 
Int32 ReadOptionallyClearHighDensityDigitalLatches (Int32 i32StartModule, Int32 i32EndModule, Boolean bClear, Boolean[] baryOnLatches, Boolean[] baryOffLatches, Int32 i32StartIndex)
 Read and Optionally Clear All 512 High-Density Latches To Boolean Arrays (32 points per module times 16 modules) More...
 
Int32 ReadHighDensityDigitalLatch (Int32 i32Module, Int32 i32Channel, out Boolean bOnLatch, out Boolean bOffLatch)
 Read a single high-density digital latch. More...
 
Int32 ReadOptionallyClearHighDensityDigitalCounters32 (Boolean bClear, UInt32[] u32aryCounters, Int32 i32StartIndex)
 Read and Optionally clear High Density Digital Counters More...
 
Int32 ReadHighDensityDigitalCounter (Int32 i32Module, Int32 i32Channel, out UInt32 u32Counter)
 Read a High-Density Digital Counter More...
 
Int32 WriteHighDensityDigitalStates (Int32 i32StartModule, Int32 i32EndModule, Boolean[] baryStates, Int32 i32StartIndex)
 Write High-Density Digital States, Module by Module Using A Boolean Array More...
 
Int32 WriteHighDensityDigitalStates (Int32 i32StartModule, Int32 i32EndModule, Int32[] i32aryStates, Int32 i32StartIndex)
 Write High-Density Digital States, Module by Module Using A Bitmask Array More...
 
Int32 WriteHighDensityDigitalState (Int32 i32Module, Int32 i32Point, Boolean bState)
 Write An Individual High-Density Digital State More...
 
Int32 WriteHighDensityDigitalModule (Int32 i32Module, Boolean[] baryOnState, Boolean[] baryOffState)
 Update High-Density Digital States of a Single Module Using Boolean Arrays. More...
 
Int32 WriteHighDensityDigitalModule (Int32 i32Module, UInt64 u64OnStateMask, UInt64 u64OffStateMask)
 Update High-Density Digital States of a Single Module Using UInt64 Bitmasks. More...
 
Int32 ReadPointName4096 (Int32 i32PointNumber, out String sPointName)
 Read the Analog or Digital Point Name, using the 4096-point memory model. SNAP-PAC units only. More...
 
Int32 WritePointName4096 (Int32 i32PointNumber, String sPointName)
 Write the Analog or Digital Point Name, using the 4096-point memory model. SNAP-PAC units only. More...
 
Int32 ReadAnalogEus512 (Single[] f32aryValues, Int32 i32StartIndex)
 Read all Analog States as Engineering Units. This method relies on the OptoMMP area "Analog EU or Digital Counter Packed Data -- Read." More...
 
Int32 ReadAnalogEu512 (Int32 i32Point, out Single f32Value)
 Read a single Analog Engineering Unit Value. This method relies on the area "Analog EU or Digital Counter Packed Data -- Read." More...
 
Int32 WriteAnalogEu512 (Int32 i32Point, Single f32Value)
 Write an analog output in the 512-Point IO Unit model. More...
 
Int32 ReadAnalogState4096 (Int32 i32Point4096Number, AnalogReadOptions eReadOption, out Single f32AnalogValue)
 Read an analog engineering units state, counts, or TPO values via a point number. More...
 
Int32 ReadOptionallyClearAnalogMaxMin4096 (Int32 i32Point4096Number, Boolean bClear, out Single f32Maximum, out Single f32Minimum)
 Read and clear analog maximum and minimum value of a point on a 4096-point rack. More...
 
Int32 WriteAnalogState4096 (Int32 i32Point4096Number, AnalogWriteOptions eOption, Single f32WriteValue)
 Sets a single analog state in engineering units, Counts or TPO values in the 4096-point IO unit memory map. More...
 
Int32 WriteAnalogState4096v2 (Int32 i32Point4096Number, AnalogWriteOptions4096 eOption, Single f32WriteValue)
 Sets a single analog state in engineering units, Counts or TPO values in the 4096-point IO unit memory map. More...
 
Int32 WriteAnalogPointConfiguration4096 (Int32 i32PointNumber, Int32 i32PointType, Single f32HighScale, Single f32LowScale, Single f32Offset, Single f32Gain, Single f32FilterWeight, Boolean bEnableWatchdog, Single f32WatchdogValue, String sPointName, Single f32LowerClamp, Single f32UpperClamp)
 Write Analog Point configuration in 4,096 Point Area. More...
 
Int32 WriteAnalogPointConfiguration4096 (Int32 i32PointNumber4096, Int32 i32PointType, Single f32HighScale, Single f32LowScale, Single f32FilterWeight, Boolean bEnableWatchdog, Single f32WatchdogValue, String sPointName, Single f32LowerClamp, Single f32UpperClamp)
 Write Analog Point configuration in 4,096 Point Area. Useful when offset and gain parameters are not required. More...
 
Int32 WriteAnalogPointConfiguration4096 (Int32 i32PointNumber4096, Int32 i32PointType, Single f32FilterWeight, Boolean bEnableWatchdog, Single f32WatchdogValue, String sPointName, Single f32LowerClamp, Single f32UpperClamp)
 Write Analog Point configuration in 4,096 Point Area. Useful for thermocouple and RTD probes or analog input ranges. More...
 
Int32 WriteAnalogPointConfiguration4096 (Int32 i32PointNumber4096, Int32 i32PointType, String sPointName)
 Write Analog Point configuration in 4,096 Point Area. Useful for RTDs and thermocouple modules, to just set the "probe" type or analog input ranges. More...
 
Int32 ReadAnalogPointConfiguration4096 (Int32 i32PointNumber, out Int32 i32PointType, out Single f32HighScale, out Single f32LowScale, out Single f32Offset, out Single f32Gain, out Single f32FilterWeight, out Boolean bEnableWatchdog, out Single f32WatchdogValue, out String sPointName, out Single f32LowerClamp, out Single f32UpperClamp)
 Read Analog Point configuration in 4,096 Point Area. More...
 
Int32 WriteAnalogPointConfiguration4096 (Int32 i32PointNumber, Int32 i32PointType)
 Write Point configuration in 4,096 Point Area. Useful for setting probe types such as thermocouples and RTDs. Will also set the analog input ranges for voltage input modules. More...
 
Int32 WriteAnalogLoadCellConfiguration4096 (Int32 i32PointNumber, UInt32 u32FastSettle, UInt32 u32FilterWeight)
 Write analog load cell configuration in 4,096 point area. More...
 
Int32 ReadAnalogLoadCellConfiguration4096 (Int32 i32PointNumber, out UInt32 u32FastSettle, out UInt32 u32FilterWeight)
 Reads analog load cell configuration in 4,096 point area. More...
 
Int32 ReadSteinhartHart4096 (Int32 i32PointNumber4096, out Single f32CoefA, out Single f32CoefB, out Single f32CoefC, out Single f32CoefSecond)
 Read the Steinhart-Hart linearization coefficients for the specified input. Requires R9.3e firmware or later. More...
 
Int32 WriteSteinhartHart4096 (Int32 i32PointNumber4096, Single f32CoefA, Single f32CoefB, Single f32CoefC, Single f32CoefSecond)
 Write Steinhart-Hart linearization coefficients to the specified point. Requires R9.3e firmware or later. More...
 
Int32 ReadInts (Int64 i64MmpAddress, Int32 i32Length, Int32[] i32aryInts, Int32 i32StartingIndex)
 Read a block of integers (32-bit signed values) from the Memory Map More...
 
Int32 WriteInts (Int64 i64MmpAddress, Int32 i32Length, Int32[] i32aryInts, Int32 i32StartingIndex)
 Write a block of 32-bit integers to a specific Opto MMP Address. More...
 
Int32 ReadUints (Int64 i64MmpAddress, Int32 i32Length, UInt32[] u32aryInts, Int32 i32StartingIndex)
 Read a block of unsigned integers (32-bit unsigned values) from the Memory Map More...
 
Int32 WriteUints (Int64 i64MmpAddress, Int32 i32Length, UInt32[] u32aryInts, Int32 i32StartingIndex)
 Write a block of 32-bit unsigned integers to a specific Opto MMP Address. More...
 
Int32 ReadSingles (Int64 i64MmpAddress, Int32 i32Length, Single[] f32arySingles, Int32 i32StartingIndex)
 Read a block of Singles from the Opto MMP Device. More...
 
Int32 WriteSingles (Int64 i64MmpAddress, Int32 i32Length, Single[] f32arySingles, Int32 i32StartingIndex)
 Write a block of Singles to the Opto MMP Device. More...
 
Int32 ReadLongs (Int64 i64MmpAddress, Int32 i32Length, Int64[] i64aryLongs, Int32 i32StartingIndex)
 Read a block of longs (64-bit signed values) from the Opto MMP Device. More...
 
Int32 WriteLongs (Int64 i64MmpAddress, Int32 i32Length, Int64[] i64aryLongs, Int32 i32StartingIndex)
 Write a block of longs (64-bit signed values) to the Opto MMP Device. More...
 
Int32 ReadULongs (Int64 i64MmpAddress, Int32 i32Length, UInt64[] u64aryLongs, Int32 i32StartingIndex)
 Read a block of unsigned longs (64-bit unsigned values) from the Opto MMP Device. More...
 
Int32 WriteULongs (Int64 i64MmpAddress, Int32 i32Length, UInt64[] u64aryLongs, Int32 i32StartingIndex)
 Write a block of unsigned longs (64-bit unsigned values) to the Opto MMP Device. More...
 
void GetExtendedErrorInformation (out String strMessage, out Boolean bCommFault, out Boolean bProtocolFault, out Boolean bArgumentFault)
 Retrieves extended error information. This information is also logged in the computer's Application event log. More...
 
Int32 ReadBrainDiagnosticInformation (out structBrainDiagnosticInformation info)
 Read the diagnostic information of the brain. Added (April 4, 2011). More...
 
Int32 ReadPidQuantity (out Int32 i32PidQuantity)
 Report supported PID quantity in the brain. More...
 
Int32 ReadPid (Int32 i32PidIndex, out stPid PidData)
 Read the entire PID. More...
 
Int32 WritePid (Int32 i32PidIndex, stPid PidData, ePidWriteOptions eWriteOption)
 Write Pid (configure all or individual parameters [one at a time] of a PID) More...
 
void AboutPulses ()
 Information on generating digital pulses. Method does not perform any operations. More...
 
Int32 ConfigureContinuousPulsesTime (Boolean bInvert, Single f32StartDelayTimeSeconds, Single f32OnTimeSeconds, Single f32OffTimeSeconds, IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512)
 Configure a continuous digital pulse train with on-time and off-time values. More...
 
Int32 ConfigureContinuousPulsesDuration (Boolean bInvert, Single f32StartDelayTimeSeconds, Single f32OnPercent, Single f32PeriodSeconds, IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512)
 Configure a continuous digital pulse train with percent-on and waveform period values. More...
 
Int32 ConfigureNPulsesTime (Boolean bInvert, Single f32StartDelayTimeSeconds, Single f32OnTimeSeconds, Single f32OffTimeSeconds, UInt32 u32PulseQuantity, IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512)
 Configure an "N" pulse train using on-time and off-time parameters. More...
 
Int32 ConfigureNPulsesDuration (Boolean bInvert, Single f32StartDelayTimeSeconds, Single f32OnPercent, Single f32PeriodSeconds, UInt32 u32PulseQuantity, IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512)
 Configure a continuous digital pulse train using percent-on and wave period parameters. More...
 
Int32 StartPulse (IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512)
 Start a pulse train. More...
 
Int32 StopPulse (IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512, Boolean bTurnOn)
 Stop a pulse. Note, writing a digital point state cancels an operating pulse. More...
 
Int32 WritePulsePercentage (IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512, Single f32Percent)
 Write pulse percentage. Useful for continuous pulse trains... for example, time-proprotional outputs (e.g. heater applications). More...
 
Int32 ReadPulsePercentage (IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512, out Single f32Percent)
 Read pulse percentage. More...
 
Int32 WritePulsePeriod (IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512, Single f32Period)
 Write the pulse period. More...
 
Int32 ReadPulsePeriod (IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512, out Single f32Period)
 Read the pulse period. More...
 
Int32 WritePulseOnOffTime (IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512, Single f32OnTime, Single f32OffTime)
 Update a "time" configured pulse's on-time and off-time. Pulse must have been configured with either ConfigureContinuousPulsesTime() or ConfigureNPulsesTime() or unpredictable results will occur (even with a valid method result code). More...
 
Int32 ReadPulseOnOffTime (IoModel eIoModelOfPointIndex, Int32 i32PointIndex64or512, out Single f32OnTime, out Single f32OffTime)
 Read a "time" configured pulse's on- and off-time values. The pulse must have been configured using ConfigureContinuousPulsesTime() or ConfigureNPulsesTime() or unpredictable results will be reported on f32OnTime and f32Offtime (even with a successful result of this method). More...
 
Int32 ReadCustomConfiguration (Int32 i32StartIndex, Int32 i32Length, UInt32[] u32aryCustomAddresses, Int32 i32ArrayStartIndex)
 Read OptoMMP address configuration from the custom area. More...
 
Int32 ReadCustomData (Int32 i32StartIndex, Int32 i32Length, UInt32[] u32aryData, Int32 i32ArrayStartIndex)
 Read custom configured data from the custom data area. Data is always returned as UInt32. More...
 
Int32 WriteCustomConfiguration (Int32 i32StartIndex, Int32 i32Length, UInt32[] u32aryCustomAddresses, Int32 i32ArrayStartIndex)
 Write custom configuration addresses to the OptoMMP "custom area." More...
 
Int32 WriteCustomData (Int32 i32StartIndex, Int32 i32Length, UInt32[] u32aryData, Int32 i32ArrayStartIndex)
 Write data to the custom area. More...
 
Int32 WritePacSBCommunicationBlinkCodeFlag (Boolean bEnable)
 Enable/Disable SNAP-PAC-SB communication blink code. This method enables a feature on the SNAP-PAC-SB to red blink the STAT indicator when a detected message exception occurs. More...
 
Int32 ReadPacSBCommunicationBlinkCodeFlag (out Boolean bEnabled)
 Read the SNAP-PAC-SB communication blink code flag status. More...
 

Static Public Member Functions

static Double ConvertTemperature (Double dInputTemp, TemperatureScale eInScale, TemperatureScale eOutScale)
 Convert temperatures. More...
 
static Int32 GetPointNumberFor64 (Int32 i32Module, Int32 i32Channel)
 Converts Module and Channel to Point Number For 64 Point IO Unit Model. More...
 
static Int32 GetPointNumberFor512 (Int32 i32Module, Int32 i32Channel)
 Converts Module and Channel to Point Number For 512 Point IO Unit Model. More...
 
static Int32 GetPointNumberFor4096 (Int32 i32Module, Int32 i32Channel)
 Converts Module and Channel to Point Number For 4096 Point IO Unit Model. More...
 
static void GetModuleAndChannelFromPoint64 (Int32 i32Point, out Int32 i32Module, out Int32 i32Channel)
 Converts A Point Number From The 64 Point Model To A Module And Channel Number. More...
 
static void GetModuleAndChannelFromPoint512 (Int32 i32Point, out Int32 i32Module, out Int32 i32Channel)
 Converts A Point Number From The 512 Point Model To A Module And Channel Number. More...
 
static void GetModuleAndChannelFromPoint4096 (Int32 i32Point, out Int32 i32Module, out Int32 i32Channel)
 Converts A Point Number From The 4096 Point Model To A Module And Channel Number. More...
 
static Int32 GetSerialOrSsiPortIndexFromModuleAndChannel (Int32 i32Module, Int32 i32Channel)
 Computes A Serial Port "Index" on the rack, for serial and SSI modules. More...
 
static String ConvertNumberToFirmwareVersion (Int32 i32Number)
 Converts an Opto 22 Version number (32-bit) to a version string like R8.5A. More...
 
static void Readme_WhenErrorsOccur ()
 Description of when errors occur. More...
 
static void Readme_AboutIOModules ()
 About SNAP IO Modules (added 02-23-2011) More...
 
static UInt32 SingleToUInt32 (Single f32Data)
 Converts a UInt32 (in binary form as a single) to a single. More...
 
static Single UInt32ToSingle (UInt32 u32Data)
 Converts a Single (in binary form) to a UInt32. More...
 

Public Attributes

const Int32 i32cMaximumPulseObjects = 512
 SNAP-PAC has 512 pulse objects available. More...
 

Properties

Int64 LastTransactionTimeMs [get]
 Report the amount of time the last communicationt transaction consumed (in milliseconds). Includes the time consumed by transmitting the request, receiving the response, and all other associated latency. If a method that has multiple transactions was just prior used, this time represents the last transaction that occurred. More...
 
Byte SerialDeviceIndex [get, set]
 Serial device index (also known as the serial address). If used More...
 
Int32 MinimumRecommendedTimeoutMs [get]
 Recommended minimum timeout in milliseconds. Serial timeout is based on a 1200 byte communication response. The value offered by this property does not take into account higher latency communications (such as wide area networks) or high-latency communication links (POTS modems, satellites, wireless spread spectrum modems, etc) or USB to serial converters with latency settings configured very high. This is just an "absolute" minimum to avoid rediculous timeout settings. Use after opening an object. More...
 
Int32 SetAllReceiveTimeoutsMs [set]
 Set the receive timeout for all devices in this object. Caution, too low of a timeout value may be accepted by this method. Please see MinimumRecommendedTimeoutMs for additional information. This method only applies a 50ms minimum timeout. Use when using PCI serial cards that have baud rate clock divider options. More...
 
Int32 ReceiveTimeoutMs [get, set]
 Receive timeout setting for the current selected serial station or network address. More...
 
Int32 ReadCacheFreshnessMs [get, set]
 Get/Set the data cache freshness value of the current device index (for TCP/UDP, always the same device, for serial, the last station address set in the property SerialDeviceIndex). More...
 
Int32 SetAllReadCacheFreshnessMs [set]
 Set all this object's data cache freshness times. More...
 
Boolean IsCommunicationOpen [get]
 Test if there is a possibility of communicating to the remote device. The primary object may be open but the underlying communication resource may have closed. More...
 
Int32 LastOptoMmpProtocolResultCode [get]
 When a -10 Error is reported, this method returns the last Opto MMP RCode. Check Form 1465 for proper response. More...
 

Detailed Description

Object for communicating with Opto MMP Devices. Assembly Version 3.0.3.0.

This object communicates to Ethernet connected Opto MMP devices, primarily the SNAP-PAC Ethernet product line. This includes the SNAP-PAC-S, SNAP-PAC-R, SNAP-PAC-EB, and now, the SNAP-PAC-SB series of I/O units.

The Opto MMP Protocol is documented in Opto 22 form 1465. The protocol is a publically available, royalty-free data protocol. Serial OptoMMP protocol has an internally documented header. We do not publish this information.

The 3.x SDK now supports the serial based SNAP-PAC-SB series of I/O units (over serial cables).

The 3.x implementation should work with on-board serial ports (with deep receive FIFOs of 128 bytes or more) and some USB to serial converters (with similar or deeper FIFOs).

Best performance is via PCI Express connected serial ports. USB to serial converters may work but with additional latency. We tested a very limited number of USB converters successfully. In lower performing applications, the latency of USB to serial converters may be acceptable.

Serial communication throughput is inherently slower compared to Ethernet. The slowness is due to two factors, the very slow data rate and only a single message may transact over a single serial network. Communication throughput may be improved by using multiple serial ports and using a separate, asynchronous thread to communicate to each serial port. A single OptoMMP object should be associated with each serial network.

For Ethernet connected devices, an object is responsible for communicating to a single Opto MMP device connection. More than one object (meaning more than one connection) may be assigned to an Opto MMP device. The object contains thread synchronization but ideally, sharing an object amongst different threads of execution does not work effectively and is discouraged. The object's connection is intended to be opened and left open as Int64 as possible until the application terminates or a communication fault occurs to the device. The object may be reused to communicate to the same object. Do not rapidly open and close a single object to communicate to multiple Opto MMP devices. Instead, always create an object for each device. This will alleviate connection issues and simplify the code implementation.

For serial devices (SNAP-PAC-SB1 and SNAP-PAC-SB2), an object is assigned all the devices contained on a communication (COM) port. To communicate with a specific device, set the device address first before initiating an access method. If more than one serial port is used, multiple objects are uniquely assigned to each communication port. For best throughput, each object should be used in a private thread of execution to decrease latency by parallelizing scanning.

All methods are blocked methods. This means execution within the method pauses while the code waits for a response or timeout to occur. Higher throughput apps should use multiple threads and multiple objects to accelerate data access. But using too many concurrent communication objects will degrade the performance of the SNAP-PAC device. If many concurrent connections seem to be required, consider creating a scanner thread to communicate with the PAC and allow other threads to access thread shared data amongst the scanning thread.

The methods of this SDK blocks (suspend thread execution) while the physical I/O unit is messaged across the network. While usually, this is a very fast operation, high-latency networks, serial networks, or communication failures make consume a considerable amount of time. Due to this potential large consumption of time/resources, we do not recommended to implement the SDK within the context of a Windows Message/Event handler. Examples of this are mouse, forms, buttons, or other application events. This prevents the Windows "hour-glass" effect on the interface.

Opto 22 strongly recommends the use of UDP when a single network segment (no routers) is used. In cases where wireless, lossy networks, or high-latency WANs are implemented, use TCP with a minimum timeout of 1 second (1,000 milliseconds). Longer timeouts allows TCP/IP to perform background retranmissions increasing probability of communication success.

Data access efficiency is via reading the I/O unit in "banks" or those methods that allow you to read all or chunks of the I/O data all at once. One note, if caching is enabled (non-zero time), point reads are converted into bank operations. So you won't have to rewrite "point" oriented code. If you disable caching, you should perform bank reads to reduce network traffic and reduce I/O access latencies that will accumulate with each I/O read operation.

The SDK is written with optimization biased for Ethernet connected SNAP-PAC hardware. Serial devices have significantly higher communication latencies (compounded with lower and lower baud rates). Serial implementation may need to make hardware configuration consideration to positively affect communication throughput.

This library is built with the 3.5 .Net Framework. Windows 8.1 Pro users should not have to install the .Net 3.5 Framework to use this SDK.

This SDK supports Windows Windows 7 Professional (32- or 64-bit versions) and Windows 8.1 Pro (32- or 64-bit versions). Library is not tested on Windows RT.

Please use an Intel "Core 2" or AMD Athlon II/Phenom (or newer) microprocessor. Ensure your computer well exceeds a recommended configuration for the specific operating system. Please consider that the .Net framework (and your application) exercises a large amount of memory allocation/deallocation. So RAM memory headroom is a very important consideration.

This SDK should work with much more recent Atom processors. But some of these architectures are very resource inhibited and thus may encounter some hindering (unforeseen) limitations.

Please see Readme_WhenErrorsOccur() to handle unexpected issues. When a method ever returns a negative result, close the object. This library will log the fault in the Application Event viewer.

Please see Readme_AboutIOModules() to have a brief introduction to the types of SNAP IO modules. Knowing what modules you have will allow you to quickly know how to read and write to them.

IPv6 connectivity options offered when users are accessing one of our devices over a network through some kind of IPv6 to IPv4 router. In the near future, the allocation of IPv4 addresses will likely become more and more expensive pressing remote IO users to select IPv6 addresses (due to lower costs). This library provides this connection alternative.

Typically, the OptoMMP device allows up to 16 TCP/IP connections simultaneously. UDP is different in that a single socket is used due to the connectionless nature. This interface will buffer several dozen message before the incoming queue is filled. Subsequent messages beyond the queue depth are dropped. In most applications, we recommend using as little TCP sessions as possible or minimal filling of the UDP queue. This is to maintain a responsive system.

Release Notes have been moved to ReleaseNotes.txt.

Member Enumeration Documentation

Enumerations of the analog value types that may be read.

Assembly 3.0.4.0 adds Minimum and Maximum.

Enumerator
EngineeringUnits 

Write the point in Engineering Units. Most applications use this.

Counts 

Write the point in counts.

Minimum 

Reads Minimum analog input.

Maximum 

Reads Maximum analog input.

Enumerations of the analog value types that may be written.

TPO options are only for the analog TPO module, SNAP-AOD-29.

Enumerator
EngineeringUnits 

Write the point in Engineering Units. Most applications use this.

Counts 

Write the point in counts.

AnalogTpoResolution 

Sets the TPO Resolution of a SNAP-AOD-29

AnalogTpoPeriod 

Sets the TPO Period of a SNAP-AOD-29

Enumerations of the 4096-point analog value types that may be written.

Does not support the SNAP-AOD-29.

Enumerator
EngineeringUnits 

Write the point in Engineering Units. Most applications use this.

Counts 

Write the point in counts.

TpoPeriod 

Sets the TPO Period. This is when using the brain's pulse-period functionality.

Connection Types for Opto MMP

Enumerator
UdpIp 

Use a UDP/IP Connection for Opto MMP, most preferred data protocol.

TcpIp 

Use a TCP/IP Connection for Opto MMP, useful when going Int64 distances through gateways and/or routers.

UdpIpv6 

Use a UDP/IPv6 Connection for Opto MMP, most preferred if you have an IPv6 remote NAT address

TcpIpv6 

Use a TCP/IPv6 Connection for Opto MMP, if you have an IPv6 remote NAT address

SerialOst 

Use a serial card or USB connected serial port.

Probe data coding format enumerations.

Used to select how the module will detect the data format of the transducer. Note, Gray Code is more error tolerant. If you have a choice, use Gray Coding.

Enumerator
Binary 

The probe emits serial data that is binary encoded.

GrayCode 

Probe emits serial data in Gray code.

None 

No Assigned Code

Digital features that may be configured in the 64-point memory map.

Enumerator
None 

Ordinary digital point.

Counter 

Set up digital input as a counter.

QuadratureSimple 

Set up digital input as a quadrature counter, requires a SNAP-IDC5Q (quadrature module).

QuadratureIndex 

Set up a digital input as a quadrature counter with a separate input as an index. SNAP-IDC5Q and additional digital input module required.

Algorithm Options.

Changes made to support SNAP-PAC firmware R9.4C or later. For R9.4B or earlier, what is now called "VelocityB_Deprecated" was "VelocityB", "Isa_Obsolete" was "Isa", and "Interacting_Obsolete" was "Interacting". These will still work and report for older firmware and UIO.

For all current and new applications, use the now labelled VelocityC, Isa, Parallel, or Interacting algorithms. Retuning of PIDs are required for recompiled applications or those applications changing algorithms.

Enumerator
Disabled 

Disables the PID. Only a disabled setting halts the operation of a PID.

VelocityB_Obsolete 

Obsolete Velocity B Algorithm (enumeration 1).

Isa_Obsolete 

Obsolete ISA Algorithm (enumeration 2).

Parallel_Obsolete 

Obsolete Parallel Algorithm (enumeration 3).

Interacting_Obsolete 

Obsolete Interacting Algorithm (enumeration 4).

VelocityC 

Velocity C Algorithm (enumeration 5). Only available on R8.5e firmware and later; library does not check validity of this value with the firmware.

See notes regarding if the PID's input is supplied by a supervisory system (as opposed to an analog input).

Isa 

Updated ISA Algorithm (enumeration 6).

Parallel 

Updated Parallel Algorithm (enumeration 7).

Interacting 

Updated Interacting Algorithm (enumeration 8).

PID Write Options

Use enumeration ePidWriteOptions.InitializeAll to first time initialize the PID. Leave the algorithm in the Disabled setting or the PID instantly starts. You may also want to leave the PID in manual mode as well. Set the algorithm and the auto/manual mode thereafter.

Enumerator
InitializeAll 

Only use when completely initializing the PID. This is not a gracious initialization. You'll really want to leave the algorithm as default and use one of the other options to set it.

ProcessVariable 

Set the process variable (input). Only use when the process variable OptoMMP address is set to zero otherwise, unpredictable results will occur. Uses f32ProcessVariableOrInput.

Setpoint 

Set the setpoint. Only use when the setpoint OptoMMP address is set to zero otherwise, unpredictable results will occur. Uses f32Setpoint.

PCoefficient 

Set the proportional, K, or gain coefficient. Uses f32GainParameter.

ICoefficient 

Set the integral or I coefficient. Uses f32IntegralParameter.

DCoefficient 

Set the derivative or D coefficient. Uses f32DerivativeParameter.

FFGain 

Set the feed forward gain coefficient. Uses f32FeedForwardGainParameter.

OutputChangesAllowed 

Set the maximum and minimum output change limits. Uses f32MaximumOutputChange and f32MinimumOutputChange.

ProcessVariableClamps 

Set the limits on the process variable. Uses f32InputLowRange and f32InputHighRange.

OutputClamps 

Set the limit on the output. Uses f32OutputLowerClamp and f32OutputUpperClamp.

Scantime 

Set the PID scan time. Uses f32PidScanTimeSeconds.

OutputForceValuesWhenInputOutOfRange 

Set the output forcing values when the input goes out of range. Uses f32InputLowOutputForceValue and f32InputHighOutputForceValue. This value is usually only initialized once.

ProcessVariableOptoMmpAddress 

Set the process variable OptoMMP address. Use zero if your application provides the process variable. Uses u32InputSourceOptoMmpAddress. Use the lower 32-bits of the 48-bit OptoMMP address.

SetpointOptoMmpAddress 

Set the setpoint variable OptoMMP address. Use zero if your application provides the setpoint. Uses u32SetpointSourceOptoMmpAddress. Use the lower 32-bits of the 48-bit OptoMMP address.

OutputOptoMmpAddress 

Set the output OptoMMP address. Use zero if your application reads and processes the output. Uses u32OutputDestinationOptoMmpAddress. Use the lower 32-bits of the 48-bit OptoMMP address.

PidAlgorithm 

The algorithm of the PID. Only use this after initializing the PID. Do not change thereafter or unpredictable results will occur. Use eAlgorithm. Use enumeration "Disabled" to shut down the PID functionality.

PidAutoManualMode 

Set the PID in auto or manual mode. Uses structure property bInManualMode. When Ethernet I/O based PID's are in manual mode and the PID output is linked to an analog output module, you may only change the output value by modifying the PID's output. Writing to the actual analog output is futile as the next scan of the PID will clobber the recently written value.

ConfigurationFlags 

The configuration flags. Uses bSquareRootOfInput, bForceOutputWhenInputOutOfRange, and bSwitchToManualWhenInputOutOfRange. This operation forces all three flags at once. These are typically only written at initialization. They aren't intended to be constant enabled/disabled.

SupervisorPidInput 

Use only for Velocity C, when the PID input is supplied by a supervisory system and the firmware version is R8.5e or later.

For some methods and properties, specifies when a point index is offered, which IoModel the index references.

Enumerator
IoModel64 

For a point index that references a 64-point bank area

IoModel512 

For a point index that references a 512-point bank area

Enumerations for a Serial Module's Parity Settings

Enumerator
None 

No Parity

Odd 

Odd Parity

Even 

Even Parity

Command Values For the Status Area Write - Read/Write (see Opto 22 Form 1465).

Enumerator
PowerUpClear 

Send a Power-Up-Clear command to the I/O unit. Normally when using Open(), set bPowerUpClear to true.

ResetToDefaults 

Erases the I/O Unit FLASH configurations and reboots. TCP connections will be severed. Device or Ethernet network may take up to 30 seconds to recover. A communication timeout may be falsely logged in the Windows Application Event queue.

StoreToFlash 

Store the current I/O unit configuration to flash. This includes I/O configuration, serial settings, scratchpad values, etc.

EraseFlash 

Erases the I/O unit's FLASH image. This does not erase the currently in use RAM image.

ResetHardware 

Trigger the Opto MMP device to reboot (like power-cycling). A communication timeout may be falsely logged in the Windows Application Event queue.

ClearDigitalEvents 

Clear digital events.

ClearAlarmsConfig 

Clear alarm configuration.

ClearPPPConfig 

Clear PPP configuration.

ClearEMailConfig 

Clear EMail Configuration.

ClearDigitalEventsExpanded 

Clear digital events. For firmware 8.0 and lower, clears timer configuration.

ClearPidLoops 

Clears PID loop configuration.

ClearDataLog 

Clears the data log configuration.

Selection of temperature scales for the temperature converter. Use with the static property ConvertTemperature().

Enumerator
Celsius 

Celsius temperature scale.

Kelvin 

Kelvin temperature scale.

Fahrenheit 

Fahrenheit temperature scale.

Rankine 

Rankine temperature scale.

Constructor & Destructor Documentation

Opto22.OptoMMP3.OptoMMP.OptoMMP ( )

Constructor

Member Function Documentation

void Opto22.OptoMMP3.OptoMMP.AboutPulses ( )

Information on generating digital pulses. Method does not perform any operations.

Caution, use pulses with only R9.0 or later firmware (SNAP-PAC-R or -EB devices only).

Pulses are intended for use on a digital output point. This point may be either a 4-channel digital output or with a "high-density" digital output. High-Density is a digital output module with more than 4 channels. Pulses are available in two formats, pulses defined by "on-time/off-time" or a percentage of on-time based on a time period.

For either type of pulse, there is a delay time in seconds that delays the actual pulse start.

For "time" based pulses, specify the "on-time" and the "off-time" in seconds. In this case, the resulting pulse time period is the sum of the on- and the off-times. This useful for generating pulsing claxons, alarms or indicators.

For "duration" based pulses, you will specify an initial "on-percentage" of the total pulse period. The remaining percentage of the period will be off.

A time-proportional output is a continuous duration based pulse. In this case, usually the on-percentage is modified to adjust how much of the pulse period is in the "on" state.

After a "configure" method is used, a pulse must be started using StartPulse(). A pulse may be stopped at any time using the StopPulse() method. In addition, forcing the digital output on or off cancels a pulse operation.

When configuring a pulse for a 4-channel digital module, ensure the point index is calculated using the GetPointIndexFor64() and set the point model type enumeration properly. For high-density digital modules, use GetPointIndexFor512 and set the IoModel enumeration.

There are limits for 4-channel digital output modules. SNAP-PAC-R1 has a minimum period of 0.006 seconds and an accuracy of 0.001 seconds. SNAP-PAC-R2 has a minimum period of 0.100 seconds and an accuracy of 0.001 seconds. SNAP-PAC-EB1 has a minimum period of 0.040 seconds and an accuracy of 0.005 seconds. SNAP-PAC-EB2 has a minimum period of 0.100 seconds and an accuracy of 0.005 seconds.

For high-density digital outputs (modules with more than 4 digital outputs), the minimum period is 1.00 seconds and a worse case accuracy of 1 second.

void Opto22.OptoMMP3.OptoMMP.Close ( )

Close the OptoMMP device connection.

Mmp.Close();

Int32 Opto22.OptoMMP3.OptoMMP.ConfigureContinuousPulsesDuration ( Boolean  bInvert,
Single  f32StartDelayTimeSeconds,
Single  f32OnPercent,
Single  f32PeriodSeconds,
IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512 
)

Configure a continuous digital pulse train with percent-on and waveform period values.

Parameters
f32StartDelayTimeSecondsDelay start time in seconds.
bInvertTrue inverts logic levels, for example the on portion of the pulse is now off and vice versa.
f32OnPercentOn percent, values 0.0 to 100.0.
f32PeriodSecondsWaveform period in seconds.
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Digital point index to pulse too. Provide 64 point index for 4-channel digital modules, 512- for high-density.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ConfigureContinuousPulsesTime ( Boolean  bInvert,
Single  f32StartDelayTimeSeconds,
Single  f32OnTimeSeconds,
Single  f32OffTimeSeconds,
IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512 
)

Configure a continuous digital pulse train with on-time and off-time values.

Parameters
bInvertTrue inverts logic levels, for example the on portion of the pulse is now off and vice versa.
f32StartDelayTimeSecondsDelay start time in seconds.
f32OnTimeSecondsOn time in seconds.
f32OffTimeSecondsOff time in seconds.
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Digital point index to pulse too. Provide 64 point index for 4-channel digital modules, 512- for high-density.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ConfigureNPulsesDuration ( Boolean  bInvert,
Single  f32StartDelayTimeSeconds,
Single  f32OnPercent,
Single  f32PeriodSeconds,
UInt32  u32PulseQuantity,
IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512 
)

Configure a continuous digital pulse train using percent-on and wave period parameters.

Parameters
f32StartDelayTimeSecondsDelay start time in seconds.
bInvertTrue inverts logic levels, for example the on portion of the pulse is now off.
f32OnPercentOn percent, values 0.0 to 100.0.
f32PeriodSecondsTotal waveform period in seconds.
u32PulseQuantityNumber of pulses to generate.
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Digital point index to pulse too.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ConfigureNPulsesTime ( Boolean  bInvert,
Single  f32StartDelayTimeSeconds,
Single  f32OnTimeSeconds,
Single  f32OffTimeSeconds,
UInt32  u32PulseQuantity,
IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512 
)

Configure an "N" pulse train using on-time and off-time parameters.

Parameters
bInvertTrue inverts logic levels, for example the on portion of the pulse is now off.
f32StartDelayTimeSecondsDelay start time in seconds.
f32OnTimeSecondsOn time in seconds.
f32OffTimeSecondsOff time in seconds.
u32PulseQuantityNumber of pulses to generate.
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Digital point index to pulse too. Provide 64 point index for 4-channel digital modules, 512- for high-density.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
static String Opto22.OptoMMP3.OptoMMP.ConvertNumberToFirmwareVersion ( Int32  i32Number)
static

Converts an Opto 22 Version number (32-bit) to a version string like R8.5A.

This works with either the loader or firmware version numbers

Parameters
i32NumberThe Opto 22 version number read from an OptoMMP Device.
Returns
A user readable string of the version number
static Double Opto22.OptoMMP3.OptoMMP.ConvertTemperature ( Double  dInputTemp,
TemperatureScale  eInScale,
TemperatureScale  eOutScale 
)
static

Convert temperatures.

The brain is slow to change temperature scales. Depending on the application, temperatures may need to be changed depending on the specific system needs; in some cases, the same system may need to display more than one temperature scale. This method provides a faster and more efficient way of converting temperatures.

Parameters
dInputTempInput temperature value.
eInScaleInput temperature scale.
eOutScaleOutput temperature scale.
Returns
Temperature in units of eOutScale.

(C#)
dDegreesF = OptoMMP.ConvertTemperature(dDegreesC, OptoMMP.TemperatureScale.Celsius, OptoMMP.TemperatureScale.Fahrenheit);

Int32 Opto22.OptoMMP3.OptoMMP.EnableBrainStreaming ( Boolean  bEnableStreaming)

Controls the enable/disable functionality of brain streaming. Functionality only exists on Ethernet based I/O units.

This method didn't properly update the stream enabled flag.

Parameters
bEnableStreamingtrue to enable stream.
Returns
0 for successful, negative for error, check with LogErrorInformation().

// to enable
Mmp.EnableBrainStreaming(true);

// to disable
Mmp.EnableBrainStreaming(true);

void Opto22.OptoMMP3.OptoMMP.GetExtendedErrorInformation ( out String  strMessage,
out Boolean  bCommFault,
out Boolean  bProtocolFault,
out Boolean  bArgumentFault 
)

Retrieves extended error information. This information is also logged in the computer's Application event log.

[KB 84294] Depending on the implementation of user code, GetExtendedErrorInformation() would cause a null exception. This is fixed in assembly version 3.0.2.0 and later.

Parameters
strMessageString to store the message generated by the method.
bCommFaultTrue indicates a communication oriented fault. Close and reopen the object.
bProtocolFaultTrue indicates an Opto MMP oriented fault. More than likely, you're using UDP, and the I/O unit power cycled. Perform a WriteStatusCommand() and issue a "PowerUpClear". TCP connections will break when the I/O unit is reset so this code would not be returned.
bArgumentFaultTrue indicates a fault was generated by an improper argument. Inspect the argument values passed, a parameter is not correct.
static void Opto22.OptoMMP3.OptoMMP.GetModuleAndChannelFromPoint4096 ( Int32  i32Point,
out Int32  i32Module,
out Int32  i32Channel 
)
static

Converts A Point Number From The 4096 Point Model To A Module And Channel Number.

Parameters
i32Point4096 model point number.
i32ModuleThe module number.
i32ChannelThe point number.
static void Opto22.OptoMMP3.OptoMMP.GetModuleAndChannelFromPoint512 ( Int32  i32Point,
out Int32  i32Module,
out Int32  i32Channel 
)
static

Converts A Point Number From The 512 Point Model To A Module And Channel Number.

Parameters
i32Point512 model point number.
i32ModuleThe module number.
i32ChannelThe point number.
static void Opto22.OptoMMP3.OptoMMP.GetModuleAndChannelFromPoint64 ( Int32  i32Point,
out Int32  i32Module,
out Int32  i32Channel 
)
static

Converts A Point Number From The 64 Point Model To A Module And Channel Number.

Parameters
i32Point64 model point number.
i32ModuleThe module number.
i32ChannelThe point number.
static Int32 Opto22.OptoMMP3.OptoMMP.GetPointNumberFor4096 ( Int32  i32Module,
Int32  i32Channel 
)
static

Converts Module and Channel to Point Number For 4096 Point IO Unit Model.

Parameters
i32ModuleModule number, values range from 0 to 63, no error checking provided.
i32ChannelChannel on the module, values range from 0 to 63, no error checking provided.
Returns
Point number for the 4096 point model.
static Int32 Opto22.OptoMMP3.OptoMMP.GetPointNumberFor512 ( Int32  i32Module,
Int32  i32Channel 
)
static

Converts Module and Channel to Point Number For 512 Point IO Unit Model.

Parameters
i32ModuleModule number, values range from 0 to 15, no error checking provided.
i32ChannelChannel on the module, values range from 0 to 31, no error checking provided.
Returns
Point number for the 512 point model.
static Int32 Opto22.OptoMMP3.OptoMMP.GetPointNumberFor64 ( Int32  i32Module,
Int32  i32Channel 
)
static

Converts Module and Channel to Point Number For 64 Point IO Unit Model.

Parameters
i32ModuleModule number, values range from 0 to 15, no error checking provided.
i32ChannelChannel on the module, values range from 0 to 3, no error checking provided.
Returns
Point number for the 512 point model.
static Int32 Opto22.OptoMMP3.OptoMMP.GetSerialOrSsiPortIndexFromModuleAndChannel ( Int32  i32Module,
Int32  i32Channel 
)
static

Computes A Serial Port "Index" on the rack, for serial and SSI modules.

Parameters
i32ModuleModule location on the rack, 0 to 15.
i32ChannelChannel on the module, 0 (Channel A) or 1 (Channel B).
Returns
0 to 31 for normal inputs, -1 for errant inputs.
Int32 Opto22.OptoMMP3.OptoMMP.Open ( String  sHost,
Int32  i32Port,
Connection  eType,
Int32  i32InitialTimeoutMs,
Boolean  bPowerUpClear 
)

Opens An OptoMMP Object. The UDP/IP option is strongly recommended for single-segment networks. Use TCP/IP when communicating over wireless and wide-area-network connections. For Wide-Area-Networks, larger timeouts may be needed. If using TCP/IP, an internal reconnection backoff algorithm throttles how agressive reconnections will occur at.

Parameters
sHostHostname (DNS or "hosts") or IP Address in dot format.
i32PortThe UDP or TCP port, typically, 2001.
eTypeConnection Type, use UDP for most systems, TCP when internet connectivity is involved.
i32InitialTimeoutMsInitial timeout (ms) for messaging transactions. 1000 ms is typical.
bPowerUpClearSet this to "true." True clears the "Powered Up" flag on the brain.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

Int32 i32Result = Mmp.Open("172.22.1.2", 2001, OptoMMP.Connection.UdpIp, 1000, true);

Int32 Opto22.OptoMMP3.OptoMMP.OpenSerialBinary ( String  sCommPort,
Int32  i32BaudRate 
)

Open a serial (binary) connection to a string of I/O units. The OptoMMP SDK uses only a Windows COM port. Your COM port may be an add-in card or a USB to Serial Converter (that emulates a COM port).

Parameters
sCommPortComm port string, a valid port such as COM1, COM3, or COM28.
i32BaudRateBaud rate, once opened, cannot be changed.
Returns
0, okay, negative values are errors.

Int32 i32Result = Mmp.OpenSerialBinary("COM60", 115200);

Int32 Opto22.OptoMMP3.OptoMMP.ReadAnalogEu512 ( Int32  i32Point,
out Single  f32Value 
)

Read a single Analog Engineering Unit Value. This method relies on the area "Analog EU or Digital Counter Packed Data -- Read."

May return a cached value.

Parameters
i32PointPoint number, range is 0 to 511.
f32ValueParameter to store the point value.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadAnalogEus512 ( Single[]  f32aryValues,
Int32  i32StartIndex 
)

Read all Analog States as Engineering Units. This method relies on the OptoMMP area "Analog EU or Digital Counter Packed Data -- Read."

This method may return cached values.

Parameters
f32aryValuesArray to store values retrieved from the IO unit. This array must be 512 elements larger than i32StartIndex in length.
i32StartIndexStarting index in the data array to store read values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadAnalogLoadCellConfiguration4096 ( Int32  i32PointNumber,
out UInt32  u32FastSettle,
out UInt32  u32FilterWeight 
)

Reads analog load cell configuration in 4,096 point area.

This just returns a single load-cell module's fast-settle and filter weight parameters.

While this is a configuration function, the data lies within the analog point write area (kind of unusual).

Parameters
i32PointNumberPoint Number, 0 to 511.
u32FastSettleLoad cell input fast settle value. See form 1465 for values.
u32FilterWeightFilter weight value. See form 1465 for values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadAnalogLoadCellConfiguration64 ( Int32  i32PointNumber,
out UInt32  u32FastSettle,
out UInt32  u32FilterWeight 
)

Read analog load cell configuration in the analog 64 point area (one point at a time).

Reads the analog load cell's parameters (fast-settle and filter weight).

While this is a configuration function, the data lies within the analog point write area (kind of unusual).

Parameters
i32PointNumberThe 64-point rack's number, from 0 to 63.
u32FastSettleThe fast settle parameter, see form 1465 for values.
u32FilterWeightThe filter weight setting, see form 1465 for values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadAnalogPointConfiguration4096 ( Int32  i32PointNumber,
out Int32  i32PointType,
out Single  f32HighScale,
out Single  f32LowScale,
out Single  f32Offset,
out Single  f32Gain,
out Single  f32FilterWeight,
out Boolean  bEnableWatchdog,
out Single  f32WatchdogValue,
out String  sPointName,
out Single  f32LowerClamp,
out Single  f32UpperClamp 
)

Read Analog Point configuration in 4,096 Point Area.

This area must be configured before points may be read in the 512-point area.

Useful for reading all configuration values of an analog point (input or output).

Parameters
i32PointNumberPoint Number, 0 to 511.
i32PointTypeThe point type.
f32HighScaleUpper Scale Value (when input is 100%).
f32LowScaleLower Scale Value (when input is either 0% [unipolar] or -100% [bipolar]).
f32OffsetOffset.
f32GainGain.
f32FilterWeightFilter Weight (0.0 disables or positive values).
bEnableWatchdogEnable analog communication watchdog.
f32WatchdogValueThe value to force whhen communication watchdog occurs.
sPointNameName of the point. Maximum 50 characters. Additional characters will be truncated.
f32LowerClampLower clamp of analog reading.
f32UpperClampUpper clamp of analog reading.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadAnalogPointConfiguration64 ( Int32  i32PointNumber,
out Int32  i32ModuleType,
out Int32  i32PointType,
out Single  f32HighScale,
out Single  f32LowScale,
out Single  f32Offset,
out Single  f32Gain,
out Single  f32FilterWeight,
out Boolean  bEnableWatchdog,
out Single  f32WatchdogValue,
out String  sPointName 
)

Read Analog Point Configuration in the 64-Point Area.

This method may return a cached value.

Parameters
i32PointNumberAnalog Point Number, 0 to 63.
i32ModuleTypeModule type.
i32PointTypePoint type.
f32HighScale100% high-scale value.
f32LowScale0% (unipolar) or -100% (bipolar) low-scale value.
f32OffsetCalibration offset.
f32GainCalibration gain.
f32FilterWeightFilter weight.
bEnableWatchdogWatchdog enabled.
f32WatchdogValueWatchdog value.
sPointNamePoint name.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadAnalogState4096 ( Int32  i32Point4096Number,
AnalogReadOptions  eReadOption,
out Single  f32AnalogValue 
)

Read an analog engineering units state, counts, or TPO values via a point number.

If Freshness is set to a non zero value, this method may returned a cached value.

Note, caching is configured when read adjacent values of the point, e.g. eu state, max, and min. If large blocks of analog points are going to be accessed consider either the 512 point methods or creating a custom data area.

[KB 84541] Assemblies 3.0.0.0 through 3.0.2.0 only read module 0, point 0 despite the value offered for i32Point4096Number.

Parameters
i32Point4096NumberPoint number requested, range 0 to 4095.
eReadOptionWhich attribute of the point to read.
f32AnalogValueCurrent value of the analog input or output.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadAnalogState64 ( Int32  i32PointNumber,
out Single  f32AnalogValue 
)

Read an analog state via a point number.

If Freshness is set to a non zero value, this method may returned a cached value.

Parameters
i32PointNumberPoint number requested, range 0 to 63.
f32AnalogValueCurrent value of the analog input or output.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadAnalogStates64 ( Single[]  f32aryData,
Int32  i32StartingIndex 
)

Read all low-density (64-point) Analog Input and Output States.

May return cached values.

In assembly version 1.1.2.0, a fix was made that if fary wasn't exactly 64, a -1 would be returned.

Parameters
f32aryDataSingle array to store the requested data. Must be preinitialized.
i32StartingIndexStarting index to store this data.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadBrainDiagnosticInformation ( out structBrainDiagnosticInformation  info)

Read the diagnostic information of the brain. Added (April 4, 2011).

[KB 84295] In assembly version 3.0.0.0, a premature error could be returned as a result. The premature error was an invalid response when encountering I/O units that had different "status read areas." When encountering a missing status read area, a errant fault code was improperly returned.

Parameters
infoParameter package read from the brain.
Returns
If result returned in zero, info's data is valid.
Int32 Opto22.OptoMMP3.OptoMMP.ReadBrainStreamingConfiguration ( out Boolean  bIsEnabled,
out Int32  i32IntervalMs,
out Int32  i32UdpPortDestination,
out String[]  saryIpAddresses,
out UInt32  u32OptoMMPAddress,
out Int32  i32LengthOfStream 
)

Read the Brain Streaming configuration.

Parameters
bIsEnabledWhen true, stream is enabled.
i32IntervalMsInterval of stream in milliseconds, 0 is as fast as possible.
i32UdpPortDestinationPort to stream to, this is the PC or client's destination port.
saryIpAddressesIP addresses configured in "dot" format.
u32OptoMMPAddressMMP address if not default stream.
i32LengthOfStreamLength of the MMP stream (if not default).
Returns
0 for successful, negative for error, check with LogErrorInformation().
Int32 Opto22.OptoMMP3.OptoMMP.ReadClearDigitalLatch64 ( Int32  i32PointNumber,
Boolean  bOnLatch,
out Boolean  bLatchState 
)

Read and clear a digital latch.

This method does not return cached values.

This method only works with the 64-point I/O unit properties.

Parameters
i32PointNumberPoint number to read (0 through 63).
bOnLatchTrue, method reads and clears "on" latch. When False, reads and clears "off" latch.
bLatchStateThe state of the selected latch.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadClearDigitalLatches64 ( Boolean  bReadAndClearLatches,
out Int64  i64LatchBitmask 
)

Read and clear digital latches in the 64-point area.

This method does not return cached values.

This method only works with the 64-point I/O unit properties.

Parameters
bReadAndClearLatchesTrue, method reads and clears "on" latch. When False, reads and clears "off" latch.
i64LatchBitmaskA Int64 to store the latch state. Bit 0 is channel 0.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadClearDigitalLatches64 ( Boolean  bOnLatches,
out UInt64  u64LatchBitmask 
)

Read and clear digital latches in the 64-point area, with a UInt64 latch bitmask.

This method does not return cached values.

This method only works with the 64-point I/O unit properties.

Parameters
bOnLatchesTrue, method reads and clears "on" latch. When False, reads and clears "off" latch.
u64LatchBitmaskA UInt64 to store the latch state. Bit 0 is channel 0.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadClearDigitalLatches64 ( Boolean  bOnLatches,
Boolean[]  baryLatches,
Int32  i32StartIndex 
)

Read and clear digital latches in the 64-point area, with a UInt64 latch bitmask.

This method does not return cached values.

This method only works with the 64-point I/O unit properties.

Parameters
bOnLatchesTrue, method reads and clears "on" latch. When False, reads and clears "off" latch.
baryLatchesA boolean array to store the latch states. Bit 0 is channel 0.
i32StartIndexStart index of baryLatches to write latch states too.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadCustomConfiguration ( Int32  i32StartIndex,
Int32  i32Length,
UInt32[]  u32aryCustomAddresses,
Int32  i32ArrayStartIndex 
)

Read OptoMMP address configuration from the custom area.

Parameters
i32StartIndexStarting index in the custom address area. Valid indexes are 0-1023.
i32LengthAmount of addresses to retrieve from I/O unit. Must be between 1 and 256 inclusive.
u32aryCustomAddressesArray of OptoMMP addresses (lower 32-bits) as UInt32.
i32ArrayStartIndexStart index of the array.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadCustomData ( Int32  i32StartIndex,
Int32  i32Length,
UInt32[]  u32aryData,
Int32  i32ArrayStartIndex 
)

Read custom configured data from the custom data area. Data is always returned as UInt32.

Parameters
i32StartIndexStarting index in the custom area, values 0 through 1023.
i32LengthNumber of custom addresses, do not exceed 256.
u32aryDataArray of OptoMMP addresses.
i32ArrayStartIndexStarting index in u32aryData.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDateTime ( out String  sDateTime)

Read the Date and Time of the I/O Unit

Parameters
sDateTimeDate Time String from the I/O Unit
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

// read date time
i32Result = Mmp.ReadDateTime(out sDateTime);

Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalCountersStatus64 ( out Int64  i64ActivateBitMask)

Reads All 64 Counter Status.

This may returned cached values.

Parameters
i64ActivateBitMaskStatus of the counters as a 64-bit mask.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalCountersStatus64 ( Boolean[]  baryActive,
Int32  i32StartIndex 
)

Read All 64 Counter Status To A Boolean Array.

Parameters
baryActiveStates of the counters, true is active counter. Array must be at least i32StartIndex + 64 in length.
i32StartIndexStarting index to store values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalCounterStatus64 ( Int32  i32PointNumber,
out Boolean  bCounterStatus 
)

Read a Counter Status in the 64 Point IO Unit Memory Map.

This may returned cached values.

Parameters
i32PointNumberPoint number to read, values 0 through 63.
bCounterStatusThe counter's status as a boolean.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalLatch64 ( Int32  i32PointNumber,
out Boolean  bOnLatch,
out Boolean  bOffLatch 
)

Read the Digital Latches Selected by a Point Number.

May return cached values.

This method only works with the 64-point I/O unit properties.

Parameters
i32PointNumberPoint number, range 0 to 63. 0 is point 0.
bOnLatchOn latch state.
bOffLatchOff latch state.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalLatches64 ( out Int64  i64OnLatchBitMask,
out Int64  i64OffLatchBitMask 
)

Read all On and Off Latch States of the 64 Point I/O Unit Rack at Bitmasks.

May return cached values.

Does not return the latch state of high-density digital modules.

This method only works with the 64-point I/O unit properties.

Parameters
i64OnLatchBitMaskBit packed mask of on-latches. Bit-0 coorelates to point 0.
i64OffLatchBitMaskBit packed mask of off-latches. Bit-0 coorelates to point 0.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalLatches64 ( out UInt64  u64OnLatchBitMask,
out UInt64  u64OffLatchBitMask 
)

Read all On and Off Latch States of the 64 Point I/O Unit Rack with Unsigned Bitmasks.

May return cached values.

Does not return the latch state of high-density digital modules.

This method only works with the 64-point I/O unit properties.

Parameters
u64OnLatchBitMaskBit packed mask of on-latches. Bit-0 coorelates to point 0.
u64OffLatchBitMaskBit packed mask of off-latches. Bit-0 coorelates to point 0.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalLatches64 ( Boolean[]  baryOnLatches,
Boolean[]  baryOffLatches,
Int32  i32StartIndex 
)

Read all On and Off Latch States of the 64 Point I/O Unit Rack with Boolean arrays.

May return cached values.

Does not return the latch state of high-density digital modules.

This method only works with the 64-point I/O unit properties.

Parameters
baryOnLatches64 element Boolean array of on-latches. Index 0 coorelates to point 0 when i32StartIndex == 0.
baryOffLatches64 element Boolean array of off-latches. Index 0 coorelates to point 0 when i32StartIndex == 0.
i32StartIndexStart index of the on-latch an off-latch arrays to store data.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalPointConfiguration4096 ( Int32  i32PointNumber,
out Int32  i32ModuleType,
out Int32  i32PointType,
out Int32  i32Feature,
out Boolean  bWatchdogEnabled,
out Boolean  bWatchdogValue,
out String  sPointName 
)

Read the Digital Point Configuration (4096 points).

Parameters
i32PointNumberPoint number, 0 to 4095.
i32ModuleTypeModule installed in this location. See form 1465 for additional information.
i32PointTypePoint configured in this location.
i32FeatureFeature enabled (if any).
bWatchdogEnabledWatchdog enabled state.
bWatchdogValueWatchdog trigger state.
sPointNamePoint name. 50 characters maximum.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalPointConfiguration64 ( Int32  i32PointNumber,
out Int32  i32ModuleType,
out Int32  i32PointType,
out Int32  i32Feature,
out Boolean  bWatchdogEnabled,
out Boolean  bWatchdogValue,
out String  sPointName 
)

Read the Digital Point Configuration

Parameters
i32PointNumberPoint number, 0 to 63.
i32ModuleTypeModule installed in this location. See form 1465 for additional information.
i32PointTypePoint configured in this location.
i32FeatureFeature enabled (if any).
bWatchdogEnabledWatchdog enabled state.
bWatchdogValueWatchdog trigger state.
sPointNamePoint name. 15 characters maximum.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalState64 ( Int32  i32PointNumber,
out Boolean  bState 
)

Read the individual digital state by specifying the point number.

May returned a cached value depending on the data freshness.

This method only works with the 64-point I/O unit properties.

Parameters
i32PointNumberPoint number, valid values range from 0 to 63.
bStateThe state of the digital point, true is "on."
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalStates64 ( out Int64  i64DigitalStatesBitmask)

Read digital states as a 64-bit Bitmask.

Bit 0 coorelates to the first module, first channel of the rack.

Will report digital states, even when analog or serial modules are present.

May returned a cached value depending on the data freshness.

This method only works with the 64-point I/O unit properties.

This member only reads the states of 4-channel digital modules.

Parameters
i64DigitalStatesBitmaskReference to a long, to store the 64 digital states read.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalStates64 ( out UInt64  u64DigitalStatesBitmask)

Read digital states as a 64-bit Bitmask as a UInt64

Bit 0 coorelates to the first module, first channel of the rack.

Will report digital states, even when analog or serial modules are present.

May returned a cached value depending on the data freshness.

This method only works with the 64-point I/O unit properties.

This member only reads the states of 4-channel digital modules.

Parameters
u64DigitalStatesBitmaskReference to a long, to store the 64 digital states read.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadDigitalStates64 ( Boolean[]  baryDigitalStates64,
Int32  i32StartIndex 
)

Read 64 Digital States Into A Boolean Array

Parameters
baryDigitalStates64Array of booleans to store values. Length must be i32StartIndex + 64.
i32StartIndexStarting index to store values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadFOrCStatus ( out Boolean  bIsFahrenheit)

Read the Temperature Reporting Status of the Brain

Parameters
bIsFahrenheitAn out value of true is Fahrenheit, false is Celsius
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

// read the temperature status
i32Result = Mmp.ReadFOrCStatus(out bIsFahrenheit);

Int32 Opto22.OptoMMP3.OptoMMP.ReadHighDensityDigitalCounter ( Int32  i32Module,
Int32  i32Channel,
out UInt32  u32Counter 
)

Read a High-Density Digital Counter

This method may return a cached value.

Parameters
i32ModuleThe module number to read, 0 through 15.
i32ChannelThe channel number to read 0 through 31.
u32CounterThe counter value.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadHighDensityDigitalLatch ( Int32  i32Module,
Int32  i32Channel,
out Boolean  bOnLatch,
out Boolean  bOffLatch 
)

Read a single high-density digital latch.

method may return a cached value.

Parameters
i32ModuleModule number, 0 to 15.
i32ChannelChannel number, 0 to 31.
bOnLatchOn-latch state.
bOffLatchOff-latch state.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadHighDensityDigitalState ( Int32  i32PointNumber,
out Boolean  bState 
)

Read a high-density digital state.

This method may return a cached value.

Parameters
i32PointNumberHigh-Density Point number (0 through 511) to store the data in your boolean table.
bStateState of the digital point.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadHighDensityDigitalState ( Int32  i32Module,
Int32  i32Point,
out Boolean  bState 
)

Read a high-density digital state from a module and point index.

This method may return a cached value.

Parameters
i32ModuleModule number (index), values 0 through 15.
i32PointPoint number (index), values 0 through 63.
bStateState of the digital point.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadHighDensityDigitalStates ( Boolean[]  baryStates,
Int32  i32StartIndex 
)

Read All 512 High-Density Digital States (32 points per module times 16 modules).

This method may return a cached values.

Ignore digital data returned for; channels that do not exist, empty module slots, or module slots with analog or serial I/O modules.

Parameters
i32StartIndexStarting index to store the data in your boolean table.
baryStatesBoolean array. May be "null" if not information is desired.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadHighDensityDigitalStates ( UInt32[]  u32aryBitStates,
Int32  i32StartIndex 
)

Read All 512 High-Density Digital States To BitMask Array

Parameters
u32aryBitStatesArray to store states, one element per module. Array must be at least i32StartIndex + 16 in length.
i32StartIndexStarting index to store values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadInts ( Int64  i64MmpAddress,
Int32  i32Length,
Int32[]  i32aryInts,
Int32  i32StartingIndex 
)

Read a block of integers (32-bit signed values) from the Memory Map

There are many areas this toolkit does not support with a method. Use this method to access these areas.

The maximum number of elements that may be transferred is 256.

This method does not return cached values.

Parameters
i64MmpAddressStarting Opto MMP Address.
i32LengthNumber of 32-bit integer values to read.
i32aryIntsArray of 32-bit integers.
i32StartingIndexStarting index of the 32-bit integer array to store values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadLongs ( Int64  i64MmpAddress,
Int32  i32Length,
Int64[]  i64aryLongs,
Int32  i32StartingIndex 
)

Read a block of longs (64-bit signed values) from the Opto MMP Device.

There are many areas this toolkit does not support with a method. Use this method to access these areas.

The maximum number of elements that may be transferred is 128.

Does not return cached values.

Parameters
i64MmpAddressOpto MMP Address.
i32LengthQuantity of longs to read.
i64aryLongsArray of longs to read.
i32StartingIndexStarting index of i64aryLongs to read too.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
static void Opto22.OptoMMP3.OptoMMP.Readme_AboutIOModules ( )
static

About SNAP IO Modules (added 02-23-2011)

These are the types of SNAP IO Modules.

4-Channel Digital Input or Output

To access the data of these IO modules use the digital methods that end with a "64." To determine the mapping index [a number from 0 to 63] use the static helper GetPointNumberFor64().

(Up to) 4-Channel Analog Input or Outputs

To access the data of these IO modules, use analog methods that end with a "64." To determine the mapping index [a number from 0 to 63] use the static helper GetPointNumberFor64(). The 4096 methods may be used to access these points on SNAP-PAC products.

More than 4-Channel Digital Input or Output

To access the data of these IO modules, use digital methods like ReadHighDensityDigitalState(), ReadHighDensityDigitalStates(), WriteHighDensityDigitalState() or other member that include the "HighDensity" wording.

More than 4-Channel Analog Input or Output

To access input values from these modules, use ReadAnalogEu512(), ReadAnalogEus512() and other 512 point configurations. Use the helper GetPointNumberFor512() to determine the point's index you wish to retrieve. The 3.x release of the SDK has additional 4096 point analog access methods.

Serial Communication Modules are different modules. These require configuration (baud, stop bits, EOM characters etc) using this toolkit. See WriteSerialModuleConfiguration(). This is specifically for SCM-232 or SCM-485/422 IO modules. The communication stream is handled by a TCP session. You may use the ip4.Tcp_Client to connect to a serial module. The TCP ports for serial modules range from 22500 through 22531. The port number is determined by using this method GetSerialOrSsiPortIndexFromModuleAndChannel() and add 22500. One connection is allow to a serial module at a time. New connection requests to a serial port already being used will automatically close the currently open session.

This method does not perform any operation.

static void Opto22.OptoMMP3.OptoMMP.Readme_WhenErrorsOccur ( )
static

Description of when errors occur.

This assembly logs events to the computer's application event log. When a fault occurs (and the application didn't handle the condition), review the application event log. This file may be e-mailed to Opto 22's support so we may review the conditions of the fault as well.

When a negative response occurs from an object using TCP/IP, close the OptoMMP object.

When using serial or UDP/IP, back-off for a communication timeout period before resuming communications. These communication methods do not require the application to close the communication channel.

This method does not perform any operation.

Int32 Opto22.OptoMMP3.OptoMMP.ReadOptionallyClearAnalogMaxMin4096 ( Int32  i32Point4096Number,
Boolean  bClear,
out Single  f32Maximum,
out Single  f32Minimum 
)

Read and clear analog maximum and minimum value of a point on a 4096-point rack.

[KB 84543] Issue when using assemblies 3.0.0.0 through 3.0.2.0 on x86 and AMD64 (Intel and AMD) processor architectures. Invalid floating point results would occur.

Parameters
i32Point4096NumberPoint number (0 through 4095)
bClearWhen true, resets the maximum and minimum value after being read.
f32MaximumMaximum value read.
f32MinimumMinimum value read.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadOptionallyClearAnalogMaxMin64 ( Int32  i32PointNumber,
Boolean  bClear,
out Single  fMaximum,
out Single  fMinimum 
)

Read and clear analog maximum and minimum value of a point on a 64-point rack.

Parameters
i32PointNumberPoint number (0 through 63)
bClearWhen true, resets the value after being read.
fMaximumMaximum value read.
fMinimumMinimum value read.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadOptionallyClearCounter64 ( Int32  i32PointNumber,
Boolean  bClear,
out UInt32  u32Counter 
)

Read and optionally clear a counter on the 64 point rack.

This method does not cache data.

This method only works with the 64-point I/O unit properties.

Reading and clearing counters may cause counts to be lost.

Parameters
i32PointNumberPoint number in the 64-point IO unit model.
bClearWhen true, clears the counter.
u32CounterStorage for counter value.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadOptionallyClearCounters64 ( Boolean  bClear,
UInt32[]  u32aryCounters,
Int32  i32StartIndex 
)

Read and optionally clear all 64 counters.

This method does not return cached values.

This method only works with the 64-point I/O unit properties.

Reading and clearing counters may cause counts to be lost.

Parameters
bClearWhen true, clears the counters.
u32aryCountersStorage for counter values.
i32StartIndexStarting index in u32aryCounters to store data.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadOptionallyClearHighDensityDigitalCounters32 ( Boolean  bClear,
UInt32[]  u32aryCounters,
Int32  i32StartIndex 
)

Read and Optionally clear High Density Digital Counters

When bClear is false, may return a cached value.

When bClear is true, all high-density counters are cleared with this method.

Parameters
i32StartIndexStart index of the point to read counters.
bClearWhen true, counters are cleared after reading.
u32aryCountersUnsigned array to store the value of the counters.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadOptionallyClearHighDensityDigitalLatches ( Boolean  bClear,
Boolean[]  baryOnLatches,
Boolean[]  baryOffLatches,
Int32  i32StartIndex 
)

Read and Optionally Clear All 512 High-Density Latches To Boolean Arrays (32 points per module times 16 modules)

Parameters
i32StartIndexStart index to read and optionally clear.
bClearWhen true, clears the latch after being read. May return a cached value.
baryOnLatchesArray to store on-latch states.
baryOffLatchesArray to store off-latch states.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadOptionallyClearHighDensityDigitalLatches ( Boolean  bClear,
UInt32[]  u32aryOnLatches,
UInt32[]  u32aryOffLatches,
Int32  i32StartIndex 
)

Read and Optionally Clear All 512 High-Density Latches To BitMasks (32 points per module times 16 modules)

Method may return cached values if bClear is false.

Parameters
i32StartIndexStart index to read and optionally clear.
bClearWhen true, clears the latch after being read.
u32aryOnLatchesArray to store on-latch bitstates.
u32aryOffLatchesArray to store off-latch bitstates.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadOptionallyClearHighDensityDigitalLatches ( Int32  i32StartModule,
Int32  i32EndModule,
Boolean  bClear,
Boolean[]  baryOnLatches,
Boolean[]  baryOffLatches,
Int32  i32StartIndex 
)

Read and Optionally Clear All 512 High-Density Latches To Boolean Arrays (32 points per module times 16 modules)

Method may return cached values if bClear is false.

Parameters
i32StartModuleFirst High-Density module to read.
i32EndModuleLast High-Density module to read.
bClearWhen true, clears the latch after being read.
baryOnLatchesArray to store on-latch bitstates.
baryOffLatchesArray to store off-latch bitstates.
i32StartIndexStart index to read and optionally clear.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadPacSBCommunicationBlinkCodeFlag ( out Boolean  bEnabled)

Read the SNAP-PAC-SB communication blink code flag status.

Parameters
bEnabledTrue, feature enabled, false feature disabled.
Returns
Int32 Opto22.OptoMMP3.OptoMMP.ReadPid ( Int32  i32PidIndex,
out stPid  PidData 
)

Read the entire PID.

Under the hood, PIDs are read in blocks of 8 PIDs. Both configuration and data areas are read.

This method does not support the SNAP-PID-V module (a legacy product).

May return a cached value.

Parameters
i32PidIndexIndex of the PID to read. A zero to "one less" number returned by ReadPidQuantity(). Only negative indicies return a fault code.
PidDataThe parsed data reported by the brain.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadPidQuantity ( out Int32  i32PidQuantity)

Report supported PID quantity in the brain.

This value is a constant for each brain/controller and firmware version. This value may only be read on SNAP-PAC-R or SNAP-PAC-EB series brains (not supported in SNAP-PAC-S controllers).

May return a cached value.

Parameters
i32PidQuantityThe quantity of PIDs the brain supports. Only valid when the result code is zero.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadPointName4096 ( Int32  i32PointNumber,
out String  sPointName 
)

Read the Analog or Digital Point Name, using the 4096-point memory model. SNAP-PAC units only.

Parameters
i32PointNumberPoint number to retrieve the point name from.
sPointNamePoint name to store the point name retrieved.
Returns
0 when successful, -1 for error. Note, you may read a blank string "" if the point name is not initialized on the I/O unit.
Int32 Opto22.OptoMMP3.OptoMMP.ReadPointName64 ( Int32  i32PointNumber,
out String  sPointName 
)

Read the Analog or Digital Point Name, using the 64-point memory model. SNAP-PAC and Legacy Ethernet based I/O units that support a point name.

Parameters
i32PointNumberPoint number to retrieve the point name from.
sPointNamePoint name to store the point name retrieved.
Returns
0 when successful, -1 for error. Note, you may read a blank string "" if the point is not initialized on the I/O unit.
Int32 Opto22.OptoMMP3.OptoMMP.ReadPulseOnOffTime ( IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512,
out Single  f32OnTime,
out Single  f32OffTime 
)

Read a "time" configured pulse's on- and off-time values. The pulse must have been configured using ConfigureContinuousPulsesTime() or ConfigureNPulsesTime() or unpredictable results will be reported on f32OnTime and f32Offtime (even with a successful result of this method).

Parameters
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Digital output index.
f32OnTimePulse on-time in seconds.
f32OffTimePulse off-time in seconds.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadPulsePercentage ( IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512,
out Single  f32Percent 
)

Read pulse percentage.

The specified TPO must have been set using ConfigureContinuousPulsesDuration() or ConfigureNPulsesDuration() or the value returned in f32Percent is unpredictable (even when a successful result is returned by the method).

Parameters
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Index for the 64 or 512 point model index for the specific digital output used.
f32PercentCurrent percentage set for the pulse object.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadPulsePeriod ( IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512,
out Single  f32Period 
)

Read the pulse period.

The specified TPO must have been set using ConfigureContinuousPulsesDuration() or ConfigureNPulsesDuration() or the result of this operation is unpredictable.

Parameters
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Index for the 64 or 512 point model index for the specific digital output used.
f32PeriodPulse period in seconds.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadScannerFlags ( out Int32  i32ScannerFlags)

Read the scanner flags of the control engine.

Parameters
i32ScannerFlagsOut parameter when the return value is okay. Bit compressed value of the scanner flags.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

i32Result = Mmp.ReadScannerFlags(out i32ScannerFlags);

Int32 Opto22.OptoMMP3.OptoMMP.ReadSerialModuleConfiguration ( Int32  i32PortNumber,
out Int32  i32TcpPort,
out Int32  i32BaudRate,
out SerialParity  eParity,
out Byte  byDataBits,
out Byte  byStopBits,
out Boolean  bHardwareFlowControl,
out Boolean  bTestMessage,
out Int32  i32Eom,
out Boolean  b4WireMode 
)

Read the Serial (Module) Port Configuration. Only for Module based Serial Ports. Only supported on Ethernet based brains and controllers.

In assembly of 3.0 or later, i32Eom and b4WireMode will correctly report.

Parameters
i32PortNumberSerial port number to read, values 0 through 31. See GetSerialOrSsiPortIndexFromModuleAndChannel().
i32TcpPortTCP/IP Service port this serial port is associated too.
i32BaudRateBaud rate of the serial port.
eParityParity enumeration the port.
byDataBitsNumber of Data Bits.
byStopBitsNumber of Stop Bits.
bHardwareFlowControlHardware Flow Control.
bTestMessagePowerup Test Message.
i32Eom32-bit Value of End-Of-Message.
b4WireModeTwo or Four-Wire Mode (for 485/422 serial modules).
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

i32Result = Mmp2.ReadSerialModuleConfiguration(OptoMMP.GetSerialOrSsiPortIndexFromModuleAndChannel(15,1),
out i32TcpPort, out i32BaudRate, out eParity,
out byDataBits, out byStopBits, out bHardwareFlowcontrol, out bTestMessage,
out i32Eom, out b4WireMode);
if (i32Result < 0)
{
Console.WriteLine("ReadSerialModuleConfiguration failed result {0}", i32Result);
exit;
}

String sOutput = "Port Number " + i32SerialPortIndex.ToString() + "\n" +
"TcpPort " + i32TcpPort.ToString() + "\n" +
"BaudRate " + i32BaudRate.ToString() + "\n" +
"Parity " + eParity.ToString() + "\n" +
"Data Bits " + byDataBits.ToString() + "\n" +
"Stop Bits " + byStopBits.ToString() + "\n" +
"Hardware Flow Control " + bHardwareFlowcontrol.ToString() + "\n" +
"Test Message " + bTestMessage.ToString() + "\n" +
"EOM 0x" + i32Eom.ToString("X08") + "\n" +
"4-wire " + b4WireMode.ToString() + "\n";
Console.WriteLine(sOutput);

Int32 Opto22.OptoMMP3.OptoMMP.ReadSingles ( Int64  i64MmpAddress,
Int32  i32Length,
Single[]  f32arySingles,
Int32  i32StartingIndex 
)

Read a block of Singles from the Opto MMP Device.

There are many areas this toolkit does not support with a method. Use this method to access these areas.

The maximum number of elements that may be transferred is 256.

This method will not return cached values.

Parameters
i64MmpAddressOpto MMP Address.
i32LengthQuantity of Singles to read.
f32arySinglesArray of singles to read.
i32StartingIndexStarting index of f32arySingles to read too.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadSsiModuleConfiguration ( Int32  i32PortNumber,
out Int32  i32FrameSize,
out Single  f32ClockSpeedkHz,
out Single  f32InterFrameTimeUs,
out Int32  i32MsbOffset,
out Int32  i32DataBits,
out Int32  i32ErrorBitOffset,
out Boolean  bErrorBitLowIsError,
out eDataCode  eCoding,
out Boolean  bEnabled 
)

Read the SSI module configuration

This function requires SNAP-PAC firmware R8.5C or later.

Parameters
i32PortNumberThe SSI module port number, values range from 0 to 31. See GetSerialOrSsiPortIndexFromModuleAndChannel().
i32FrameSizeLength of the entire data frame in bits.
f32ClockSpeedkHzFrequency of the transducer (in kHz).
f32InterFrameTimeUsTime between data frames (in microseconds).
i32MsbOffsetLocation of the data MSB in the data frame. Starts from zero.
i32DataBitsLocation of the data bit in the frame. Starts from clock zero.
i32ErrorBitOffsetLocation of the error bit in the frame. Starts from clock zero.
bErrorBitLowIsErrorActive status of the error bit.
eCodingEncoding of the transducer.
bEnabledEnables the brain to scan the SNAP-SCM-SSI module.
Returns
-1 for any error, check extended error status.
Int32 Opto22.OptoMMP3.OptoMMP.ReadSteinhartHart4096 ( Int32  i32PointNumber4096,
out Single  f32CoefA,
out Single  f32CoefB,
out Single  f32CoefC,
out Single  f32CoefSecond 
)

Read the Steinhart-Hart linearization coefficients for the specified input. Requires R9.3e firmware or later.

Uses the following equation:

Temperature (Kelvin) = 1.0 / (f32CoefA + f32CoefB * ln(Ohms) + f32CoefSecond * (ln(Ohms)^2) + f32CoefC * (ln(Ohms)^3))

Parameters
i32PointNumber4096Point index in the 4096 configuration area, values 0 through 4095 Inclusive. GetPointNumberFor4096() may be used.
f32CoefACoefficient A.
f32CoefBCoefficient B.
f32CoefCCoefficient C.
f32CoefSecondSecond order coefficient.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadUints ( Int64  i64MmpAddress,
Int32  i32Length,
UInt32[]  u32aryInts,
Int32  i32StartingIndex 
)

Read a block of unsigned integers (32-bit unsigned values) from the Memory Map

There are many areas this toolkit does not support with a method. Use this method to access these areas.

The maximum number of elements that may be transferred is 256.

This method does not return cached values.

Parameters
i64MmpAddressStarting Opto MMP Address.
i32LengthNumber of 32-bit unsigned integer values to read.
u32aryIntsArray of 32-bit unsigned integers.
i32StartingIndexStarting index of the 32-bit unsigned integer array to store values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadULongs ( Int64  i64MmpAddress,
Int32  i32Length,
UInt64[]  u64aryLongs,
Int32  i32StartingIndex 
)

Read a block of unsigned longs (64-bit unsigned values) from the Opto MMP Device.

There are many areas this toolkit does not support with a direct method. Use this method to access these areas.

The maximum number of elements that may be transferred is 128.

Does not return cached values.

Parameters
i64MmpAddressOpto MMP Address.
i32LengthQuantity of unsigned UInt64s to read.
u64aryLongsArray of unsigned UInt64s to read.
i32StartingIndexStarting index of u64aryLongs to read too.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ReadWatchdogTime ( out Int32  i32WatchdogTimeMs)

Read the Device's Communication Watchdog Timeout

Parameters
i32WatchdogTimeMs[out] The timeout currently set at the IO unit. 0 is disabled.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

// read watchdog time
i32Result = Mmp.ReadWatchdogTime(out i32WatchdogTimeMs);

Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadBitRead ( out Boolean  bState,
Int32  i32Index 
)

Read Scratchpad Bit

May return a cached value.

Parameters
bStateWhen true the bit is on. False, the bit is off.
i32IndexBit index, values 0 to 63.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadBitsRead ( out UInt64  u64ScratchpadBitmask)

Read scratchpad bits as a 64-bit bitmask.

Bit 0 coorelates to bit 0 in the scratchpad bits.

May returned a cached value depending on the data freshness value.

Parameters
u64ScratchpadBitmaskReference to a long, to store the 64 scratchpad bits.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadBitsRead ( Boolean[]  baryScratchpad,
Int32  i32StartIndex 
)

Read Scratchpad Bits Into A Boolean Array

May return a cached value.

Parameters
baryScratchpadArray of booleans to store values. Length must be at least i32StartIndex + 64.
i32StartIndexStarting index to store values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadBitsWrite ( UInt64  u64OnMask,
UInt64  u64OffMask 
)

Writes all 64 scratchpad bit states using turn-on and turn-off bitmasks.

Parameters
u64OnMaskThe states to be forced on. Bit value of 1 turns on, 0 leaves state unaffected.
u64OffMaskThe states to be forced off. Bit value of 1 turns off, 0 leaves state unaffected.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadBitsWrite ( Boolean[]  baryOnStates,
Boolean[]  baryOffStates,
Int32  i32StartIndex 
)

Writes All 64 Scratchpad Bitstates From "Must-On/Must-Off" (MoMo) Boolean Arrays

Parameters
baryOnStatesThe states to be forced on. True turns on, false leaves state unaffected.
baryOffStatesThe states to be forced off. True turns off, false leaves state unaffected.
i32StartIndexStarting index to read states from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadBitWrite ( Boolean  bState,
Int32  i32Index 
)

Write Scratchpad Bit

Parameters
bStateBoolean.
i32IndexBit index, values 0 to 63.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchPadF32NumberofElements ( )

Maximum number of elements in the Float Scratchpad Array.

Returns
Returns the constant number of float elements.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadFloatRead ( Single[]  fary,
Int32  i32StartFaryIndex,
Int32  i32Length,
Int32  i32StartScratchpadStartIndex 
)

Read a block of 32-bit floating point (Single) scratchpad registers.

Reads large blocks of scratchpads by breaking up large requests into multiple 256-element requests.

Only access the contents of fary when this method is completed.

If reading back a write that was recently performed, disable freshness by setting the time to zero before reading back the scratchpad.

In .Net an Opto 22 "float" is a "Single" precision data type.

SNAP-UP1-xxx family of controllers only support indices 0-1023.

May returned a cached value depending on the data freshness.

Parameters
faryFloat array to store the returned data.
i32StartFaryIndexStarting index of the float array to store the data.
i32LengthNumber of continuous floats to read.
i32StartScratchpadStartIndexStarting index of the float scratchpads to read from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadFloatWrite ( Single[]  fary,
Int32  i32StartFaryIndex,
Int32  i32Length,
Int32  i32StartScratchpadStartIndex 
)

Write a block of float scratchpad registers.

In .Net an Opto 22 "32-bit float" is a "Single" precision data type.

Not cachable.

SNAP-UP1-xxx family of controllers only support indices 0-1023.

Parameters
faryArray of float values to write.
i32StartFaryIndexStart index of the float aray.
i32LengthNumber of float elements to write.
i32StartScratchpadStartIndexStarting float scratchpad element to write too.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchPadI32NumberofElements ( )

Maximum number of elements in the 32-bit Integer Scratchpad Array.

Returns
Returns the constant number of 32-bit Integer elements for a SNAP-PAC Ethernet brain/controller.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadI32Read ( Int32[]  i32ary,
Int32  i32StartIaryIndex,
Int32  i32Length,
Int32  i32StartScratchpadStartIndex 
)

Read a block of 32-bit signed-integer scratchpad registers.

Reads large blocks of scratchpads by breaking up large requests into multiple 256-element requests.

Only access the contents of i32ary when this method is completed.

If reading back a write that was recently performed, disable freshness by setting the time to zero before reading back the scratchpad.

SNAP-UP1-xxx family of controllers only support indices 0-1023.

May returned a cached value depending on the data freshness.

Parameters
i32ary32-bit integer array to store the returned data.
i32StartIaryIndexStarting index of the float array to store the data.
i32LengthNumber of continuous floats to read.
i32StartScratchpadStartIndexStarting index of the float scratchpads to read from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadI32Write ( Int32[]  i32ary,
Int32  i32StartIaryIndex,
Int32  i32Length,
Int32  i32StartScratchpadStartIndex 
)

Write a block of 32-bit signed-integer scratchpad registers.

Divides the writes of up to 256 elements to satisfy the transfer.

Not cachable.

SNAP-UP1-xxx family of controllers only support indices 0-1023.

Parameters
i32aryArray of 32-bit integer values to write.
i32StartIaryIndexStart index of the 32-bit integer array.
i32LengthNumber of float elements to write.
i32StartScratchpadStartIndexStarting 32-bit integer scratchpad element to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchPadI64NumberofElements ( )

Maximum number of elements in the 64-bit Integer Scratchpad Array.

Returns
Returns the constant number of 64-bit Integer elements.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadI64Read ( Int64[]  i64ary,
Int32  i32StartIaryIndex,
Int32  i32Length,
Int32  i32StartScratchpadStartIndex 
)

Read the 64-bit signed-integer (Int64) scratchpad registers

Internally, this method reads 64-bit integers in 128 element blocks.

May returned a cached value depending on the data freshness.

Parameters
i64aryArray to store read values.
i32StartIaryIndexStarting index in i64ary to store values.
i32LengthLength of the read request.
i32StartScratchpadStartIndexFirst element of the scratchpad array to start reading from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadI64Write ( Int64[]  i64ary,
Int32  i32StartIaryIndex,
Int32  i32Length,
Int32  i32StartScratchpadStartIndex 
)

Write a block of 64-bit signed integer scratchpad registers.

Writes longer than 128 elements are divided into 128 maximum element sized writes.

Not cachable.

Parameters
i64aryArray of 64-bit integer values to write.
i32StartIaryIndexStart index of the 64-bit integer array.
i32LengthNumber of float elements to write.
i32StartScratchpadStartIndexStarting 64-bit integer scratchpad element to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchPadStringNumberofElements ( )

Maximum number of elements in the String Scratchpad Array.

Returns
Returns the constant number of String Scratchpad elements.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadStringRead ( String[]  strary,
Int32  i32StartStraryIndex,
Int32  i32Length,
Int32  i32StartScratchpadStartIndex 
)

Read the string scratchpad registers.

Internally, this method reads strings in 8 string-element chunks.

May returned a cached value depending on the data freshness.

String scratchpads are intended for only ASCII based strings.

A correction to this method was made on 10-14-2011. Problems arose with 9.x firmware or later and if less than 64 scratchpad strings were read.

Parameters
straryArray of strings to read.
i32StartStraryIndexStarting index in string to store values.
i32LengthLength of the read request.
i32StartScratchpadStartIndexFirst element of the scratchpad array to start reading from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.ScratchpadStringWrite ( String[]  strary,
Int32  i32StartStraryIndex,
Int32  i32Length,
Int32  i32StartScratchpadStartIndex 
)

Write a block of string scratchpad registers.

Writes longer than 4 elements are divided into 4-element chunks.

String scratchpads are intended for only ASCII based strings.

Parameters
straryArray of strings to write.
i32StartStraryIndexStart index of the string array.
i32LengthNumber of strings elements to write.
i32StartScratchpadStartIndexStarting string scratchpad element to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
static UInt32 Opto22.OptoMMP3.OptoMMP.SingleToUInt32 ( Single  f32Data)
static

Converts a UInt32 (in binary form as a single) to a single.

Parameters
f32DataSingle data to convert.
Returns
Data converted to a UInt32 (unsigned 32-bit integer) from a Single.
Int32 Opto22.OptoMMP3.OptoMMP.StartPulse ( IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512 
)

Start a pulse train.

Parameters
eIoModelOfPointIndexSpecifies the point index of the model.
i32PointIndex64or512Poing index number for either the 64 or 512 point model.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.StopPulse ( IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512,
Boolean  bTurnOn 
)

Stop a pulse. Note, writing a digital point state cancels an operating pulse.

Parameters
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Poing index number for either the 64 or 512 point model.
bTurnOnWhen true, terminates the pulse and leave the output on. False terminates the pulse and leaves the output off.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
static Single Opto22.OptoMMP3.OptoMMP.UInt32ToSingle ( UInt32  u32Data)
static

Converts a Single (in binary form) to a UInt32.

Parameters
u32DataUInt32 data to convert to single.
Returns
Data converted into a Single (float) type.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogEu512 ( Int32  i32Point,
Single  f32Value 
)

Write an analog output in the 512-Point IO Unit model.

If you would like to write all analog outputs at once, use the WriteAnalogEu64 method.

Parameters
i32PointThe point number, range 0 to 511.
f32ValueThe value to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogLoadCellConfiguration4096 ( Int32  i32PointNumber,
UInt32  u32FastSettle,
UInt32  u32FilterWeight 
)

Write analog load cell configuration in 4,096 point area.

This just sets a load-cell module's fast-settle and filter weight parameters.

While this is a configuration function, the data lies within the analog point write area (kind of unusual).

Parameters
i32PointNumberPoint Number, 0 to 511.
u32FastSettleLoad cell input fast settle value. See form 1465 for values. Library does not check for invalid values.
u32FilterWeightFilter weight value. See form 1465 for values. Library does not check for invalid values.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogLoadCellConfiguration64 ( Int32  i32PointNumber,
UInt32  u32FastSettle,
UInt32  u32FilterWeight 
)

Write analog load cell configuration in 64 Point Area.

Configures the analog load cell's parameters (fast-settle and filter weight).

While this is a configuration function, the data lies within the analog point write area (kind of unusual).

Parameters
i32PointNumberThe 64-point rack's number, from 0 to 63.
u32FastSettleThe fast settle parameter, see form 1465 for values (this value is not checked by this library).
u32FilterWeightThe filter weight setting, see form 1465 for values (value is not check by this library).
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogPointConfiguration4096 ( Int32  i32PointNumber,
Int32  i32PointType,
Single  f32HighScale,
Single  f32LowScale,
Single  f32Offset,
Single  f32Gain,
Single  f32FilterWeight,
Boolean  bEnableWatchdog,
Single  f32WatchdogValue,
String  sPointName,
Single  f32LowerClamp,
Single  f32UpperClamp 
)

Write Analog Point configuration in 4,096 Point Area.

This area must be configured before points may be read in the 512-point area.

Useful for setting all configuration values of an analog point (input or output).

Parameters
i32PointNumberPoint Number, 0 to 511.
i32PointTypeThe point type.
f32HighScaleUpper Scale Value (when input is 100%).
f32LowScaleLower Scale Value (when input is either 0% [unipolar] or -100% [bipolar]).
f32OffsetOffset.
f32GainGain.
f32FilterWeightFilter Weight (0.0 disables or positive values).
bEnableWatchdogEnable analog communication watchdog.
f32WatchdogValueThe value to force whhen communication watchdog occurs.
sPointNameName of the point. Maximum 50 characters. Additional characters will be truncated.
f32LowerClampLower analog clamp value.
f32UpperClampUpper analog clamp value.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogPointConfiguration4096 ( Int32  i32PointNumber4096,
Int32  i32PointType,
Single  f32HighScale,
Single  f32LowScale,
Single  f32FilterWeight,
Boolean  bEnableWatchdog,
Single  f32WatchdogValue,
String  sPointName,
Single  f32LowerClamp,
Single  f32UpperClamp 
)

Write Analog Point configuration in 4,096 Point Area. Useful when offset and gain parameters are not required.

This area must be configured before points may be read in the 512-point area.

Caution, prior set parameters such as offset and gain are not modified with this command.

Parameters
i32PointNumber4096Point Number, 0 to 511.
i32PointTypeThe point type.
f32HighScaleUpper Scale Value (when input is 100%).
f32LowScaleLower Scale Value (when input is either 0% [unipolar] or -100% [bipolar]).
f32FilterWeightFilter Weight (0.0 disables or positive values).
bEnableWatchdogEnable analog communication watchdog.
f32WatchdogValueThe value to force whhen communication watchdog occurs.
sPointNameName of the point. Maximum 50 characters. Additional characters will be truncated.
f32LowerClampLower analog clamp value.
f32UpperClampUpper analog clamp value.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogPointConfiguration4096 ( Int32  i32PointNumber4096,
Int32  i32PointType,
Single  f32FilterWeight,
Boolean  bEnableWatchdog,
Single  f32WatchdogValue,
String  sPointName,
Single  f32LowerClamp,
Single  f32UpperClamp 
)

Write Analog Point configuration in 4,096 Point Area. Useful for thermocouple and RTD probes or analog input ranges.

This area must be configured before points may be properly read.

Caution, prior set parameters such as analog point feature, offset, gain, high-scale and low-scale are not modified with this command.

Parameters
i32PointNumber4096Point Number, 0 to 511.
i32PointTypeThe point type.
f32FilterWeightFilter Weight (0.0 disables or positive values).
bEnableWatchdogEnable analog communication watchdog.
f32WatchdogValueThe value to force whhen communication watchdog occurs.
sPointNameName of the point. Maximum 50 characters. Additional characters will be truncated.
f32LowerClampLower analog clamp value.
f32UpperClampUpper analog clamp value.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogPointConfiguration4096 ( Int32  i32PointNumber4096,
Int32  i32PointType,
String  sPointName 
)

Write Analog Point configuration in 4,096 Point Area. Useful for RTDs and thermocouple modules, to just set the "probe" type or analog input ranges.

This area must be configured before points may be properly read in the 512-point or 4096-point areas.

Caution, prior set parameters such as analog point feature, offset, gain, high-scale, low-scale, filter weight, watchdog value, watchdog enabled, upper clamp and lower clamp are not modified with this command.

Parameters
i32PointNumber4096Point Number, 0 to 4095. May use GetPointNumberFor4096() to help.
i32PointTypeThe point type.
sPointNameName of the point. Maximum 50 characters. Additional characters will be truncated.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogPointConfiguration4096 ( Int32  i32PointNumber,
Int32  i32PointType 
)

Write Point configuration in 4,096 Point Area. Useful for setting probe types such as thermocouples and RTDs. Will also set the analog input ranges for voltage input modules.

This area must be configured before points may be properly read.

Useful for setting the point's type such as setting a linearized thermocouple's probe type, a digital input or output, or setting an analog input to a specific input range and want to read the input as measurement units (volts, amps, etc).

Due to the large variety of point type values that overlap, an enumeration is not available. Please see Opto 22 Form 1465 for point type specific information.

Caution, prior set parameters such as analog point feature, offset, gain, high-scale, low-scale, filter weight, watchdog value, watchdog enable, point name, upper clamp and lower clamp are not modified with this command.

Parameters
i32PointNumberPoint Number, 0 to 4095.
i32PointTypeThe point type.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

// set a J thermocouple for a SNAP-AITM-8 in position 5, channel #7 (starting from zero).
i32Result = Mmp.WriteAnalogPointConfiguration4096(OptoMMP.GetPointNumberFor4096(5, 7), 5);

Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogPointConfiguration64 ( Int32  i32PointNumber,
Int32  i32PointType,
Single  f32HighScale,
Single  f32LowScale,
Single  f32Offset,
Single  f32Gain,
Single  f32FilterWeight,
Boolean  bEnableWatchdog,
Single  f32WatchdogValue,
String  sPointName 
)

Write Analog Point configuration in 64 Point Area.

configures all the basic analog point configuration values.

[KB 84529] Fixed exception fault in assembly version 3.0.0.x.

Parameters
i32PointNumberPoint Number, 0 to 63.
i32PointTypeThe point type.
f32HighScaleUpper Scale Value (when input is 100%).
f32LowScaleLower Scale Value (when input is either 0% [unipolar] or -100% [bipolar]).
f32OffsetOffset.
f32GainGain.
f32FilterWeightFilter Weight (0.0 disables or positive values).
bEnableWatchdogEnable analog communication watchdog.
f32WatchdogValueThe value to force whhen communication watchdog occurs.
sPointNamePoint name, 15 characters maximum, additional length is truncated.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogState4096 ( Int32  i32Point4096Number,
AnalogWriteOptions  eOption,
Single  f32WriteValue 
)

Sets a single analog state in engineering units, Counts or TPO values in the 4096-point IO unit memory map.

[KB 84543] This method is deprecated. Use WriteAnalogState4096v2() instead.

Parameters
i32Point4096NumberThe point number to write, 0 to 4095.
eOptionThe enumeration of the value option to be written.
f32WriteValueThe value to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogState4096v2 ( Int32  i32Point4096Number,
AnalogWriteOptions4096  eOption,
Single  f32WriteValue 
)

Sets a single analog state in engineering units, Counts or TPO values in the 4096-point IO unit memory map.

This method does not cache values.

[KB 84542] Method added to support new enumeration.

Parameters
i32Point4096NumberThe point number to write, 0 to 4095.
eOptionThe enumeration of the value option to be written.
f32WriteValueThe value to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogState64 ( Int32  i32PointNumber,
AnalogWriteOptions  eOption,
Single  fWriteValue 
)

Sets a Single Analog State in Engineering Units, Counts or TPO in the 64-Point IO Unit Memory Map.

This method does not cache values.

Parameters
i32PointNumberThe point number to write, 0 to 63.
eOptionThe enumeration of the value option to be written.
fWriteValueThe value to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteAnalogStates64 ( Single[]  f32aryValues,
Boolean  bEngineeringUnits,
Int32  i32StartIndex 
)

Set analog outputs in engineering units or counts as a 64-point bank write.

Parameters
f32aryValuesArray storing values to write. Must contain at least i32StartIndex + 64 elements in length.
bEngineeringUnitsWhen true writes engineering units. False writes counts (typically 0 to 4095).
i32StartIndexStarting index in the array to write values from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteBrainStreamingConfiguration ( Int32  i32IntervalMs,
Int32  i32UdpPortDestination,
String[]  saryIpAddresses,
UInt32  u32OptoMMPAddress,
Int32  i32LengthOfStream 
)

Configure the brain streaming functionality.

Once successfully using this method, you must use EnableBrainStreaming() to enable streaming. This method does not automatically enable streaming>

This function will disable streaming if it is enabled.

This function disables mirroring. If you want mirroring, use PAC Manager to configure the brain instead.

Parameters
i32IntervalMsInterval in milliseconds to stream.
i32UdpPortDestinationUDP Client port to use.
saryIpAddressesArray of IP addresses (in dot format) to stream too. Ensure the IP Addresses are packed from low to high indexes. When the device enounters a zero IP address, it will stop transmitting to any more IP addresses.
u32OptoMMPAddressIf not default, the OptoMMP address to use.
i32LengthOfStreamLength of the non-default OptoMMP area to use.
Returns
0 for successful, negative for error, check with LogErrorInformation().

Int32 i32IntervalMs = 500;
Int32 i32MyPcUdpPortReceivePort = 5001;
String[] saryIpAddresses = {sMyPcIpAddress};
Int64 i64OptoMMPAddress = 0;
Int32 i32LengthOfStream = 0;

i32Result = Mmp.WriteBrainStreamingConfiguration(i32IntervalMs, i32MyPcUdpPortReceivePort, saryIpAddresses, i64OptoMMPAddress, i32LengthOfStream);
if (i32Result < 0)
{
Console.WriteLine("Configuring stream on device failed");
}

Int32 Opto22.OptoMMP3.OptoMMP.WriteCustomConfiguration ( Int32  i32StartIndex,
Int32  i32Length,
UInt32[]  u32aryCustomAddresses,
Int32  i32ArrayStartIndex 
)

Write custom configuration addresses to the OptoMMP "custom area."

Parameters
i32StartIndexStarting index in the custom area, values 0 through 1023.
i32LengthLength of data to write.
u32aryCustomAddressesAddresses to write to the device.
i32ArrayStartIndexStarting index in the
Returns
0 when successful, less than zero, for error.
Int32 Opto22.OptoMMP3.OptoMMP.WriteCustomData ( Int32  i32StartIndex,
Int32  i32Length,
UInt32[]  u32aryData,
Int32  i32ArrayStartIndex 
)

Write data to the custom area.

Parameters
i32StartIndexStart index in the custom area. Valid values from 0 to 1023.
i32LengthLength of data (32-bit values) to write.
u32aryDataArray of data to write.
i32ArrayStartIndexStart index in the data array to write.
Returns
0 when successful, less than zero, for error.
Int32 Opto22.OptoMMP3.OptoMMP.WriteDateTime ( String  sDateTime)

Write the Date-Time String to the IO Unit.

The string format must be in this form, 'YYYY-MM-DD HH:MM:SS.00'.

Parameters
sDateTimeString with the date time to set.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

String sForceTime = "2009-12-08 12:01:01.00";
i32Result = Mmp.WriteDateTime(sForceTime);

Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalEnableorDisableCounter64 ( Int32  i32PointNumber,
Boolean  bActivate 
)

Enable or disable a digital counter, 64-point rack.

This method does not cache data.

This method only works with the 64-point I/O unit properties.

Parameters
i32PointNumberThe point number, 0 through 63.
bActivateWhen true, activates the counter.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalEnableorDisableCounters64 ( Int64  i64ActivateBitMask,
Int64  i64DeactivateBitMask 
)

Enable or disable a bank of counters in the 64-point rack.

This method does not cache data.

Warning. Enabling or disabling a counter at the same time has unpredictable results.

This method only works with the 64-point I/O unit properties.

Parameters
i64ActivateBitMaskBitmask to enable a counter. A bit value of one enables a counter.
i64DeactivateBitMaskBitmask to disable a counter. A bit value of one disables a counter.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalEnableorDisableCounters64 ( Boolean[]  baryActivate,
Boolean[]  baryDeactivate,
Int32  i32StartIndex 
)

Enable or Disable All 64 Digital Counters From Boolean Arrays

Parameters
baryActivateBoolean array to activate counters, length must be at least i32StartIndex + 64.
baryDeactivateBoolean array to deactivate counters, length must be at least i32StartIndex + 64.
i32StartIndexStarting index to retrieve states from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalPointConfiguration4096 ( Int32  i32PointNumber,
Boolean  bOutput,
eDigitalFeature  eFeature,
Boolean  bEnableWatchdog,
Boolean  bWatchdogValue,
String  sPointName 
)

Write the digital point configuration (4096 points).

Parameters
i32PointNumberPoint Number 0 to 4095.
bOutputFor digital outputs, set true.
eFeatureDigital Feature To Set. If no feature, select None.
bEnableWatchdogEnable the communication watchdog.
bWatchdogValueThe state when the communication watchdog trigges, true is "on".
sPointNamePoint name. Up to 50 characters in length. Additional length is truncated.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalPointConfiguration64 ( Int32  i32PointNumber,
Boolean  bOutput,
eDigitalFeature  eFeature,
Boolean  bEnableWatchdog,
Boolean  bWatchdogValue,
String  sPointName 
)

Write the digital point configuration.

Parameters
i32PointNumberPoint Number 0 to 63.
bOutputFor digital outputs, set true.
eFeatureDigital Feature To Set. If no feature, select None.
bEnableWatchdogEnable the communication watchdog.
bWatchdogValueThe state when the communication watchdog trigges, true is "on".
sPointNamePoint name. Up to 15 characters in length. Additional length is truncated.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

// configure a digital point as input, with no digital features with a point name of "diPoint_00_00".
i32Result = Mmp.WriteDigitalPointConfiguration64(OptoMMP.GetPointNumberFor64(0, 0), false, OptoMMP.eDigitalFeature.None, false, false, "diPoint_00_00");

Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalState64 ( Int32  i32PointNumber,
Boolean  bOn 
)

Set a single state of a 4-channel digital output, 64-point rack.

This method does not cache data.

The digital output must be configured before the output will turn on.

This method only works with the 64-point I/O unit properties.

Parameters
i32PointNumberDigital point number to set, 0 through 63.
bOnTrue, turns the output on, false turns the output off.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalStates64 ( Int64  i64StateBitMask)

Sets all of the 4-channel digital states in the 64-point rack.

The digital output must be configured before the output will turn on.

This method only works with the 64-point I/O unit properties.

Parameters
i64StateBitMask64-bit bitmask of states, a bit value of 1 is on, 0 is off.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalStates64 ( Boolean[]  baryStates,
Int32  i32StartIndex 
)

Write All 64 Digital States Using A Boolean Array.

The boolean array arguments must be at least i32StartIndex + 64 in length.

Parameters
baryStatesArray of states, true is on, false is off.
i32StartIndexStarting index of the array to begin using states.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalStatesMoMo64 ( Int64  i64OnMask,
Int64  i64OffMask 
)

Writes All 64 Digital States From "Must-On/Must-Off" (MoMo) Bit Masks

Parameters
i64OnMaskThe points to be forced on. Bit value of 1 turns on, 0 leaves point state unaffected.
i64OffMaskThe points to be forced off. Bit value of 1 turns off, 0 leaves point state unaffected.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteDigitalStatesMoMo64 ( Boolean[]  baryOnStates,
Boolean[]  baryOffStates,
Int32  i32StartIndex 
)

Writes All 64 Digital States From "Must-On/Must-Off" (MoMo) Boolean Arrays

Parameters
baryOnStatesThe points to be forced on. True turns on, false leaves point state unaffected.
baryOffStatesThe points to be forced off. True turns off, false leaves point state unaffected.
i32StartIndexStarting index to read states from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteFOrCStatus ( Boolean  bIsFahrenheit)

Force Brain to Report Temperature as Celsius or Fahrenheit

Temperature values should not be read within 1 to 3 seconds of this method. Reading too early may report the wrong temperature value. If you have an application that has to change temperature scale often or requires different temperature scale, do not constantly use this method due to update latency. Consider reading the temperature values in a constant setting and performing the conversions in your application.

Parameters
bIsFahrenheitTrue sets the brain to report Fahrenheit, False, Celsius.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

// set temperature mode to Celsius
i32Result = Mmp.WriteFOrCStatus(false);

Int32 Opto22.OptoMMP3.OptoMMP.WriteHighDensityDigitalModule ( Int32  i32Module,
Boolean[]  baryOnState,
Boolean[]  baryOffState 
)

Update High-Density Digital States of a Single Module Using Boolean Arrays.

Parameters
i32ModuleModule number (index) on rack. Values from 0 to 15.
baryOnStateArray of "on" states to write. True turns on. Array index 0 cooresponds to point 0. Array length must be at least 64 elements.
baryOffStateArray of "off" states to write. True turns off. Array index 0 cooresponds to point 0. Array length must be at least 64 elements.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteHighDensityDigitalModule ( Int32  i32Module,
UInt64  u64OnStateMask,
UInt64  u64OffStateMask 
)

Update High-Density Digital States of a Single Module Using UInt64 Bitmasks.

Parameters
i32ModuleModule number (index) on rack. Values from 0 to 15.
u64OnStateMaskBitmask of "on" states to write. True turns on. Bit 0 cooresponds to point 0.
u64OffStateMaskBitmask of "off" states to write. True turns off. Bit 0 cooresponds to point 0.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteHighDensityDigitalState ( Int32  i32Module,
Int32  i32Point,
Boolean  bState 
)

Write An Individual High-Density Digital State

Parameters
i32ModuleModule number (index) on rack. Values from 0 to 15.
i32PointPoint index. Values from 0 to 63. At the time of this SDK publication, high density modules contain up to 32 points.
bStateDiscrete state to write. True turns on, false turns off. All other points of the module are unaffected.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteHighDensityDigitalStates ( Int32  i32StartModule,
Int32  i32EndModule,
Boolean[]  baryStates,
Int32  i32StartIndex 
)

Write High-Density Digital States, Module by Module Using A Boolean Array

Parameters
i32StartModuleStarting module number, values 0 through 15.
i32EndModuleLast module to write, values 0 through 15 (must be equal or higher to i32StartModule).
baryStatesArray of boolean states. Needs to be (i32EndModule - i32StartModule + 1) * 32 + i32ArrayStartIndex in length.
i32StartIndexStarting index in the boolean array retrieve states to be written.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteHighDensityDigitalStates ( Int32  i32StartModule,
Int32  i32EndModule,
Int32[]  i32aryStates,
Int32  i32StartIndex 
)

Write High-Density Digital States, Module by Module Using A Bitmask Array

Parameters
i32StartModuleStarting module number, values 0 through 15.
i32EndModuleLast module to write, values 0 through 15 (must be equal or higher to i32StartModule).
i32aryStatesArray of integer bit states. Needs to be (i32EndModule - i32StartModule + 1) + i32StartIndex in length.
i32StartIndexStarting index in the boolean array retrieve states to be written.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteInts ( Int64  i64MmpAddress,
Int32  i32Length,
Int32[]  i32aryInts,
Int32  i32StartingIndex 
)

Write a block of 32-bit integers to a specific Opto MMP Address.

There are many areas this toolkit does not support with a method. Use this method to access these areas.

The maximum number of elements that may be transferred is 256.

Parameters
i64MmpAddressStarting Opto MMP Address.
i32LengthLength of 32-bit integers to write.
i32aryIntsArray of 32-bit integers.
i32StartingIndexStarting index of the i32aryInts table to write from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteLocalDateTime ( )

Write Local Date-Time To The IO Unit.

The PC's local date-time will be written to the I/O unit.

Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

// write the local date time to device
i32Result = Mmp.WriteLocalDateTime();

Int32 Opto22.OptoMMP3.OptoMMP.WriteLongs ( Int64  i64MmpAddress,
Int32  i32Length,
Int64[]  i64aryLongs,
Int32  i32StartingIndex 
)

Write a block of longs (64-bit signed values) to the Opto MMP Device.

There are many areas this toolkit does not support with a method. Use this method to access these areas.

The maximum number of elements that may be transferred is 128 64-bit values.

Parameters
i64MmpAddressOpto MMP Address.
i32LengthQuantity of longs to write.
i64aryLongsArray of longs to write.
i32StartingIndexStarting index of i64aryLongs to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WritePacSBCommunicationBlinkCodeFlag ( Boolean  bEnable)

Enable/Disable SNAP-PAC-SB communication blink code. This method enables a feature on the SNAP-PAC-SB to red blink the STAT indicator when a detected message exception occurs.

Blink Code (2) Received packet CRC error. Blink Code (3) Undefined packet type. Blink Code (4) Malformed packet.

Parameters
bEnableTrue, enables feature, false disables feature.
Returns
Int32 Opto22.OptoMMP3.OptoMMP.WritePid ( Int32  i32PidIndex,
stPid  PidData,
ePidWriteOptions  eWriteOption 
)

Write Pid (configure all or individual parameters [one at a time] of a PID)

This method does not support the SNAP-PID-V (a legacy product).

Parameters
i32PidIndexThe index of the PID.
PidDataThe data to modify the PID with.
eWriteOptionThe selected write to perform.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WritePointConfiguration64 ( Int32  i32PointNumber,
Int32  i32PointType 
)

Write/Modify Analog Point configuration or Digital Feature in 64 Point Area.

Sets only the point area. This is useful for setting just the point types, like when reading linearized thermocouples (scaling not required), an alternate input range on an analog input, or setting a 4-channel digital point as an input or output (no features needed).

Parameters
i32PointNumberPoint Number, 0 to 63.
i32PointTypeThe point type.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WritePointName4096 ( Int32  i32PointNumber,
String  sPointName 
)

Write the Analog or Digital Point Name, using the 4096-point memory model. SNAP-PAC units only.

Parameters
i32PointNumberPoint number to write the point name to. Values 0 through 63 inclusive, are valid.
sPointNamePoint name to write, 50 characters maximum. Name will be truncated if longer.
Returns
0 when successful, -1 for errort.
Int32 Opto22.OptoMMP3.OptoMMP.WritePointName64 ( Int32  i32PointNumber,
String  sPointName 
)

Write the Analog or Digital Point Name, using the 64-point memory model. SNAP-PAC and Legacy Ethernet based I/O units that support a point name.

Parameters
i32PointNumberPoint number to write the point name to. Values 0 through 63 inclusive, are valid.
sPointNamePoint name to write, 15 characters maximum. Name will be truncated if longer.
Returns
0 when successful, -1 for errort.
Int32 Opto22.OptoMMP3.OptoMMP.WritePulseOnOffTime ( IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512,
Single  f32OnTime,
Single  f32OffTime 
)

Update a "time" configured pulse's on-time and off-time. Pulse must have been configured with either ConfigureContinuousPulsesTime() or ConfigureNPulsesTime() or unpredictable results will occur (even with a valid method result code).

Parameters
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Digital output index.
f32OnTimeNew on-time value in seconds.
f32OffTimeNew off-time value in seconds.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WritePulsePercentage ( IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512,
Single  f32Percent 
)

Write pulse percentage. Useful for continuous pulse trains... for example, time-proprotional outputs (e.g. heater applications).

Values less than 0.0 are treated as zero. Values above 100.0 are treated as 100.0.

The specified TPO must have been set using ConfigureContinuousPulsesDuration() or ConfigureNPulsesDuration(). Otherwise, the result of f32Percent is unpredictable even with a successful result code.

Parameters
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Index for the 64 or 512 point model index for the specific digital output used.
f32PercentPercentage to set the continuous pulse train.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WritePulsePeriod ( IoModel  eIoModelOfPointIndex,
Int32  i32PointIndex64or512,
Single  f32Period 
)

Write the pulse period.

The specified TPO must have been set using ConfigureContinuousPulsesDuration() or ConfigureNPulsesDuration() or the result of this operation is unpredictable.

Parameters
eIoModelOfPointIndexSpecifies the which model (64- or 512-point) the point index represents.
i32PointIndex64or512Index for the 64 or 512 point model index for the specific digital output used.
f32PeriodPulse period in seconds.
Returns
0 is successful, negative values are faults. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteScannerFlags ( Int32  i32ScannerFlags)

Write the scanner flags to the OptoMMP device.

These parameters must be stored to flash. The device should also be rebooted for the flags to take effect.

Parameters
i32ScannerFlagsBit packed array to write to location.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

i32Result = Mmp.WriteScannerFlags(0x0007);

Int32 Opto22.OptoMMP3.OptoMMP.WriteSerialModuleConfiguration ( Int32  i32PortNumber,
Int32  i32TcpPort,
Int32  i32BaudRate,
SerialParity  eParity,
Byte  byDataBits,
Byte  byStopBits,
Boolean  bHardwareFlowControl,
Boolean  bTestMessage,
Int32  i32Eom,
Boolean  b4WireMode 
)

Write the Serial Port Configuration. Only for Module based Serial Ports. Only supported on Ethernet based brains and controllers.

Parameters
i32PortNumberSerial port number to write too, values 0 through 31. See GetSerialOrSsiPortIndexFromModuleAndChannel().
i32TcpPortTCP/IP Service port this serial port is associated too. This is a read-only parameter at the I/O unit.
i32BaudRateBaud rate of the serial port.
eParityParity enumeration the port.
byDataBitsNumber of Data Bits.
byStopBitsNumber of Stop Bits.
bHardwareFlowControlHardware Flow Control.
bTestMessagePowerup Test Message.
i32Eom32-bit Value of End-Of-Message.
b4WireModeTwo or Four-Wire Mode (for 485/422 serial modules).

Int32 i32PortNumber = OptoMMP.GetSerialOrSsiPortIndexFromModuleAndChannel(15,1);
Int32 i32TcpPort = 22530;
Int32 i32BaudRate = 115200;
OptoMMP.SerialParity eParity = OptoMMP.SerialParity.None;
Byte byDataBits = 8;
Byte byStopBits = 1;
Boolean bHardwareFlowcontrol = true;
Boolean bTestMessage = false;
Int32 i32Eom = 0x01020304;
Boolean b4WireMode = true;

i32Result = Mmp2.WriteSerialModuleConfiguration(i32PortNumber, i32TcpPort, i32BaudRate, eParity,
byDataBits, byStopBits, bHardwareFlowcontrol, bTestMessage,
i32Eom, b4WireMode);

Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteSingles ( Int64  i64MmpAddress,
Int32  i32Length,
Single[]  f32arySingles,
Int32  i32StartingIndex 
)

Write a block of Singles to the Opto MMP Device.

There are many areas this toolkit does not support with a method. Use this method to access these areas.

The maximum number of elements that may be transferred is 256.

Parameters
i64MmpAddressOpto MMP Address.
i32LengthQuantity of Singles to write.
f32arySinglesArray of singles to write.
i32StartingIndexStarting index of f32arySingles to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteSsiModuleConfiguration ( Int32  i32PortNumber,
Int32  i32FrameSize,
Single  f32ClockSpeedkHz,
float  f32InterFrameTimeUs,
Int32  i32MsbOffset,
Int32  i32DataBits,
Int32  i32ErrorBitOffset,
Boolean  bErrorBitLowIsError,
eDataCode  eCoding,
Boolean  bEnabled 
)

Writes the SSI Module configuration

This function requires SNAP-PAC firmware R8.5C or later.

Parameters
i32PortNumberThe SSI module port number, values range from 0 to 31. See GetSerialOrSsiPortIndexFromModuleAndChannel().
i32FrameSizeLength of the entire data frame in bits.
f32ClockSpeedkHzFrequency of the transducer (in kHz).
f32InterFrameTimeUsTime between data frames (in microseconds).
i32MsbOffsetLocation of the data MSB in the data frame. Starts from zero.
i32DataBitsLocation of the data bit in the frame. Starts from clock zero.
i32ErrorBitOffsetLocation of the error bit in the frame. Starts from clock zero.
bErrorBitLowIsErrorActive status of the error bit.
eCodingEncoding of the transducer.
bEnabledEnables the brain to scan the SNAP-SCM-SSI module.
Returns
-1 for any error, check extended error status.
Int32 Opto22.OptoMMP3.OptoMMP.WriteStatusCommand ( StatusWriteCommand  eCommand)

Writes a Status Command to Opto MMP Address 0xffff f038 0000 (see Opto 22 Form 1465, Section "Status Area Write - Read/Write") Should a different command be needed that is not in the StatusWriteCommand enumeration, directly write the numeric value to 0xffff f038 0000.

When using enumerations ResetHardware or ResetToDefaults, the device will physically reboot. If you are using a TCPIP connection, the connection will be severed, close this session after this method returns. Depending on the network connection, the network link and device may not be available to reconnect for as much as 30 seconds.

Using enumerations that cause the device to reboot may cause this error to appear in the Windows Application Event Queue. 'Timeout, no data was received. Either the remote host didn't receive the request or a packet was dropped. Issuing a command to reset to defaults and reboot or reboot device may cause this message to occur.' This is expected behavior.

Some commands like StoreToFlash and EraseFlash will take up to 5 seconds to complete. Update the timeout accordingly.

Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

// erase the stored device configuration and reset device
Mmp.WriteStatusCommand(OptoMMP.StatusWriteCommand.ResetToDefaults);

Int32 Opto22.OptoMMP3.OptoMMP.WriteSteinhartHart4096 ( Int32  i32PointNumber4096,
Single  f32CoefA,
Single  f32CoefB,
Single  f32CoefC,
Single  f32CoefSecond 
)

Write Steinhart-Hart linearization coefficients to the specified point. Requires R9.3e firmware or later.

Uses the following equation:

Temperature (Kelvin) = 1.0 / (f32CoefA + f32CoefB * ln(Ohms) + f32CoefSecond * (ln(Ohms)^2) + f32CoefC * (ln(Ohms)^3))

Parameters
i32PointNumber4096Point index in the 4096 configuration area, values 0 through 4095 Inclusive. GetPointNumberFor4096() may be used.
f32CoefACoefficient A.
f32CoefBCoefficient B.
f32CoefCCoefficient C. If not specified or unknown, use 0.0.
f32CoefSecondSecond order coefficient. If not specified or unknown, use 0.0.
Returns
Int32 Opto22.OptoMMP3.OptoMMP.WriteUints ( Int64  i64MmpAddress,
Int32  i32Length,
UInt32[]  u32aryInts,
Int32  i32StartingIndex 
)

Write a block of 32-bit unsigned integers to a specific Opto MMP Address.

There are many areas this toolkit does not support with a method. Use this method to access these areas.

The maximum number of elements that may be transferred is 256.

Parameters
i64MmpAddressStarting Opto MMP Address.
i32LengthLength of 32-bit unsigned integers to write.
u32aryIntsArray of 32-bit unsigned integers.
i32StartingIndexStarting index of the u32aryInts table to write from.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteULongs ( Int64  i64MmpAddress,
Int32  i32Length,
UInt64[]  u64aryLongs,
Int32  i32StartingIndex 
)

Write a block of unsigned longs (64-bit unsigned values) to the Opto MMP Device.

There are many areas this toolkit does not support with a direct method. Use this method to access these areas.

The maximum number of elements that may be transferred is 128 64-bit values.

Parameters
i64MmpAddressOpto MMP Address.
i32LengthQuantity of unsigned UInt64s to write.
u64aryLongsArray of unsigned UInt64s to write.
i32StartingIndexStarting index of u64aryLongs to write.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.
Int32 Opto22.OptoMMP3.OptoMMP.WriteWatchdogTime ( Int32  i32WatchdogTimeMs)

Set the Communication Watchdog Timeout of the IO unit.

The only method an application may detect a timeout (or possibly the I/O unit resetting) is to configure a 4-channel digital output and turn it on. Should it go off, this would indicate a communication watchdog event or a power-cycling reset event.

Parameters
i32WatchdogTimeMsTime in milliseconds to set the timeout value.
Returns
0 is OK, negative numbers imply an error occurred. See GetExtendedErrorInformation() for more information.

// write the watchdog time
i32Result = Mmp.WriteWatchdogTime(5000);

Member Data Documentation

const Int32 Opto22.OptoMMP3.OptoMMP.i32cMaximumPulseObjects = 512

SNAP-PAC has 512 pulse objects available.

Property Documentation

Boolean Opto22.OptoMMP3.OptoMMP.IsCommunicationOpen
get

Test if there is a possibility of communicating to the remote device. The primary object may be open but the underlying communication resource may have closed.

For TCP sockets, this test to see if the computer "believes" the socket is writeable. It does not guarantee that the actual socket is actually "writeable." A true test of communication is to read a section of the memory-map to see if a valid networking path is available to the destination host.

For UDP sockets, if the Open() has been called, true is always returned. The only way to validate a UDP socket's ability to communicate is to read a section of the memory-map to see if a networking path is available.

For serial, tests if the internal resource is open. This property doesn't indicate many "real world conditions" such as; USB converter unplugged, serial cable disconnected, I/O units are powered down, etc.

Returns
True if writeable, false when closed or the socket is not writeable.

Boolean bCommunicationOpen = Mmp.IsCommunicationOpen();

Int32 Opto22.OptoMMP3.OptoMMP.LastOptoMmpProtocolResultCode
get

When a -10 Error is reported, this method returns the last Opto MMP RCode. Check Form 1465 for proper response.

Returns
The last Opto MMP RCode generated.

Int32 i32LastMmpProtocolResultCode = Mmp.LastOptoMmpProtocolResultCode;

Int64 Opto22.OptoMMP3.OptoMMP.LastTransactionTimeMs
get

Report the amount of time the last communicationt transaction consumed (in milliseconds). Includes the time consumed by transmitting the request, receiving the response, and all other associated latency. If a method that has multiple transactions was just prior used, this time represents the last transaction that occurred.

Int32 Opto22.OptoMMP3.OptoMMP.MinimumRecommendedTimeoutMs
get

Recommended minimum timeout in milliseconds. Serial timeout is based on a 1200 byte communication response. The value offered by this property does not take into account higher latency communications (such as wide area networks) or high-latency communication links (POTS modems, satellites, wireless spread spectrum modems, etc) or USB to serial converters with latency settings configured very high. This is just an "absolute" minimum to avoid rediculous timeout settings. Use after opening an object.

Returns
Will report zero if the object is closed. Serial minimum timeout is dependent on the baud rate.

Int32 i32MinimumTimeoutMs = Mmp.MinimumRecommendedTimeoutMs;

Int32 Opto22.OptoMMP3.OptoMMP.ReadCacheFreshnessMs
getset

Get/Set the data cache freshness value of the current device index (for TCP/UDP, always the same device, for serial, the last station address set in the property SerialDeviceIndex).

This edition of the OptoMMP library supports data read caching. When certain areas of the Opto MMP memory map are read, the data reported may be cached. Subsequent accesses to the same Opto MMP address space may use the cached data if the freshness for the area has not expired.

Data caching is intended to reduce the amount of communication traffic and messaging of the I/O unit. Experience shows that many applicatons use point type of access methods and not bank methods. This generates an excessive amount of I/O traffic or results in a poor performing implementation. Data caching will substantially reduce network rates and dramatically increase the application's throughput.

Freshness may not be acceptable in applications where fastest response time is needed. In these cases, setting the freshness to zero disables caching for the Ethernet I/O unit configured or the specific serial station addressed using SerialDeviceIndex. An application may choose when to enable or disable the read data cache. Doing so could generate a large volume of I/O communication traffic or latency.

When this member is invoked, the entire data cache is invalidated.

When any write I/O operation occurs (successful or not), the entire cache for the IP address or the specific station (or serial address) is invalidated. This implies that the best use of the cache is to group reads and writes together. Mixing reads and writes may cause cache invalidation inefficiencies.

Only analog and digital states, analog max-mins, and digital latches are cached. Read and clear options do not cache data.

The default freshness is 100ms.

Writes are not cached. Any I/O writes invalidate the specific device's cache.

Negative freshness values will be treated as zero.

// set the cache freshness on serial station (address) 8 to 100 ms.
Mmp.SerialDeviceIndex = 8;
Mmp.ReadCacheFreshness = 100;

// retreive the current cache freshness time from serial device address 8.
Int32 i32ReachCacheFreshnessValueInMs = Mmp.ReadCacheFreshnessMs;

Int32 Opto22.OptoMMP3.OptoMMP.ReceiveTimeoutMs
getset

Receive timeout setting for the current selected serial station or network address.

The minimum timeout is 50 milliseconds, and will be used even if the value is rediculous for the specific communication arrangement.

This is the timeout used when reading OptoMMP data. Serial OptoMMP writes use half of this timeout or 50 milliseconds, which ever is larger whereas network based OptoMMP writes do not scale the timeout. This is due to the radically different time it takes to emit data on a serial wire versus a network topology.

Returns
Current timeout value.

Int32 i32ReceiveTimeoutMs = Mmp.ReceiveTimeoutMs;

Byte Opto22.OptoMMP3.OptoMMP.SerialDeviceIndex
getset

Serial device index (also known as the serial address). If used

on an UDP or TCP based connection, the station address is force to be zero.

// set the serial device index to station 240 (base 10)
Mmp.SerialDeviceIndex = (Byte)240;

// retrieve the current selected serial station address
Byte u8CurrentSerialStation = Mmp.SerialDeviceIndex;

Int32 Opto22.OptoMMP3.OptoMMP.SetAllReadCacheFreshnessMs
set

Set all this object's data cache freshness times.

See ReadCacheFreshnessMs for additional information. All devices' read data caches are invalidated (reset).

// set all serial stations or the Ethernet device read cache freshness to 250ms
Mmp.SetAllReadCacheFreshnessMs = 250;

Int32 Opto22.OptoMMP3.OptoMMP.SetAllReceiveTimeoutsMs
set

Set the receive timeout for all devices in this object. Caution, too low of a timeout value may be accepted by this method. Please see MinimumRecommendedTimeoutMs for additional information. This method only applies a 50ms minimum timeout. Use when using PCI serial cards that have baud rate clock divider options.

// set all devices timeout to 1000 ms
Mmp.SetAllReceiveTimeoutMs(1000);


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