public int getTangoVersion() throws DevFailed {

        //  Get idl for administrative device
        int adminIdl = get_adm_dev().get_idl_version();

        //  Check with ZmqEventSubscriptionChange command
        //  since 9.1.0 this command returns Tango release in info mode
        int version = getTangoVersionFromZmqEventSubscriptionChange();
        if (version>900)    //  Found
            return version;

        //  Get the command list
        CommandInfo[] commandInfoList = get_adm_dev().command_list_query();

        //  Check between idl and commands
        switch (adminIdl) {
            case 1:
                return 100;
            case 2:
                return 200;
            case 3:
                //  IDL 3 is for Tango 5 and 6. Unfortunately,
                //  there is no way from the client side to determine if it is Tango 5 or 6.
                //  The best we can do is to get the info that it is Tango 5.2 (or above)
                for (CommandInfo commandInfo : commandInfoList) {
                    if (commandInfo.cmd_name.equals("QueryWizardClassProperty"))
                        return 520;
                }
                //  Not found
                return 500;
            case 4:
                //  try if tango 8.1 (Confirm for several events)
                for (CommandInfo commandInfo : commandInfoList) {
                    if (commandInfo.cmd_name.equals("EventConfirmSubscription"))
                        return 810;
                }
                //  try if tango 8.0 (ZMQ system)
                for (CommandInfo commandInfo : commandInfoList) {
                    if (commandInfo.cmd_name.equals("ZmqEventSubscriptionChange"))
                        return 800;
                }
                return 700;
             case 5:
			 	return 900;
       }

        //  Not found
        return 0;
    }
public int getTangoVersion ( ) throws DevFailed { int adminIdl = get_adm_dev ( ) . get_idl_version ( ) ; int version = getTangoVersionFromZmqEventSubscriptionChange ( ) ; if ( version > 900 ) return version ; CommandInfo [ ] commandInfoList = get_adm_dev ( ) . command_list_query ( ) ; switch ( adminIdl ) { case 1 : return 100 ; case 2 : return 200 ; case 3 : for ( CommandInfo commandInfo : commandInfoList ) { if ( commandInfo . cmd_name . equals ( "QueryWizardClassProperty" ) ) return 520 ; } return 500 ; case 4 : for ( CommandInfo commandInfo : commandInfoList ) { if ( commandInfo . cmd_name . equals ( "EventConfirmSubscription" ) ) return 810 ; } for ( CommandInfo commandInfo : commandInfoList ) { if ( commandInfo . cmd_name . equals ( "ZmqEventSubscriptionChange" ) ) return 800 ; } return 700 ; case 5 : return 900 ; } return 0 ; }
===================================================================