Home AMX User Forum AMX General Discussion

Autopatch Modula Matrix switcher cut off randomly

Had anyone experienced this situation? I have a very simple system, only one autopatch modula switcher,one Tuner source and 1 Ni2100 controller. The autopatch switcher cut off the tuner source randomly, sometimes 3,4 times a day. I was onsite today, had been monitoring the netlinx studio notification log for 2 hours, it didn't not happen, but tonight, the client called, the tuner cut off again when they paying tuner. I check the program, I don't have any command send to the autopatch without button press. when the tuner playing, the autopatch just suddenly cut off the tuner, client had to re-press the tuner button to make it work again, which will send command to autopatch switcher like send_string dvAP, "'CL2I1O2'",in this system, I didn't not use AMX module, only basic command. any idea for this kind of issue? BTW, I changed the tuner, this problem still exist.
Thanks,

Jacky

Comments

  • John NagyJohn Nagy Posts: 1,742
    Isolate the variables. In this case, test by selecting the tuner, then UNPLUG the serial cable to the autopatch. Let it play. If it cuts off with nothing attached, the switch is doing it all by itself and is defective. If not, look at your program more carefully. It's very unlikely to be the NetLinx itself generating accidental codes that are commanding the switch.
  • yanbinyanbin Posts: 86
    I replaced the netlinx controller once, still had the same problem. I will check my code again.
  • the8thstthe8thst Posts: 470
    John has the right idea.

    If the problem is in code here are a couple functions you can drop in to create a log that you can look at later on:
    //
    	define_function char[60] getFileError (slong slErr)
    	{
    		switch (abs_value(slErr))
    		{
    			case 0: return '(0) Success'
    			case 1: return '(-1) Invalid File Handle'
    			case 2: return '(-2) Invalid File Path or Name'
    			case 3: return '(-3) Invalid Value Supplied for IO Flag'
    			case 4: return '(-4) Invalid Directory Path'
    			case 5: return '(-5) Disk I/O Error'
    			case 6: return '(-6) Invalid Parameter'
    			case 7: return '(-7) File Already Closed'
    			case 8: return '(-8) File Name Already Exists'
    			case 9: return '(-9) End Of File Reached'
    			case 10: return '(-10) size of DirPath buffer too small for dir path name'
    			case 11: return '(-11) Disk Full'
    			case 13: return '(-13) Directory Already Exists'
    			case 14: return '(-14) Max Num Files Already Open (10)'
    			case 15: return '(-15) Invalid File Format'
    			default: return "'(default) slErr[ ',itoa(slErr),' ]'"
    		}
    	}
    	
    	//
    	define_function integer logToFile (char msg[])
    	{
    		stack_var slong slDir
    		stack_var slong slFile
    		stack_var slong slResult
    		stack_var char logMsg[200]
    		
    		slDir = file_createdir('\LOGS\')
    		
    		logMsg = "'',date,' ',time,'--> ',msg,10"
    		
    		if (slDir == 0 || slDir == -13) {
    			slFile = file_open('\LOGS\log.txt',file_rw_append)
    			
    			if (slFile > 0) {
    				slResult = file_write(slFile,logmsg,length_string(logMsg))
    				file_close(slFile)
    			} else {
    				send_string 0, "'<logToFile> Directory OK: File Error[',getFileError(slFile),']'"
    			}
    		} else {
    			send_string 0,"'<logToFile> File Error[',getFileError(slDir),']'"
    		}
    	}
    

    You can use the function to log the strings coming from the Autopatch and you can add the line directly above all of you send_string lines for controlling the switcher. I don't know how your code is structured, but there are a lot of places to log a line of info. Like so:
    data_event[dvSwitcher]
    	{
    		string: {
    			logToFile('received from Modula[ ',data.text,' ]'")
    		}
    	}
    	
    	//
    	//
    	//
    	logToFile('sending to Modula[ ',cCommand,' ]'")
    	send_string dvModula, "cCommand"
    

    Those are just two ideas to get you started. You then read the log by FTPing into the master and opening it in any text editor.
  • yanbinyanbin Posts: 86
    Finally I found out the problem. It was autopatch switcher output volume level too low, when the client set volume level less than 30%, it cut off the amplifier.
Sign In or Register to comment.