Home AMX User Forum AMX General Discussion

Sherbourn T100

Has anyone out there interfaced with a Sherbourn T100 tuner. It's my first and any background info on this device would be helpful.

Comments

  • vincenvincen Posts: 526
    Here is a module I made that works out of box to control that equipment ;) Be very careful about something, if you send a new command when tuner is still processing a previous command, you'll crash it and only way to get it back to life is to unplug power on it :)

    Hope it helps :)

    Vinc?n
    MODULE_NAME='Tuner' (dev dvTuner, dev dvTP)
    (***********************************************************)
    (*  FILE CREATED ON: 05/01/2007  AT: 17:02:10              *)
    (***********************************************************)
    (*  FILE_LAST_MODIFIED_ON: 10/18/2007  AT: 19:37:50        *)
    (***********************************************************)
    (***********************************************************)
    (*          DEVICE NUMBER DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_DEVICE
    
    dvMaster = 0:1:0
    
    (***********************************************************)
    (*               VARIABLE DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_VARIABLE
    
    CONSTANT INTEGER INTERRO = 1 // Timeline number
    LONG TEMPO[1] = 1000 // 1 s
    INTEGER FREQUENCY
    INTEGER PRESET
    
    (***********************************************************)
    (*       MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW           *)
    (***********************************************************)
    DEFINE_MUTUALLY_EXCLUSIVE
    
    ([dvTP,3],[dvTP,4])  // Stereo/Mono Buttons
    ([dvTP,7],[dvTP,8]) // AM/FM Buttons
    ([dvTP,18]..[dvTP,23]) // Presets Buttons
    
    (***********************************************************)
    (*        SUBROUTINE/FUNCTION DEFINITIONS GO BELOW         *)
    (***********************************************************)
    
    (***********************************************************)
    (*                THE EVENTS GO BELOW                      *)
    (***********************************************************)
    DEFINE_EVENT
    
    DATA_EVENT[dvTuner] // Init of RS-232 port
    	{
    	ONLINE:
    		{
    		SEND_COMMAND DATA.DEVICE,'SET BAUD 9600,N,8,1 485 DISABLE'
    		SEND_STRING DATA.DEVICE,"'00_10_01_02',$D" // Put Tuner on at startup
    		TIMELINE_CREATE(INTERRO,TEMPO,1,TIMELINE_ABSOLUTE,TIMELINE_REPEAT)
    		}
    	STRING:
    		{
    		IF (FIND_STRING(DATA.TEXT,'AM',1)) // AM Mode
    			{
    			ON[dvTP,8]
    			}
    		IF (FIND_STRING(DATA.TEXT,'FM',1)) // FM Mode
    			{
    			ON[dvTP,7]
    			}
    		IF (FIND_STRING(DATA.TEXT,'MONO',1)) // Mono Mode
    			{
    			ON[dvTP,4]
    			}
    		IF (FIND_STRING(DATA.TEXT,'STEREO',1)) // Stereo Mode
    			{
    			ON[dvTP,3]
    			}
    		IF (FIND_STRING(DATA.TEXT,'FREQ',1)) // Frequency of current station
    			{
    			FREQUENCY = ATOI(MID_STRING(DATA.TEXT,FIND_STRING(DATA.TEXT,'FREQ',1),15))
    			IF ([dvTP,7]) // We are in FM so we need dot ;)
    				{
    				SEND_COMMAND dvTP,"'TEXT1-',ITOA(FREQUENCY/100),'.',ITOA(FREQUENCY MOD 100)"
    				}
    			ELSE IF ([dvTP,8]) // We are in AM so no dot
    				{
    				SEND_COMMAND dvTP,"'TEXT1-',ITOA(FREQUENCY)"
    				}
    			}
    		IF (FIND_STRING(DATA.TEXT,'PRESET',1)) // Active Preset
    			{
    			PRESET = ATOI(MID_STRING(DATA.TEXT,FIND_STRING(DATA.TEXT,'PRESET',1),11))
    			IF (PRESET)
    				{
    				ON[dvTP,PRESET + 17]
    				}
    			ELSE
    				{
    				TOTAL_OFF[dvTP,18]	TOTAL_OFF[dvTP,19]	TOTAL_OFF[dVTP,20]	TOTAL_OFF[dvTP,21]	TOTAL_OFF[dvTP,22]	TOTAL_OFF[dvTP,23]
    				}
    			}
    		}
    	}
    
    TIMELINE_EVENT[INTERRO]
    	{
    	SEND_STRING dvTuner,"'00_10_11_05',$D" // Request Status of Tuner
    	}
    
    BUTTON_EVENT[dvTP,0]
    	{
    	PUSH:
    		{
    		CANCEL_WAIT 'TIMELINE'
    		TIMELINE_PAUSE(INTERRO)
    		SWITCH(BUTTON.INPUT.CHANNEL)
    			{
    			CASE 10:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_9_1',$D" // Auto-tune up frequency Seek +
    					}
    				}
    			CASE 11:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_9_2',$D" // Auto-tune up frequency Seek -
    					}
    				}
    			CASE 12:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_9_3',$D" // Step +
    					}
    				}
    			CASE 13:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_9_4',$D" // Step -
    					}
    				}
    			CASE 16:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_2_3',$D" // Change Band
    					}
    				}
    			CASE 18:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_3_1',$D" // Preset 1010 Wins
    					}
    				}
    			CASE 19:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_3_2',$D" // Preset AM 820
    					}
    				}
    			CASE 20:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_3_3',$D" // Preset Jazz 99
    					}
    				}
    			CASE 21:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_3_4',$D" // Preset WFAS 103.9
    					}
    				}
    			CASE 22:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_3_5',$D" // Preset WNYC 93.9
    					}
    				}
    			CASE 23:
    				{
    				WAIT 5
    					{
    					SEND_STRING dvTuner,"'00_10_3_6',$D" // Preset WQXR 96.3
    					}
    				}
    			}
    		WAIT 20 'TIMELINE'
    			{
    			TIMELINE_RESTART(INTERRO)
    			}
    		}
    	}
    	
    (***********************************************************)
    (*                     END OF PROGRAM                      *)
    (*        DO NOT PUT ANY CODE BELOW THIS COMMENT           *)
    (***********************************************************)
    
  • Could some one tell me how to properly channel map this Module? I
  • vincenvincen Posts: 526
    sickkick wrote:
    Could some one tell me how to properly channel map this Module? I

    I did that module in a hurry for a job, so I did not take time to get channels mapped in a DEVCHAN so you'll need to either use same channels than me or add a devchan in program, remove dvTP reference ;)

    Vinc
  • trobertstroberts Posts: 228
    There is an include file and example file available at
    http://modulemarketplace.com/index.php?l=product_detail&p=20 it
Sign In or Register to comment.