Classes | Public Types | Public Member Functions | Public Attributes | Properties

Opto22.Emu.Opto22Emu Class Reference

Opto 22 EMU Sensor. More...

List of all members.

Classes

class  MicroMmp
 Barebones class for creating and validating mmp requests. Internal class, this is not accessible.

Public Types

enum  eInstantaneousF32Values {
  v1_CT_PhaseA_Voltage, v1_CT_PhaseA_Current, v1_CT_PhaseA_TruePower, v1_CT_PhaseA_ApparentPower,
  v1_CT_PhaseA_PowerFactor, v1_CT_PhaseB_Voltage, v1_CT_PhaseB_Current, v1_CT_PhaseB_TruePower,
  v1_CT_PhaseB_ApparentPower, v1_CT_PhaseB_PowerFactor, v1_CT_PhaseC_Voltage, v1_CT_PhaseC_Current,
  v1_CT_PhaseC_TruePower, v1_CT_PhaseC_ApparentPower, v1_CT_PhaseC_PowerFactor, v1_CT_Total_TruePower,
  v1_CT_Total_ApparentPower, v1_CT_Total_AbsoluteTruePower, v1_CT_Total_PowerFactor, v1_Pulse_A,
  v1_Pulse_B, v1_Pulse_C, v1_Pulse_D
}
 

Instantaneous (current) values.

More...
enum  eAccumulated64Values {
  v1_CT_PhaseA_Accumulated_TruePower, v1_CT_PhaseA_Accumulated_ApparentPower, v1_CT_PhaseB_Accumulated_TruePower, v1_CT_PhaseB_Accumulated_ApparentPower,
  v1_CT_PhaseC_Accumulated_TruePower, v1_CT_PhaseC_Accumulated_ApparentPower, v1_CT_Total_Accumulated_TruePower, v1_CT_Total_Accumulated_AbsoluteTruePower,
  v1_CT_Total_Accumulated_ApparentPower, v1_Pulse_A_Total, v1_Pulse_B_Total, v1_Pulse_C_Total,
  v1_Pulse_D_Total
}
 

Accumulated Values Reported as 64-bit Doubles or 64-bit Integers.

More...
enum  eOutputState { Off, On, Unknown = Int32.MaxValue }
 

Enumeration of possible output states. Note, enumeration "Unknown" is equal to Int32.MaxValue.

More...

Public Member Functions

 Opto22Emu (String sHost, Int32 i32Port, Boolean bUseIpv6)
 [DEPRECATED] Constructor. After instantiation, delay a period of i32ScanTime before trying to read the data. This time period may be required for the first valid reading of data. Always uses UDP.
 Opto22Emu (String sHost, Int32 i32Port, Boolean bUseIpv6, Boolean bUseTcp)
 Constructor overload offering a TCP/IP connection option. After instantiation, delay a period of i32ScanTime before trying to read the data. This.
void Stop ()
 Always call this object when shutting down. If this is not called, likely, the application could hang on shutdown or disappear from the desktop but still appear in the task manager's application list.
Single CurrentValue (String sIndex)
 [DEPRECATED] Retrieve a current [instantaneous] value reading.
Single CurrentValue (eInstantaneousF32Values eValue)
 Retrieve the Current (Instantaneous) Value.
Double AccumulatedValueAsF64 (eAccumulated64Values eValue)
 Read accumulated values as a double precision floating point number.
Double AccumulatedValueAsF64 (String sIndex)
 [DEPRECATED] Retrieve an accumulated value reading as a double precision floating point number.
Int64 AccumulatedValueAsI64 (String sIndex)
 [DEPRECATED] Retrieve an accumulated value reading as an Int64 (or type Long). Units are in "milli" magnitude (e.g. milliWatt-hours) as directly read from the sensor. This method is deprecated. Use methods that contain enumerations.
Int64 AccumulatedValueAsI64 (eAccumulated64Values eValue)
 Read accumulated values as a signed 64-bit integer. Units are in "milli" magnitude (e.g. milliWatt-hours) as directly read from the sensor.
Boolean RetrieveRemoteIoValues (Int32 i32Index, out Single f32Measurement, out Single f32QualityStatus, out Single f32QualityFreshness)
 Retrieve remote I/O values. These values are cached each time the underlying scanner reads the EMU. These values are only valid if RemoteIoScanning is enabled (and after a scan has completed).
Boolean RetrieveRemoteIoValues (Int32 i32Index, out Int64 i64Measurement, out Int64 i64QualityStatus, out Int64 i64QualityFreshness)
 Retrieve remote I/O values. These values are cached each time the underlying scanner reads the EMU. These values are only valid if RemoteIoScanning is enabled (and after a scan has completed).
eOutputState GetOutputValue (Int32 i32Index)
 Return the state of an output as an enumeration.
Boolean SetOutputValue (Int32 i32Index, eOutputState eValue)
 Set the output cache to update the requested state.

Public Attributes

const Int32 i32MinimumTimeoutMs = 1000
 Minimum communication timeout limit in milliseconds.
const Int32 i32MinimumScanTimeMs = 1000
 Minimum scan time in milliseconds the background thread may be set to poll the emu at.

Properties

Boolean IsScanning [get]
 Retrieve the status flag to see if we're attempting scans. Note, when initiating a session, this flag starts with a value of false. A value of true indicates the background thread has successfully retrieved the data. DataTimeStamp() returns the last timestamp when this occurred.
Boolean IsScannerConnected [get]
 Report if the scanner is connected to the device. True if connected and false if not connected.
DateTime DataTimeStamp [get]
 Retrieve the last data timestamp internal data was refreshed.
Int32 CommunicationTimeoutMs [get, set]
 Communication timeout in milliseconds. Minimum timeout is 1000 millisecond.
Int32 ScanTimeMs [get, set]
 Scan time currently used. The minimum scantime is i32MinimumScanTimeMs.
Int32 DataVersion [get]
 Returns the data version of the sensor. A value of Int32.MinValue indicates the version could not be retrieved or scanning has not commenced yet.
Boolean RemoteIoScanning [get, set]
 Toggle (enable == true) Remote I/O Scanning of the EMU. The default setting is false (remote IO is not scanned).
Boolean EnableOutputScanning [get, set]
 Toggle (enable == true) scanning of the digital states of an EMU-DR. Default is false (outputs are not scanned).
Boolean EnableOutputWriting [get, set]
 Control or return if output writing is enabled. Default is false.
Boolean InhibitOutputUpdateOnScanningFailure [get, set]
 When a communication failure occurs, automatically clear the IssueOutputUpdate property. Default is false.
static Int32 MaximumRemoteIoValues [get]
 The maximum number of Io Values this version supports.
static Int32 MaximumOutputValues [get]
 Retrieves the maximum number of outputs this version of the library supports.

Detailed Description

Opto 22 EMU Sensor.

A simple class to access the data of the EMU sensor. Supports IPV4 and IPV6 connectivity for Windows 7 and Vista clients. This class initiates a background scanning thread to retrieve the data. The class's user simply just access the scanned values. No synchronization is provided since all instantaneous and accumulated values are read directly from the sensor. The only post-processing this class provided is the conversion of some high-resolution accumulated value to double-precision floating point formats.

About scanning. The scanning interval's default is 2,000 milliseconds (or 2 seconds). This is the minimum time you may set the scan interval. The EMU updates its values every 5 seconds. You may increase the scan time. No limit is applied to the maximum scan time.

Communication timeouts. This class imposes a minimum communication timeout of 1,000 milliseconds (or 1 second). For single Ethernet segments, this time is more than sufficient. If the application accesses data over a wide-area connection, this time may require increasing.

This toolkit is distributed as a .Net 3.5 DLL. To include this functionality in your .Net project, add the DLL as a reference. Then for C# users, use "using Opto22.Emu"; for VB users, "import Opto22.Emu".

Version of the toolkit now matches the "current" EMU version. Versions jumped from 1.0.1.0 to 3.0.0.0. Additions to support version 3 and some changes to deprecate commands that didn't work well with some users. Deprecated methods will continue to work but no changes will be made to them. If you are writing a new application, do not use deprecated methods.

            (C#)
            using Opto22.Emu;

                static void Main(string[] args)
                {
                        // Available Instantaneous Values
                        Opto22Emu.eInstantaneousF32Values[] earySingleInstantaneousValues = 
                        {
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseA_Voltage,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseA_Current,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseA_TruePower,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseA_ApparentPower,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseA_PowerFactor,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseB_Voltage,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseB_Current,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseB_TruePower,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseB_ApparentPower,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseB_PowerFactor,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseC_Voltage,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseC_Current,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseC_TruePower,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseC_ApparentPower,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_PhaseC_PowerFactor,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_Total_TruePower,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_Total_ApparentPower,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_Total_AbsoluteTruePower,
                                Opto22Emu.eInstantaneousF32Values.v1_CT_Total_PowerFactor,
                                Opto22Emu.eInstantaneousF32Values.v1_Pulse_A,
                                Opto22Emu.eInstantaneousF32Values.v1_Pulse_B,
                                Opto22Emu.eInstantaneousF32Values.v1_Pulse_C,
                                Opto22Emu.eInstantaneousF32Values.v1_Pulse_D
                        };

                        // Available 64-Bit Double-Precision Values
                        Opto22Emu.eAccumulated64Values[] earyDoublePrecisionValues = 
                        {
                                Opto22Emu.eAccumulated64Values.v1_CT_PhaseA_Accumulated_TruePower,
                                Opto22Emu.eAccumulated64Values.v1_CT_PhaseA_Accumulated_ApparentPower,
                                Opto22Emu.eAccumulated64Values.v1_CT_PhaseB_Accumulated_TruePower,
                                Opto22Emu.eAccumulated64Values.v1_CT_PhaseB_Accumulated_ApparentPower,
                                Opto22Emu.eAccumulated64Values.v1_CT_PhaseC_Accumulated_TruePower,
                                Opto22Emu.eAccumulated64Values.v1_CT_PhaseC_Accumulated_ApparentPower,
                                Opto22Emu.eAccumulated64Values.v1_CT_Total_Accumulated_TruePower,
                                Opto22Emu.eAccumulated64Values.v1_CT_Total_Accumulated_AbsoluteTruePower,
                                Opto22Emu.eAccumulated64Values.v1_CT_Total_Accumulated_ApparentPower,
                                Opto22Emu.eAccumulated64Values.v1_Pulse_A_Total,
                                Opto22Emu.eAccumulated64Values.v1_Pulse_B_Total,
                                Opto22Emu.eAccumulated64Values.v1_Pulse_C_Total,
                                Opto22Emu.eAccumulated64Values.v1_Pulse_D_Total
                        };

                        // create a new object, this initiates a connection with the sensor using IPv4 and TCP/IP
                        Opto22Emu emu = new Opto22Emu("10.192.54.49", 2001, false, true);
                        emu.CommunicationTimeoutMs = 1000;
                        emu.ScanTimeMs = 1000;

                        // enables the remote I/O scanning
                        emu.RemoteIoScanning = true;

                        // enables the scanner to read the output states from the emu
                        emu.EnableOutputScanning = true;

                        // enables the scanner to write the cached states to the emu
                        emu.EnableOutputWriting = true;

                        // return the remote Io scanning value
                        Console.WriteLine("Remote IO Scanning Status is {0}.", emu.RemoteIoScanning);

                        // wait one scan time interval to allow the connection to refresh data
                        Thread.Sleep(emu.ScanTimeMs);

                        // emu data version, the currently set scan time, and the communication timeout
                        Console.WriteLine("Sensor Data Version {0}", emu.DataVersion);
                        Console.WriteLine("Data Scan Time {0}", emu.ScanTimeMs);
                        Console.WriteLine("Communication Timeout in Milliseconds {0}", emu.ScanTimeMs);

                        // used to toggle outputs on an EMU-DR
                        Int32 i32Counter = 0;

                        // loop forever
                        while (true)
                        {
                                // start with the data timestamp and scanning active flags
                                Console.WriteLine("Data Timestamp {0}", emu.DataTimeStamp);
                                Console.WriteLine("Data Scanning {0}", emu.IsScanning);

                                // print the int32 instantaneous value
                                for (Int32 i = 0; i < earySingleInstantaneousValues.Length; i++)
                                {
                                        Console.WriteLine("{0} {1}", earySingleInstantaneousValues[i], emu.CurrentValue(earySingleInstantaneousValues[i]));
                                }

                                // print the accumulated values
                                for (Int32 i = 0; i < earyDoublePrecisionValues.Length; i++)
                                {
                                        Console.WriteLine("{0} {1}", earyDoublePrecisionValues[i], emu.AccumulatedValueAsF64(earyDoublePrecisionValues[i]));
                                }

                                // read remote I/O values
                                for (Int32 i = 0; i < Opto22Emu.MaximumRemoteIoValues; i++)
                                {
                                        Single f32Measurement = (Single)0.0;
                                        Single f32Status = (Single)0.0;
                                        Single f32Freshness = (Single)0.0;
                                        Int64 i64Measurement = 0;
                                        Int64 i64Status = 0;
                                        Int64 i64Freshness = 0;
                                        Boolean bSuccess;

                                        // read the values as floats values
                                        bSuccess = emu.RetrieveRemoteIoValues(i, out f32Measurement, out f32Status, out f32Freshness);
                                        Console.WriteLine("Float I/O Values Index {0} Measurement {1} Status {2} Freshness {3} Method Status {4}.", i, f32Measurement, f32Status, f32Freshness, bSuccess);

                                        // read the values as signed integers
                                        bSuccess = emu.RetrieveRemoteIoValues(i, out i64Measurement, out i64Status, out i64Freshness);
                                        Console.WriteLine("Integer I/O Values Index {0} Measurement {1} Status {2} Freshness {3} Method Status {4}.", i, i64Measurement, i64Status, i64Freshness, bSuccess);
                                }

                                // read DR output states (only valid if a DR and EnableOutputScanning evaluates true)
                                for (Int32 i = 0; i < Opto22Emu.MaximumOutputValues; i++)
                                {
                                        Opto22Emu.eOutputState state = emu.GetOutputValue(i);
                                        Console.WriteLine("DR Output State {0} reports {1}.", i, state);
                                }

                                // toggle a DR output state
                                {
                                        Opto22Emu.eOutputState state = emu.GetOutputValue(i32Counter % Opto22Emu.MaximumOutputValues);
                                        if (state == Opto22Emu.eOutputState.Off)
                                        {
                                                state = Opto22Emu.eOutputState.On;
                                        }
                                        else
                                        {
                                                state = Opto22Emu.eOutputState.Off;
                                        }

                                        // set the output state outputs will only update if EnableOutputWriting evaluates true
                                        emu.SetOutputValue(i32Counter % Opto22Emu.MaximumOutputValues, state);

                                        i32Counter++;
                                }
                                // a blank line
                                Console.WriteLine();

                                // sleep a while because data scans don't occur that often so wait at least the scan time before reading values again
                                Thread.Sleep(emu.ScanTimeMs);
                        }

                        // when the Opto22Emu object is demolished, the background thread will be automatically terminated and cleaned up
                        emu.Stop();
                }
            (VB)
            // this example is now a file in the Visual Basic examples folder of the distribution

Member Enumeration Documentation

Accumulated Values Reported as 64-bit Doubles or 64-bit Integers.

Instantaneous (current) values.

Enumeration of possible output states. Note, enumeration "Unknown" is equal to Int32.MaxValue.

Appeared in assembly version 3.0.0.0; EMU Version 3.0.

Enumerator:
Off 

Turn output off.

On 

Turn output on.

Unknown 

Do not use! Value is only returned for out of bound cases.


Constructor & Destructor Documentation

Opto22.Emu.Opto22Emu.Opto22Emu ( String  sHost,
Int32  i32Port,
Boolean  bUseIpv6 
)

[DEPRECATED] Constructor. After instantiation, delay a period of i32ScanTime before trying to read the data. This time period may be required for the first valid reading of data. Always uses UDP.

For new applications, please use the overload that contains the selection for either UDP or TCP.

Parameters:
sHost The host in name, dot, or colon format.
i32Port The destination host port, usually 2001.
bUseIpv6 Typically this will be false to use IPv4.
Opto22.Emu.Opto22Emu.Opto22Emu ( String  sHost,
Int32  i32Port,
Boolean  bUseIpv6,
Boolean  bUseTcp 
)

Constructor overload offering a TCP/IP connection option. After instantiation, delay a period of i32ScanTime before trying to read the data. This.

Use UDP (bUseTcp == false) when on a local hardwired segment or very reliable network. Use TCP (bUseTcp == true) when on a wireless or congested (lossy) network. For lossy networks, use a timeout of up too several seconds to allow TCP/IP to perform built in message retransmissions.

Appeared in assembly version 3.0.0.0; EMU Version 3.0.

Parameters:
sHost Host name, IPv4 or IPv6 (as appropriate address).
i32Port Usually 2001 but may be different for NAT's or remapping of the port.
bUseTcp Use true for TCP/IP, false for UDP.
bUseIpv6 False, use IPv4 (most common selection).

Member Function Documentation

Double Opto22.Emu.Opto22Emu.AccumulatedValueAsF64 ( eAccumulated64Values  eValue  ) 

Read accumulated values as a double precision floating point number.

Appeared in assembly version 3.0.0.0; EMU Version 3.0.

Parameters:
eValue Requested value selected from enumeration eAccumulated64Values.
Returns:
Value requested.
Double Opto22.Emu.Opto22Emu.AccumulatedValueAsF64 ( String  sIndex  ) 

[DEPRECATED] Retrieve an accumulated value reading as a double precision floating point number.

This method is DEPRECATED. Use the enumeration overload.

These are the following accumulated string options available. "CT_PhaseA_Accumulated_TruePower", "CT_PhaseA_Accumulated_ApparentPower", "CT_PhaseB_Accumulated_TruePower", "CT_PhaseB_Accumulated_ApparentPower", "CT_PhaseC_Accumulated_TruePower", "CT_PhaseC_Accumulated_ApparentPower", "CT_Total_Accumulated_TruePower", "CT_Total_Accumulated_AbsoluteTruePower", "CT_Total_Accumulated_ApparentPower", "Pulse_A_Total", "Pulse_B_Total", "Pulse_C_Total", "Pulse_D_Total"

Parameters:
sIndex The item's string name.
Returns:
Double.NegativeInfinity if sIndex is invalid, otherwise the number the EMU returns. The returned values are in units of kiloWatt-hours.
Int64 Opto22.Emu.Opto22Emu.AccumulatedValueAsI64 ( String  sIndex  ) 

[DEPRECATED] Retrieve an accumulated value reading as an Int64 (or type Long). Units are in "milli" magnitude (e.g. milliWatt-hours) as directly read from the sensor. This method is deprecated. Use methods that contain enumerations.

This method is DEPRECATED. Use the enumeration overload.

Parameters:
sIndex The item's string name.
Returns:
Int64.MinValue if sIndex is invalid, otherwise the number the EMU returns. The returned values are in units of milliWatt-hours.
Int64 Opto22.Emu.Opto22Emu.AccumulatedValueAsI64 ( eAccumulated64Values  eValue  ) 

Read accumulated values as a signed 64-bit integer. Units are in "milli" magnitude (e.g. milliWatt-hours) as directly read from the sensor.

Appeared in assembly version 3.0.0.0; EMU Version 3.0.

Parameters:
eValue Requested value selected from enumeration eAccumulated64Values.
Returns:
Single Opto22.Emu.Opto22Emu.CurrentValue ( String  sIndex  ) 

[DEPRECATED] Retrieve a current [instantaneous] value reading.

This method is DEPRECATED. Use the enumeration overload.

These are the following valid string index values. "CT_PhaseA_Voltage", "CT_PhaseA_Current", "CT_PhaseA_TruePower", "CT_PhaseA_ApparentPower", "CT_PhaseA_PowerFactor", "CT_PhaseB_Voltage", "CT_PhaseB_Current", "CT_PhaseB_TruePower", "CT_PhaseB_ApparentPower", "CT_PhaseB_PowerFactor", "CT_PhaseC_Voltage", "CT_PhaseC_Current", "CT_PhaseC_TruePower", "CT_PhaseC_ApparentPower", "CT_PhaseC_PowerFactor", "CT_Total_TruePower", "CT_Total_ApparentPower", "CT_Total_AbsoluteTruePower", "CT_Total_PowerFactor", "Pulse_A", "Pulse_B", "Pulse_C", "Pulse_D"

Parameters:
sIndex The item's string name.
Returns:
Single.NegativeInfinity if sIndex is invalid, otherwise the number the EMU returns. Units of the current value vary depending on the parameter (Volts, Amps, kilowatts, etc).
Single Opto22.Emu.Opto22Emu.CurrentValue ( eInstantaneousF32Values  eValue  ) 

Retrieve the Current (Instantaneous) Value.

Parameters:
eValue Supply an eInstantaneousF32Values enumeration.
Returns:
Float (Single) value.
eOutputState Opto22.Emu.Opto22Emu.GetOutputValue ( Int32  i32Index  ) 

Return the state of an output as an enumeration.

Parameters:
i32Index The output index, valid range 0 to MaximumOutputValues - 1.
Returns:
Boolean Opto22.Emu.Opto22Emu.RetrieveRemoteIoValues ( Int32  i32Index,
out Single  f32Measurement,
out Single  f32QualityStatus,
out Single  f32QualityFreshness 
)

Retrieve remote I/O values. These values are cached each time the underlying scanner reads the EMU. These values are only valid if RemoteIoScanning is enabled (and after a scan has completed).

Appeared in assembly version 3.0.0.0; EMU Version 3.0.

Parameters:
i32Index Index of the remote I/O to read.
f32Measurement If the value is scaled, the measurement value. Nan if method returns false.
f32QualityStatus Quality of the value. Nan if method returns false.
f32QualityFreshness Freshness counter. Nan if method returns false.
Returns:
True when the index is valid, false otherwise.
Boolean Opto22.Emu.Opto22Emu.RetrieveRemoteIoValues ( Int32  i32Index,
out Int64  i64Measurement,
out Int64  i64QualityStatus,
out Int64  i64QualityFreshness 
)

Retrieve remote I/O values. These values are cached each time the underlying scanner reads the EMU. These values are only valid if RemoteIoScanning is enabled (and after a scan has completed).

Appeared in assembly version 3.0.0.0; EMU Version 3.0.

Parameters:
i32Index Index of the remote I/O to read.
i64Measurement The measurement value. This is either a 32-bit signed or 32-bit unsigned integer value (cast as necessary). Int64.MinValue if method returns false.
i64QualityStatus Quality of the value. Int64.MinValue if method returns false.
i64QualityFreshness Freshness counter. Int64.MinValue if method returns false.
Returns:
True when the index is valid, false otherwise.
Boolean Opto22.Emu.Opto22Emu.SetOutputValue ( Int32  i32Index,
eOutputState  eValue 
)

Set the output cache to update the requested state.

Parameters:
i32Index Valid index, 0 to MaximumRemoteIoValues - 1.
eValue Output enumeration to set.
Returns:
void Opto22.Emu.Opto22Emu.Stop (  ) 

Always call this object when shutting down. If this is not called, likely, the application could hang on shutdown or disappear from the desktop but still appear in the task manager's application list.


Member Data Documentation

Minimum scan time in milliseconds the background thread may be set to poll the emu at.

Minimum communication timeout limit in milliseconds.


Property Documentation

Int32 Opto22.Emu.Opto22Emu.CommunicationTimeoutMs [get, set]

Communication timeout in milliseconds. Minimum timeout is 1000 millisecond.

DateTime Opto22.Emu.Opto22Emu.DataTimeStamp [get]

Retrieve the last data timestamp internal data was refreshed.

Int32 Opto22.Emu.Opto22Emu.DataVersion [get]

Returns the data version of the sensor. A value of Int32.MinValue indicates the version could not be retrieved or scanning has not commenced yet.

Boolean Opto22.Emu.Opto22Emu.EnableOutputScanning [get, set]

Toggle (enable == true) scanning of the digital states of an EMU-DR. Default is false (outputs are not scanned).

If InhibitOutputUpdateOnScanningFailure = true, the scanning thread will stop writing outputs and clear the Enable

There is no checking if the EMU being scanned actually is a -DR. The thread will scan the data but it will just read what data is present and may not have any meaning.

If you do not have an EMU-DR, please do not enable this function. Writes will work but for no reason.

Appeared in assembly version 3.0.0.0; EMU-DR Version 3.0.

Boolean Opto22.Emu.Opto22Emu.EnableOutputWriting [get, set]

Control or return if output writing is enabled. Default is false.

If InhibitOutputUpdateOnScanningFailure is true, the application must manually reenable this parameter to allow the object's output cache to be written to the EMU-DR. Use only for an EMU-DR.

Enabling this for EMU without outputs is pointless.

Appeared in assembly version 3.0.0.0; EMU-DR Version 3.0.

Boolean Opto22.Emu.Opto22Emu.InhibitOutputUpdateOnScanningFailure [get, set]

When a communication failure occurs, automatically clear the IssueOutputUpdate property. Default is false.

Automatically stops updating of the outputs when a communication failure occurs.

Appeared in assembly version 3.0.0.0; EMU-DR Version 3.0.

Boolean Opto22.Emu.Opto22Emu.IsScannerConnected [get]

Report if the scanner is connected to the device. True if connected and false if not connected.

This appeared in assembly version 3.0.0.0.

Boolean Opto22.Emu.Opto22Emu.IsScanning [get]

Retrieve the status flag to see if we're attempting scans. Note, when initiating a session, this flag starts with a value of false. A value of true indicates the background thread has successfully retrieved the data. DataTimeStamp() returns the last timestamp when this occurred.

Int32 Opto22.Emu.Opto22Emu.MaximumOutputValues [static, get]

Retrieves the maximum number of outputs this version of the library supports.

Appeared in assembly version 3.0.0.0; EMU Version 3.0.

Int32 Opto22.Emu.Opto22Emu.MaximumRemoteIoValues [static, get]

The maximum number of Io Values this version supports.

Appeared in assembly version 3.0.0.0; EMU-DR Version 3.0.

Boolean Opto22.Emu.Opto22Emu.RemoteIoScanning [get, set]

Toggle (enable == true) Remote I/O Scanning of the EMU. The default setting is false (remote IO is not scanned).

If you do not have remote I/O, please do not enable this function. Scanning will operate correct but for no reason.

Appeared in assembly version 3.0.0.0; EMU Version 3.0.

Int32 Opto22.Emu.Opto22Emu.ScanTimeMs [get, set]

Scan time currently used. The minimum scantime is i32MinimumScanTimeMs.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Properties