Click or drag to resize

Clx1Mc4 Class

CLX-1MC4 Cresnet 4 Channel Motor Control Module with 1 Feed. Controls up to four (4) bi-directional motors, such as motors that control shades or screens.

This class will trigger BaseEvent event.

Inheritance Hierarchy
SystemObject
  Crestron.SimplSharpProGenericBase
    Crestron.SimplSharpProGenericDevice
      Crestron.SimplSharpPro.LightingClx1Mc4

Namespace: Crestron.SimplSharpPro.Lighting
Assembly: Crestron.SimplSharpPro.Lighting (in Crestron.SimplSharpPro.Lighting.dll) Version: 2.21.121
Syntax
C#
public sealed class Clx1Mc4 : GenericDevice, 
	IClxDevice

The Clx1Mc4 type exposes the following members.

Constructors
 NameDescription
Public methodClx1Mc4(UInt32, CrestronControlSystem) Constructor to generate a new CLX-1MC4
Public methodClx1Mc4(UInt32, IDeviceBranch) Constructor to generate a new CLX-1MC4
Top
Properties
 NameDescription
Public propertyConnectedIpList 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)
Public propertyCode exampleDescription Get/Set the description of this device.
(Inherited from GenericBase)
Public propertyDisposed Property to indicate if the device has been disposed.
(Inherited from GenericDevice)
Public propertyErrorFeedbackSig This property is reserved for future use.

The BaseEvent event will trigger with ErrorFeedbackEventId.

Public propertyID Property to get the ID of the device.
(Inherited from GenericDevice)
Public propertyInOverrideFeedbackSig Property to indicate that the CLX-1MC4 Motor Control Module is in override mode. All four motors will turn off when the module is in override mode.

The BaseEvent event will trigger with InOverrideFeedbackEventId.

Public propertyIsOnline Property to get the current online state of the device.
(Inherited from GenericDevice)
Public propertyName Get the name of this device.
(Inherited from GenericBase)
Public propertyParent The parent that a given object was added to.
(Inherited from GenericBase)
Public propertyRegisterable Property to indicate that this device can be registered.
(Inherited from GenericDevice)
Public propertyRegistered Property to get the current registration state of the device.
(Inherited from GenericDevice)
Public propertyRegistrationFailureReason Property to get the Registration Failure Reason, this will match the return value from the call to register.
(Inherited from GenericDevice)
Protected propertySIMPLDeviceImplementation Internal protected member used for actual device control.
(Inherited from GenericDevice)
Public propertyType Property to determine to type of device this is.
(Inherited from GenericDevice)
Public propertyUnRegistrationFailureReason Property to get the Unregistration Failure Reason, this will match the return value from the call to unregister.
(Inherited from GenericDevice)
Public propertyUserSpecifiedObject Can be assigned anything that user wants.
(Inherited from GenericBase)
Protected propertyXioEndpointStubSIMPLDevice 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)
Top
Methods
 NameDescription
Public methodDispose Clean up of resources.
(Inherited from GenericBase)
Protected methodDispose(Boolean) Method to perform the actual disposing of the device.
(Inherited from GenericDevice)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Protected methodFinalize Destructor of the device.
(Inherited from GenericDevice)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Protected methodOnBaseEvent(Int32) Protected member used to fire the BaseEvent with the default extended information.
(Inherited from GenericBase)
Protected methodOnBaseEvent(Int32, UInt16) Protected member used to fine the BaseEvent with extended event information.
(Inherited from GenericBase)
Public methodRegister Register this device with the system.
(Inherited from GenericDevice)
Public methodToString Return the name of the device.
(Inherited from GenericDevice)
Public methodUnRegister 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)
Top
Events
 NameDescription
Public eventBaseEvent Generic base event, triggered when the there are no other handlers available for a specific EventID.
(Inherited from GenericBase)
Public eventIpInformationChange 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)
Public eventOnlineStatusChange Event triggered when the Online status of the device changes.
(Inherited from GenericDevice)
Top
Fields
 NameDescription
Public fieldMotors Collection of Motors for CLX-1Mc4 Motor Control Module.
Public fieldStatic memberNumberOfClx1Mc4Loads Number of Motors the CLX-1Mc4 Motor Control Module controls.
Top
Example
C#
static Clx1Mc4 clx1Mc4;

   public ControlSystemClx1Mc4()
   {
       //Register console commands
       CrestronConsole.AddNewConsoleCommand(CreateDeviceCmd, "CreateDevice", "This is a CLX-1MC4 Motor Control Module CreateDevice command", ConsoleAccessLevelEnum.AccessOperator);
       CrestronConsole.AddNewConsoleCommand(SetMotorStateCmd, "SetMotorState", "This is a CLX-1MC4 Motor Control Module SetMotorState command", ConsoleAccessLevelEnum.AccessOperator);
       CrestronConsole.AddNewConsoleCommand(SetMaximumTimeCmd, "SetMaximumTime", "This is a CLX-1MC4 Motor Control Module SetMaximumTime command", ConsoleAccessLevelEnum.AccessOperator);
   }

   // Method to handle sig change events for CLX-1MC4 Motor Control Module
   static void Clx1Mc4_EventHandler(GenericDevice device, BaseEventArgs args)
   {
       if (args.EventId == ClxEventIds.ErrorFeedbackEventId)
       {
           CrestronConsole.PrintLine("Error Feedback Event Received");
       }
       else if (args.EventId == ClxEventIds.InOverrideFeedbackEventId)
       {
           CrestronConsole.PrintLine("InOverride Feedback Event Received");
       }
   }

   //Method to create the CLX-1MC4 device
   //How to use this command:  CreateDevice
   public void CreateDeviceCmd(String args)
   {
       //Initialize the CLX-1MC4 device for Cresnet Communication
       clx1Mc4 = new Clx1Mc4(0x17, this);
       CrestronConsole.ConsoleCommandResponse("CLX-1MC4 device successfully created with CresnetID : {0}", clx1Mc4.ID);

       clx1Mc4.BaseEvent += Clx1Mc4_EventHandler;

       //Register the CLX-1MC4 Cresnet Motor Control device with the Control system
       clx1Mc4.Register();
   }

   //Method to set the state of the motor the CLX-1MC4 Motor Control Module controls
   //How to use the command:   SetMotorState 1/2 (Motor Number) 0-9 (Motor State)
   public void SetMotorStateCmd(String args)
   {
       uint state = Convert.ToUInt16(args.Substring(2, 1));
       uint motorNumber = Convert.ToUInt16(args.Substring(0, 1));

       clx1Mc4.Motors[motorNumber].MotorState = (eClxMotorState)state;
       CrestronConsole.PrintLine("Motor {0} state is set to {1}", motorNumber, clx1Mc4.Motors[motorNumber].MotorState);
   }

   //Method to set the maximum time to move the specified motor
   //How to use the command:   SetMaximumTime  (Motor Number - 1/2) (Value - in range from 00000 to 65535)
   public void SetMaximumTimeCmd(String args)
   {
       var motorNumber = Convert.ToUInt16(args.Substring(0, 1));

       clx1Mc4.Motors[motorNumber].ParameterMaximumTime = Convert.ToUInt16(args.Substring(2, 5));
       CrestronConsole.ConsoleCommandResponse("Motor {0} Maximum Time is set to {1}\r\n", motorNumber, clx1Mc4.Motors[motorNumber].ParameterMaximumTime);
   }

Version Information

.NET

Supported in: 6.0

.NET Compact Framework

Supported in: 3.5
See Also