Home AMX Resource Management Suite Software

RMS Serial and Model

Hi Guys,

Just wondering how you deal with the registration of assets with Serial Number and Model Numbers as they cannot be change after registration.

Hopefully PhreaK sees this as he had suggested the use of #IF_DEFINED's but I can't seen to get that working properly.

Below is a snippet from a Projector, I pass a serial and model number to the module. Then I say, within registerasset, if they are both not '' go ahead and register... this does not work.
//*********************************************************************
//
//             AMX Resource Management Suite  (4.1.13)
//
//*********************************************************************
/*
 *  Legal Notice :
 *
 *     Copyright, AMX LLC, 2011
 *
 *     Private, proprietary information, the sole property of AMX LLC.  The
 *     contents, ideas, and concepts expressed herein are not to be disclosed
 *     except within the confines of a confidential relationship and only
 *     then on a need to know basis.
 *
 *     Any entity in possession of this AMX Software shall not, and shall not
 *     permit any other person to, disclose, display, loan, publish, transfer
 *     (whether by sale, assignment, exchange, gift, operation of law or
 *     otherwise), license, sublicense, copy, or otherwise disseminate this
 *     AMX Software.
 *
 *     This AMX Software is owned by AMX and is protected by United States
 *     copyright laws, patent laws, international treaty provisions, and/or
 *     state of Texas trade secret laws.
 *
 *     Portions of this AMX Software may, from time to time, include
 *     pre-release code and such code may not be at the level of performance,
 *     compatibility and functionality of the final code. The pre-release code
 *     may not operate correctly and may be substantially modified prior to
 *     final release or certain features may not be generally released. AMX is
 *     not obligated to make or support any pre-release code. All pre-release
 *     code is provided "as is" with no warranties.
 *
 *     This AMX Software is provided with restricted rights. Use, duplication,
 *     or disclosure by the Government is subject to restrictions as set forth
 *     in subparagraph (1)(ii) of The Rights in Technical Data and Computer
 *     Software clause at DFARS 252.227-7013 or subparagraphs (1) and (2) of
 *     the Commercial Computer Software Restricted Rights at 48 CFR 52.227-19,
 *     as applicable.
*/
MODULE_NAME='RmsNlVideoProjectorMonitor'(DEV vdvRMS,
                                         DEV vdvDeviceModule,
                                         DEV dvMonitoredDevice,
					CHAR SERIAL_NUMBER[],
				CHAR MODEL_NUMBER[])

(***********************************************************)
(* System Type : NetLinx                                   *)
(***********************************************************)
// This compiler directive is provided as a clue so that other include
// files can provide SNAPI specific behavior if needed.
#DEFINE SNAPI_MONITOR_MODULE;

//
// Has-Properties
//
#DEFINE HAS_POWER
#DEFINE HAS_LAMP
#DEFINE HAS_DISPLAY_ASPECT_RATIO
#DEFINE HAS_SOURCE_SELECT
#DEFINE HAS_VOLUME

(***********************************************************)
(*               CONSTANT DEFINITIONS GO BELOW             *)
(***********************************************************)
DEFINE_CONSTANT

// RMS Asset Properties (Recommended)
CHAR MONITOR_ASSET_NAME[]             = 'Video Projector';


// RMS Asset Properties (Optional)
CHAR MONITOR_ASSET_DESCRIPTION[]      = '';
CHAR MONITOR_ASSET_MANUFACTURERNAME[] = '';
CHAR MONITOR_ASSET_MODELNAME[]        = '';
CHAR MONITOR_ASSET_MANUFACTURERURL[]  = '';
CHAR MONITOR_ASSET_MODELURL[]         = '';
CHAR MONITOR_ASSET_SERIALNUMBER[]     = '';
CHAR MONITOR_ASSET_FIRMWAREVERSION[]  = '';


// This module's version information (for logging)
CHAR MONITOR_NAME[]       = 'RMS Video Projector Monitor';
CHAR MONITOR_DEBUG_NAME[] = 'RmsNlVidProjMon';
CHAR MONITOR_VERSION[]    = '4.1.13';


(***********************************************************)
(*              DATA TYPE DEFINITIONS GO BELOW             *)
(***********************************************************)
DEFINE_TYPE

(***********************************************************)
(*               VARIABLE DEFINITIONS GO BELOW             *)
(***********************************************************)
DEFINE_VARIABLE

// RMS Metadata Property Values
#IF_DEFINED HAS_LAMP
    METADATA_PROPERTY_LAMP_WARMUP_TIME    = 45;
    METADATA_PROPERTY_LAMP_COOLDOWN_TIME  = 120;
    METADATA_PROPERTY_LAMP_THRESHOLD      = 1200;
#END_IF

#IF_DEFINED HAS_DISPLAY_ASPECT_RATIO
    METADATA_PROPERTY_ASPECT_RATIO_COUNT     = 3;
    CHAR METADATA_PROPERTY_ASPECT_RATIO[100] = 'Normal|Anamorphic|Widescreen';
    CHAR METADATA_PROPERTY_VIDEO_TYPES[100]  = 'Auto|NTSC|PAL|SECAM';
#END_IF

#IF_DEFINED HAS_SOURCE_SELECT
    METADATA_PROPERTY_SOURCE_INPUT_COUNT     = 5;
    CHAR METADATA_PROPERTY_SOURCE_INPUT[100] = 'VGA 1|HDMI 1|DVI 1|Video 1|S-Video 1';
#END_IF

#IF_DEFINED HAS_VOLUME
    SLONG   METADATA_PROPERTY_VOL_LVL_MIN     = 0;
    SLONG   METADATA_PROPERTY_VOL_LVL_MAX     = 255;
    INTEGER METADATA_PROPERTY_VOL_LVL_STEP    = 1;
    SLONG   METADATA_PROPERTY_VOL_LVL_INIT    = 0;
    SLONG   METADATA_PROPERTY_VOL_LVL_RESET   = 0;
    CHAR    METADATA_PROPERTY_VOL_LVL_UNITS[] = '';
#END_IF


// RMS timelines to accumulate hours [RmsNlTimer.axi] (support for up to 5 user-defined timelines, plus 3 snapi-defined timelines)
  CONSTANT LONG TL_OFFSET                    = 0
//CONSTANT LONG TL_MONITOR_1                 = 1;   // Unused
//CONSTANT LONG TL_MONITOR_2                 = 2;   // Unused
//CONSTANT LONG TL_MONITOR_3                 = 3;   // Unused
//CONSTANT LONG TL_MONITOR_4                 = 4;   // Unused
//CONSTANT LONG TL_MONITOR_5                 = 5;   // Unused
  CONSTANT LONG TL_MONITOR_POWER_ON          = 6;   // Power on
  CONSTANT LONG TL_MONITOR_LAMP_RUNTIME      = 7;   // Lamp hours
  CONSTANT LONG TL_MONITOR_TRANSPORT_RUNTIME = 8;   // Transports

  CONSTANT INTEGER TL_MAX_COUNT              = 8;


(***********************************************************)
(*               INCLUDE DEFINITIONS GO BELOW              *)
(***********************************************************)

// include RMS MONITOR COMMON AXI
#INCLUDE 'RmsMonitorCommon';

// include SNAPI
#INCLUDE 'SNAPI';

#INCLUDE 'RmsNlTimer';
#INCLUDE 'RmsNlSnapiComponents';


(***********************************************************)
(*        SUBROUTINE/FUNCTION DEFINITIONS GO BELOW         *)
(***********************************************************)

(***********************************************************)
(* Name:  RegisterAsset                                    *)
(* Args:  RmsAsset asset data object to be registered .    *)
(*                                                         *)
(* Desc:  This is a callback method that is invoked by     *)
(*        RMS to notify this module that it is time to     *)
(*        register this asset.                             *)
(*                                                         *)
(*        This method should not be invoked/called         *)
(*        by any user implementation code.                 *)
(***********************************************************)
DEFINE_FUNCTION RegisterAsset(RmsAsset asset)
{
	IF(MODEL_NUMBER != '' && SERIAL_NUMBER != '')
	{
		// Client key must be unique for this master (recommended to leave it as DPS)
		asset.clientKey         = RmsDevToString(dvMonitoredDevice);
	
		// These are recommended
		asset.name              = MONITOR_ASSET_NAME;
		asset.assetType         = RMS_ASSET_TYPE_VIDEO_PROJECTOR;
	
		// These are optional
		asset.description       = MONITOR_ASSET_DESCRIPTION;
		asset.manufacturerName  = MONITOR_ASSET_MANUFACTURERNAME;
		asset.modelName         = MODEL_NUMBER;
		asset.manufacturerUrl   = MONITOR_ASSET_MANUFACTURERURL;
		asset.modelUrl          = MONITOR_ASSET_MODELURL;
		asset.serialNumber      = SERIAL_NUMBER;
		asset.firmwareVersion   = MONITOR_ASSET_FIRMWAREVERSION;
	
		// perform registration of this asset
		RmsAssetRegister(dvMonitoredDevice, asset);
	}
}

I want the code to obtain the model/serial before registration.

Thanks,

Cameron

Comments

  • filpeefilpee Junior Member Posts: 64
    So whats the result with your code? Does it register at all?

    Assuming its not registering at all, wait until you have the info you need then ON[vdvDeviceModule,DATA_INITIALIZED]. If you think about, it your module has not really fully initialized until after it has the serial and model numbers.

    RmsMonitorCommon will trigger an asset registration when DATA_INITIALIZED goes true.
  • cmatkincmatkin Senior Member Posts: 86
    Hi all,

    The module only registers upon an INITIALISED channel event.
    Your Meta variables need to be defined as a variable and not a constant, then get the comms modules to populate.

    Regards
    Craig
  • CameronCameron Junior Member Posts: 56
    Sweet I didn't even think about the initialized channel!! Thanks, I will give it a go.

    Cameron
Sign In or Register to comment.