Gls |
This class will trigger BaseEvent, PhaseStateChange and BranchStateChange events.
public sealed class GlsEmMcu : GenericDevice
The GlsEmMcu type exposes the following members.
| Name | Description | |
|---|---|---|
| Branches |
Collection of Branch objects for GlsEmMcu.
This property will trigger BranchStateChange event with RealTimePowerFeedbackEventId. | |
| ConnectedIpList |
A property containing the list of the ConnectedIpInformation objects which contain information about the devices that are connected to this IP ID.
This property is only valid for an ethernet device. If this is not an ethernet device, then this property will return null.
If this is an ethernet device, the list will be non-null. It will be empty if no devices are connected.
The order of items in this list is not guaranteed.
(Inherited from GenericDevice) | |
| DataLogger | LoggingData object for GlsEmMcu.
This property will trigger BaseEvent event with event IDs defined in GlsEmMcu. | |
| Description |
Get/Set the description of this device.
(Inherited from GenericBase) | |
| DeviceIdentifierFeedback |
Property to report the name of the device.
The BaseEvent event will trigger with DeviceIdentifierFeedbackEventId. | |
| Disposed |
Property to indicate if the device has been disposed.
(Inherited from GenericDevice) | |
| ID |
Property to get the ID of the device.
(Inherited from GenericDevice) | |
| IsOnline |
Property to get the current online state of the device.
(Inherited from GenericDevice) | |
| MasterRealTime | MasterRealTimeData object for GlsEmMcu.
This property will trigger BaseEvent event with event IDs defined in GlsEmMcu and PhaseStateChange event with event IDs defined in GlsEmMcu. | |
| Name |
Get the name of this device.
(Inherited from GenericBase) | |
| Parent |
The parent that a given object was added to.
(Inherited from GenericBase) | |
| Registerable |
Property to indicate that this device can be registered.
(Inherited from GenericDevice) | |
| Registered |
Property to get the current registration state of the device.
(Inherited from GenericDevice) | |
| RegistrationFailureReason |
Property to get the Registration Failure Reason, this will match the return value from the call to register.
(Inherited from GenericDevice) | |
| SIMPLDeviceImplementation |
Internal protected member used for actual device control.
(Inherited from GenericDevice) | |
| Type |
Property to determine to type of device this is.
(Inherited from GenericDevice) | |
| UnRegistrationFailureReason |
Property to get the Unregistration Failure Reason, this will match the return value from the call to unregister.
(Inherited from GenericDevice) | |
| UserSpecifiedObject |
Can be assigned anything that user wants.
(Inherited from GenericBase) | |
| XioEndpointStubSIMPLDevice |
The SIMPL "stub" Device that the XiO Director creates for an endpoint to send the 1C/0E to the
correct place in hierarchy.
(Inherited from GenericDevice) |
| Name | Description | |
|---|---|---|
| Dispose |
Clean up of resources.
(Inherited from GenericBase) | |
| Dispose(Boolean) |
Method to perform the actual disposing of the device.
(Inherited from GenericDevice) | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize |
Destructor of the device.
(Inherited from GenericDevice) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| OnBaseEvent(Int32) |
Protected member used to fire the BaseEvent with the default extended information.
(Inherited from GenericBase) | |
| OnBaseEvent(Int32, UInt16) |
Protected member used to fine the BaseEvent with extended event information.
(Inherited from GenericBase) | |
| Register |
Register this device with the system.
(Inherited from GenericDevice) | |
| ToString |
Return the name of the device.
(Inherited from GenericDevice) | |
| TriggerIdentifier | Method to trigger the DeviceIdentifierFeedback to report the name of the device. | |
| UnRegister |
Unregister this device with the system. This function can not be called from the device's own SigChange event handler.
On successful unregistration, if this device supports the OnlineStatusChange event, it will trigger indicating the device when offline. (Inherited from GenericDevice) |
| Name | Description | |
|---|---|---|
| BaseEvent |
Generic base event, triggered when the there are no other handlers available
for a specific EventID.
(Inherited from GenericBase) | |
| IpInformationChange |
Event that tells what IP Address is connected/disconnected from an IP ID for a non-UDP device.
This is only valid for an Ethernet device. An exception will be thrown if it is not.
(Inherited from GenericDevice) | |
| OnlineStatusChange |
Event triggered when the Online status of the device changes.
(Inherited from GenericDevice) |
| Name | Description | |
|---|---|---|
| ActivePowerTotalFeedbackEventId |
The state of ActivePowerTotalFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DataActivePowerFeedbackEventId |
The state of DataActivePowerFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DataCurrentFeedbackEventId |
The state of DataCurrentFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DataEnergyMeterFeedbackEventId |
The state of DataEnergyMeterFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DataEnergyUsageFeedbackEventId |
The state of DataEnergyUsageFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DataPeakPowerFeedbackEventId |
The state of DataPeakPowerFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DataPowerFactorFeedbackEventId |
The state of DataPowerFactorFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DataPulseMeterFeedbackEventId |
The state of DataPulseMeterFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DataPulseUsageFeedbackEventId |
The state of DataPulseUsageFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DataVoltageFeedbackEventId |
The state of DataVoltageFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| DeviceIdentifierFeedbackEventId |
The state of DeviceIdentifierFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| NumberOfRecordsFeedbackEventId |
The state of NumberOfRecordsFeedback has changed.
The BaseEvent event will trigger for this event id. | |
| PhaseActivePowerFeedbackEventId |
The state of ActivePowerFeedback has changed.
The PhaseStateChange event will trigger for this event id. | |
| PhaseVoltageFeedbackEventId |
The state of VoltageFeedback has changed.
The PhaseStateChange event will trigger for this event id. | |
| PulseRateFeedbackEventId |
The state of PulseRateFeedbacks has changed.
The BaseEvent event will trigger for this event id. | |
| RealTimePowerFeedbackEventId |
The state of RealTimePowerFeedback has changed.
The BranchStateChange event will trigger for this event id. |
static GlsEmMcu myGlsEmMcu; public ControlSystemGlsEmMcu() { //Register console commands CrestronConsole.AddNewConsoleCommand(CreateDeviceCmd, "CreateDevice", "This is a GLS-EM-MCU CreateDevice command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(TriggerIdentifierCmd, "TriggerIdentifier", "This is a GLS-EM-MCU TriggerIdentifier command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(DeviceIdentifierCmd, "DeviceIdentifier", "This is a GLS-EM-MCU DeviceIdentifier command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(TriggerPhaseVoltageCmd, "TriggerPhaseVoltage", "This is a GLS-EM-MCU TriggerPhaseVoltage command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(TriggerPhaseActivePowerCmd, "TriggerPhActivePwr", "This is a GLS-EM-MCU TriggerPhActivePwr command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(TriggerActivePowerTotalCmd, "TriggerActivePwrTtl", "This is a GLS-EM-MCU TriggerActivePwrTtl command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(TriggerPulseRateCmd, "TriggerPulseRate", "This is a GLS-EM-MCU TriggerPulseRate command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintNumberOfRecordsCmd, "PrintNumberOfRecords", "This is a GLS-EM-MCU PrintNumberOfRecords command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintDataVoltageCmd, "PrintDataVoltage", "This is a GLS-EM-MCU PrintDataVoltage command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintDataCurrentCmd, "PrintDataCurrent", "This is a GLS-EM-MCU PrintDataCurrent command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintDataActivePowerCmd, "PrintDataActivePower", "This is a GLS-EM-MCU PrintDataActivePower command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintDataPeakPowerCmd, "PrintDataPeakPower", "This is a GLS-EM-MCU PrintDataPeakPower command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintEnergyUsageCmd, "PrintEnergyUsage", "This is a GLS-EM-MCU PrintEnergyUsage command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintPulseUsageCmd, "PrintPulseUsage", "This is a GLS-EM-MCU GetPulseUsage command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintPowerFactorCmd, "PrintPowerFactor", "This is a GLS-EM-MCU PrintPowerFactor command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintEnergyMeterCmd, "PrintEnergyMeter", "This is a GLS-EM-MCU PrintEnergyMeter command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintPulseMeterCmd, "PrintPulseMeter", "This is a GLS-EM-MCU PrintPulseMeter command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(GetPreviousRecordCmd, "GetPreviousRecord", "This is a GLS-EM-MCU GetPreviousRecord command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(GetNextRecordCmd, "GetNextRecord", "This is a GLS-EM-MCU GetNextRecord command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(TriggerAllRealtimeDataCmd, "TriggerAllRtData", "This is a GLS-EM-MCU TriggerAllRtData command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(SetLiveUpdateRateCmd, "SetLiveUpdateRate", "This is a GLS-EM-MCU SetLiveUpdateRate command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintPhaseVoltageCmd, "PrintPhaseVoltage", "This is a GLS-EM-MCU PrintPhaseVoltage command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintPhaseActivePowerCmd, "PrintPhActivePower", "This is a GLS-EM-MCU PrintPhaseActivePower command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintActivePowerTotalCmd, "PrintActivePwrTotal", "This is a GLS-EM-MCU PrintActivePowerTotal command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintPulseRateCmd, "PrintPulseRate", "This is a GLS-EM-MCU PrintPulseRate command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(TriggerAllRealTimePowerCmd, "TriggerAllRealTimePower", "This is a GLS-EM-MCU TriggerAllRealTimePower command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(TriggerRealTimePowerCmd, "TriggerRealTimePower", "This is a GLS-EM-MCU TriggerRealTimePower command", ConsoleAccessLevelEnum.AccessOperator); CrestronConsole.AddNewConsoleCommand(PrintRealTimePowerCmd, "PrintRealTimePower", "This is a GLS-EM-MCU PrintRealTimePower command", ConsoleAccessLevelEnum.AccessOperator); } //Method to create and register the GLS-EM-MCU device with the Control System. public void CreateDeviceCmd(String args) { //Initialize the GLS-EM-MCU device for Cresnet Communication myGlsEmMcu = new GlsEmMcu(0x18, this); myGlsEmMcu.BaseEvent += GlsEmMcu_EventHandler; for (uint i = 1; i <= 4; i++) { myGlsEmMcu.Branches[i].BranchStateChange += GlsEmMcu_CircuitSigEventHandler; } myGlsEmMcu.MasterRealTime.PhaseStateChange += GlsEmMcu_PhaseSigEventHandler; //Register the GLS-EM-MCU with the Control system myGlsEmMcu.Register(); if (myGlsEmMcu.Registered) { CrestronConsole.ConsoleCommandResponse("{0} device successfully registered\r\n", myGlsEmMcu.ToString()); } } //Method to handle sig change events for GLS-EM-MCU Phase class. static void GlsEmMcu_PhaseSigEventHandler(object device, PhaseEventArgs args) { if (args.EventId == GlsEmMcu.PhaseVoltageFeedbackEventId) { CrestronConsole.PrintLine("Phase {0} voltage feedback event received\r\n", Convert.ToChar(args.Index + 'A' -1)); } else if (args.EventId == GlsEmMcu.PhaseActivePowerFeedbackEventId) { CrestronConsole.PrintLine("Phase {0} active power feedback event received\r\n", Convert.ToChar(args.Index + 'A' - 1)); } } // Method to handle sig change events for GLS-EM-MCU Circuit class. static void GlsEmMcu_CircuitSigEventHandler(object device, BranchEventArgs args) { if (args.EventId == GlsEmMcu.RealTimePowerFeedbackEventId) { CrestronConsole.PrintLine("Branch {0} circuit {1} real-time active power feedback event received\r\n", args.Branch.Number, args.Index); } } // Method to handle sig change events for GLS-EM-MCU LoggingData, DeviceIdentifier and MasterRealTimeData classes. static void GlsEmMcu_EventHandler(GenericBase device, BaseEventArgs args) { switch (args.EventId) { case GlsEmMcu.PulseRateFeedbackEventId: CrestronConsole.PrintLine("Pulse Rate {0} feedback Event received\r\n", args.Index); break; case GlsEmMcu.ActivePowerTotalFeedbackEventId: CrestronConsole.PrintLine("Active Power Total feedback Event received\r\n"); break; case GlsEmMcu.NumberOfRecordsFeedbackEventId: CrestronConsole.PrintLine("Number Of Log Records feedback Event received\r\n"); break; case GlsEmMcu.DataActivePowerFeedbackEventId: CrestronConsole.PrintLine("Data Active Power feedback Event received\r\n"); break; case GlsEmMcu.DataCurrentFeedbackEventId: CrestronConsole.PrintLine("Data Current feedback Event received\r\n"); break; case GlsEmMcu.DataEnergyMeterFeedbackEventId: CrestronConsole.PrintLine("Data Energy Meter feedback Event received\r\n"); break; case GlsEmMcu.DataEnergyUsageFeedbackEventId: CrestronConsole.PrintLine("Data Energy Usage feedback Event received\r\n"); break; case GlsEmMcu.DataPeakPowerFeedbackEventId: CrestronConsole.PrintLine("Data Peak Power feedback Event received\r\n"); break; case GlsEmMcu.DataPowerFactorFeedbackEventId: CrestronConsole.PrintLine("Data Power Factor feedback Event received\r\n"); break; case GlsEmMcu.DataPulseMeterFeedbackEventId: CrestronConsole.PrintLine("Data Pulse Meter feedback Event received\r\n"); break; case GlsEmMcu.DataPulseUsageFeedbackEventId: CrestronConsole.PrintLine("Data Pulse Usage feedback Event received\r\n"); break; case GlsEmMcu.DataVoltageFeedbackEventId: CrestronConsole.PrintLine("Data Voltage feedback Event received\r\n"); break; case GlsEmMcu.DeviceIdentifierFeedbackEventId: CrestronConsole.PrintLine("Device Identifier feedback Event received\r\n"); break; } } //Prints the device identifier string //How to call this method: DeviceIdentifier public void DeviceIdentifierCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} Device Identifier is {1}\r\n", myGlsEmMcu.ToString(), myGlsEmMcu.DeviceIdentifierFeedback.StringValue); } //Method to trigger the myGlsEmMcu.DeviceIdentifierFeedback to report the name of the device. //How to call this method: TriggerIdentifier public void TriggerIdentifierCmd(String args) { myGlsEmMcu.TriggerIdentifier(); } //Method to trigger to report current value of the myGlsEmMcu.MasterRealTime.PhaseVoltage for the specified phase. //How to call this method: TriggerPhaseVoltage A/B/C Y to enable reporting // TriggerPhaseVoltage A/B/C N to enable reporting public void TriggerPhaseVoltageCmd(String args) { var ch = Convert.ToChar(args.Substring(0, 1)); if ((ch >= 'A') && (ch <= 'C')) { var index = (uint)(ch - 'A'); if (args.Substring(2, 1) == "Y") { myGlsEmMcu.MasterRealTime.Phases[index].TriggerVoltage.BoolValue = true; } else { myGlsEmMcu.MasterRealTime.Phases[index].TriggerVoltage.BoolValue = false; } } else { CrestronConsole.ConsoleCommandResponse("Phase {0} is not valid\r\n", ch); } } //Method to trigger to report current value of the myGlsEmMcu.MasterRealTime.PhaseActivePower for the specified phase. //How to call this method: TriggerPhActivePwr A/B/C Y to enable reporting // TriggerPhActivePwr A/B/C N to enable reporting public void TriggerPhaseActivePowerCmd(String args) { var ch = Convert.ToChar(args.Substring(0, 1)); if ((ch >= 'A') && (ch <= 'C')) { var index = (uint)(ch - 'A'); if (args.Substring(2, 1) == "Y") { myGlsEmMcu.MasterRealTime.Phases[index].TriggerActivePower.BoolValue = true; } else { myGlsEmMcu.MasterRealTime.Phases[index].TriggerActivePower.BoolValue = false; } } else { CrestronConsole.ConsoleCommandResponse("Phase {0} is not valid\r\n", ch); } } //Method to trigger to report current value of the myGlsEmMcu.MasterRealTime.TriggerActivePowerTotal for the specified phase. //How to call this method: TriggerActivePwrTtl Y to enable reporting // TriggerActivePwrTtl N to enable reporting public void TriggerActivePowerTotalCmd(String args) { if (args.Substring(0, 1) == "Y") { myGlsEmMcu.MasterRealTime.TriggerActivePowerTotal.BoolValue = true; } else { myGlsEmMcu.MasterRealTime.TriggerActivePowerTotal.BoolValue = false; } } //Method to trigger to report current value of the myGlsEmMcu.MasterRealTime.TriggerPulseRates for the specified pulse rate. //How to call this method: TriggerPulseRate 1 to 4 Y to enable reporting // TriggerPulseRate 1 to 4 N to enable reporting public void TriggerPulseRateCmd(String args) { if (args.Substring(2, 1) == "Y") { myGlsEmMcu.MasterRealTime.TriggerPulseRates[Convert.ToUInt16(args.Substring(0, 1))].BoolValue = true; } else { myGlsEmMcu.MasterRealTime.TriggerPulseRates[Convert.ToUInt16(args.Substring(0, 1))].BoolValue = false; } } //Method to print the current value of the number of records logged. //How to call this method: PrintNumberOfRecords public void PrintNumberOfRecordsCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's number Of records logged is {1}\r\n", myGlsEmMcu.ToString(), myGlsEmMcu.DataLogger.NumberOfRecordsFeedback.UShortValue); } //Method to print the average voltage for each of the 3 input phases from the selected record. //How to call this method: PrintDataVoltage public void PrintDataVoltageCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's average voltage data in the selected record is {1}\r\n", myGlsEmMcu.ToString(), myGlsEmMcu.DataLogger.DataVoltageFeedback.StringValue); CrestronConsole.ConsoleCommandResponse("Packet Structure: <end time><duration><packet type><Avg_Voltage A><Avg_Voltage B><Avg_Voltage C>\r\n"); } //Method to print the average RMS current measured for each channel, including a summary of all current measured through the 3 mains inputs from the selected record. //How to call this method: PrintDataCurrent public void PrintDataCurrentCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's average current data in the selected record is {1}\r\n", myGlsEmMcu.ToString(), myGlsEmMcu.DataLogger.DataCurrentFeedback.StringValue); CrestronConsole.ConsoleCommandResponse("Packet Structure: <end time><duration><packet type><Avg_Current A+B+C><Avg_Current A><Avg_Current B><Avg_Current C><Avg_Current Branch 1>…<Avg_Current Branch 84>"); } //Method to print the average active power measured for each channel from the selected record. This string also contains data for the total value for all active power measured on 3 mains inputs. //How to call this method: PrintDataActivePower public void PrintDataActivePowerCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's average active power data in the selected record is {1}\r\n", myGlsEmMcu.ToString(), myGlsEmMcu.DataLogger.DataActivePowerFeedback.StringValue); CrestronConsole.ConsoleCommandResponse("Packet Structure: <end time><duration><packet type><Avg_Power A+B+C><Avg_Power A><Avg_Power B><Avg_Power C><Avg_Power Branch 1>…<Avg_Power Branch 84>"); } //Method to print the peak power measured for each channel from the selected record. This string also contains data for the total value for all active power measured on 3 mains inputs. //How to call this method: PrintDataPeakPower public void PrintDataPeakPowerCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's peak power data in the selected record is {1}\r\n", myGlsEmMcu.DataLogger.ToString(), myGlsEmMcu.DataLogger.DataPeakPowerFeedback.StringValue); CrestronConsole.ConsoleCommandResponse("Packet Structure: <end time><duration><packet type><Peak_Power A+B+C><Peak_Power A><Peak_Power B><Peak_Power C><Peak_Power Branch 1>…<Peak_Power Branch 84>"); } //Method to print the amortized energy usage for each channel over the last logging period from the selected record. This packet also contains a total energy usage for all input feeds. //How to call this method: PrintEnergyUsage public void PrintEnergyUsageCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's energy usage data in the selected record is {1}\r\n", myGlsEmMcu.DataLogger.ToString(), myGlsEmMcu.DataLogger.DataEnergyUsageFeedback.StringValue); CrestronConsole.ConsoleCommandResponse("Packet Structure: <end time><duration><id><Energy A+B+C><Energy A><Energy B><Energy C><Energy Branch 1>…<Energy Branch 84>"); } //Method to print the number of pulses counted during the last log interval. //How to call this method: PrintPulseUsage public void PrintPulseUsageCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's pulse usage data in the selected record is {1}\r\n", myGlsEmMcu.DataLogger.ToString(), myGlsEmMcu.DataLogger.DataPulseUsageFeedback.StringValue); CrestronConsole.ConsoleCommandResponse("Packet Structure: <end time><duration><id><Pulse_Count 1>…<Pulse_Count 4>"); } //Method to print the power factor of all mains and branch circuits from the selected record. //How to call this method: PrintPowerFactor public void PrintPowerFactorCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's power factor data in the selected record is {1}\r\n", myGlsEmMcu.ToString(), myGlsEmMcu.DataLogger.DataPowerFactorFeedback.StringValue); CrestronConsole.ConsoleCommandResponse("Packet Structure: <end time><duration><id><Power_Factor A><Power_Factor B><Power_Factor C><Power_Factor Branch 1>…<Power_Factor Branch 84>"); } //Method to print the free running energy meter count that is the equivalent to the reading of a traditional power meter. This packet contains data for the main feeds and for the total amortized value across all main feeds. //How to call this method: PrintEnergyMeter public void PrintEnergyMeterCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's energy meter data in the selected record is {1}\r\n", myGlsEmMcu.ToString(), myGlsEmMcu.DataLogger.DataEnergyMeterFeedback.StringValue); CrestronConsole.ConsoleCommandResponse("Packet Structure: <end time><duration><id><Energy_Meter A+B+C><Energy_Meter A><Energy_Meter B><Energy_Meter C>"); } //Method to print the free running pulse count that is the equivalent to reading a conventional meter. //How to call this method: PrintPulseMeter public void PrintPulseMeterCmd(String args) { CrestronConsole.ConsoleCommandResponse("{0} device's pulse meter data in the selected record is {1}\r\n", myGlsEmMcu.ToString(), myGlsEmMcu.DataLogger.DataPulseMeterFeedback.StringValue); CrestronConsole.ConsoleCommandResponse("Packet Structure: <end time><duration><id><Energy_Meter A+B+C><Energy_Meter A><Energy_Meter B><Energy_Meter C>"); } //Method to trigger the LoggingData class properties to report the corresponding information about the next record in the log file. //How to call this method: GetNextRecord public void GetNextRecordCmd(String args) { myGlsEmMcu.DataLogger.GetNext(); } //Method to trigger the LoggingData class properties to report the corresponding information about the previous record in the log file. //How to call this method: GetPreviousRecord public void GetPreviousRecordCmd(String args) { myGlsEmMcu.DataLogger.GetPrevious(); } //Method to trigger the BranchCircuit class properties to report the corresponding real-time power values. //How to call this method: TriggerAllRtData Y to enable reporting // TriggerAllRtData N to enable reporting public void TriggerAllRealtimeDataCmd(String args) { if (args.Substring(0, 1) == "Y") { myGlsEmMcu.MasterRealTime.TriggerAllRealTimeData.BoolValue = true; } else { myGlsEmMcu.MasterRealTime.TriggerAllRealTimeData.BoolValue = true; } } //Method to set the live update rate. //How to call this method: SetLiveUpdateRate XXXXX(decimal value maximum: 65535) public void SetLiveUpdateRateCmd(String args) { myGlsEmMcu.MasterRealTime.LiveUpdateRate.UShortValue = Convert.ToUInt16(args.Substring(0, 5)); } //Method to print the specified phase real-time voltage value. //How to call this method: PrintPhaseVoltage A/B/C public void PrintPhaseVoltageCmd(String args) { var phase = Convert.ToChar(args.Substring(0, 1)); if ((phase >= 'A') && (phase <= 'C')) { var i = (ushort) (phase - 'A' + 1); CrestronConsole.ConsoleCommandResponse("Phase {0} real-time voltage value is {1}\r\n", phase, myGlsEmMcu.MasterRealTime.Phases[i].VoltageFeedback.UShortValue); } else { CrestronConsole.ConsoleCommandResponse("Phase {0} is not valid\r\n", phase); } } //Method to print the specified phase real-time active power value. //How to call this method: PrintPhActivePower A/B/C public void PrintPhaseActivePowerCmd(String args) { var phase = Convert.ToChar(args.Substring(0, 1)); if ((phase >= 'A') && (phase <= 'C')) { var i = (ushort)(phase - 'A' + 1); CrestronConsole.ConsoleCommandResponse("Phase {0} active power value is {1}\r\n", phase, myGlsEmMcu.MasterRealTime.Phases[i].ActivePowerFeedback.UShortValue); } else { CrestronConsole.ConsoleCommandResponse("Phase {0} is not valid\r\n", phase); } } //Method to print the total of real-time active power values of the three phases. //How to call this method: PrintActivePwrTotal public void PrintActivePowerTotalCmd(String args) { CrestronConsole.ConsoleCommandResponse("Total active power value is {0}\r\n", myGlsEmMcu.MasterRealTime.ActivePowerTotalFeedback.UShortValue); } //Method to print the specified pulse rate value. //How to call this method: PrintPulseRate 1 to 4 public void PrintPulseRateCmd(String args) { var pulsenumber = Convert.ToUInt16(args.Substring(0, 1)); if ((pulsenumber >= 1) && (pulsenumber <= 4)) { CrestronConsole.ConsoleCommandResponse("Pulse {0} rate value is {1}\r\n", pulsenumber, myGlsEmMcu.MasterRealTime.PulseRateFeedbacks[pulsenumber].UShortValue); } else { CrestronConsole.ConsoleCommandResponse("Pulse {0} is not valid\r\n", pulsenumber); } } //Method to trigger the reporting of all the real-time power data. //How to call this method: TriggerAllRealTimePower 1 to 4 Y enable reporting // TriggerAllRealTimePower 1 to 4 N disable reporting public void TriggerAllRealTimePowerCmd(String args) { var br = Convert.ToUInt16(args.Substring(0, 1)); if (br <= 4) { if ((args.Substring(2, 1) == "Y")) { myGlsEmMcu.Branches[br].TriggerAllRealTimePowerData.BoolValue = true; } else { myGlsEmMcu.Branches[br].TriggerAllRealTimePowerData.BoolValue = false; } } } //Method to trigger the reporting of the specified real-time power of the specified branch. //How to call this method: TriggerRealTimePower 1 to 4 01 to 21 Y enable reporting // TriggerRealTimePower 1 to 4 01 to 21 N disable reporting public void TriggerRealTimePowerCmd(String args) { var br = Convert.ToUInt16(args.Substring(0, 1)); var i = Convert.ToUInt16(args.Substring(2, 2)); if (br <= 4) { if (i <= 21) { if ((args.Substring(5, 1) == "Y")) { myGlsEmMcu.Branches[br].Circuits[i].TriggerRealTimePowerData.BoolValue = true; } else { myGlsEmMcu.Branches[br].Circuits[i].TriggerRealTimePowerData.BoolValue = false; } } else { CrestronConsole.ConsoleCommandResponse("Index {0} into the RealTimePower collection is not valid\r\n", i); } } else { CrestronConsole.ConsoleCommandResponse("Branch number {0} is not valid\r\n", br); } } //Method to print the specified real-time power value of the specified branch. //How to call this method: PrintRealTimePower 1 to 4 01 to 21 public void PrintRealTimePowerCmd(String args) { var br = Convert.ToUInt16(args.Substring(0, 1)); var i = Convert.ToUInt16(args.Substring(2, 2)); if (br <= 4) { if (i <= 21) { CrestronConsole.ConsoleCommandResponse("RealTimePower {0} value is {1}\r\n", i, myGlsEmMcu.Branches[br].Circuits[i].RealTimePowerFeedback.UShortValue); } else { CrestronConsole.ConsoleCommandResponse("Index {0} into the RealTimePower collection is not valid\r\n", i); } } else { CrestronConsole.ConsoleCommandResponse("Branch number {0} is not valid\r\n", br); } }