Home AMX User Forum NetLinx Studio

Netlinx Crash when try Using Debugging

Hi All,

recently, when i try the debugging function

if i want to add a variables from list. the application is crashing.

someone else having this problem.

Comments

  • the8thstthe8thst Posts: 470
    Try clearing out the "C:\Users\*user_name*\AppData\Local\Temp" folder. AMX likes to store a lot in there and I have had issues with too many instances of duet transfer items building up in the folder and causing NS to crash.
  • DHawthorneDHawthorne Posts: 4,584
    Make sure your project was compiled with debug turned on. I'm not sure if that will cause a crash, but it certainly won't work if it's off, and default is off. Also, I have found that older processors are more likely to choke on watch variables that are too complex, or if you have too many being watched at once.
  • RaphayoRaphayo Posts: 111
    I found it came from a custom module create to control a device. if more than 1 instance of that module is currently use. Netlinx Studio Crash when using debug.

    any clue on that.

    it can came from the way variable are use inside the module.

    thanks
  • ericmedleyericmedley Posts: 4,177
    PMRaphayo
    Please post your code around the module declaration (DEFINE_MODULE .....)

    Perhaps it's just a little error there.
  • RaphayoRaphayo Posts: 111
    Module_NAME='LgMonitorModule' (DEV dvport, DEV dvtp, integer nButton[])
    
    (***********************************************************)
    (***********************************************************)
    (*  FILE_LAST_MODIFIED_ON: 04/05/2006  AT: 09:00:25        *)
    (***********************************************************)
    (* System Type : NetLinx                                   *)
    (***********************************************************)
    (* REV HISTORY:                                            *)
    (***********************************************************)
    (* BUTTON AND TEXT BOX DEFINITIONS
    1-  ATV Input
    2-  AV1 Input
    3-  AV2 input    
    4-  Component input
    5-  VGA input
    6-  HDMI1 Input
    7-  HDMI2 Input
    20  Power Off
    21  Power On
    23  Mute On
    30  Volume up
    31  Volume down
    84  
    85  Online/Offline
    END OF BUTTON AND TEXT BOX DEFINITIONS*)
    
    (* START OF LEVEL DEFINITIONS
    86  Volume Level
     End OF LEVEL DEFINITIONS*)
      
    (*
        $History: $
    *)
    (***********************************************************)
    (*          DEVICE NUMBER DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_DEVICE
    
    
    (***********************************************************)
    (*               CONSTANT DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_CONSTANT
    
    Integer False = 0
    Integer True = 1
    //TLLG	= 6 // TimeLine for LG Monitor1 Polling
    
    CHAR LG_Power_ON[]={'k','a',$20,'0','1',$20,'0','1',$0d} // On
    CHAR LG_Power_OFF[]={'k','a',$20,'0','1',$20,'0','0',$0d} // Off
    CHAR LG_Power_Get[] = {'k','a',$20,'0','1',$20,'F','F',$0d} // Get
    
    CHAR LG_DTV1[] = {'x','b',$20,'0','1',$20,'0','0',$0d} // DTV1
    CHAR LG_DTV2[] = {'x','b',$20,'0','1',$20,'0','1',$0d} // DTV2
    CHAR LG_ATV1[] = {'x','b',$20,'0','1',$20,'1','0',$0d} // ATV1
    CHAR LG_ATV2[] = {'x','b',$20,'0','1',$20,'1','1',$0d} // ATV2
    CHAR LG_AV1[] = {'x','b',$20,'0','1',$20,'2','0',$0d} // AV1
    CHAR LG_AV2[] = {'x','b',$20,'0','1',$20,'2','1',$0d} // AV2
    CHAR LG_AV3[] = {'x','b',$20,'0','1',$20,'4','0',$0d} // Component1
    CHAR LG_AV4[] = {'x','b',$20,'0','1',$20,'4','1',$0d} // Component2
    CHAR LG_RGB[] = {'x','b',$20,'0','1',$20,'6','0',$0d} // RGB
    CHAR LG_HD1[] = {'x','b',$20,'0','1',$20,'9','0',$0d} // HDMI 1
    CHAR LG_HD2[] = {'x','b',$20,'0','1',$20,'9','1',$0d} // HDMI 2
    CHAR LG_HD3[] = {'x','b',$20,'0','1',$20,'9','2',$0d} // HDMI 3
    CHAR LG_Source_Get[] = {'x','b',$20,'0','1',$20,'F','F',$0d} //Get Input
    
    CHAR LG_Volume_Get[] = {'k','f',$20,'0','1',$20,'F','F',$0d} //Get Volume
    
    CHAR LG_Volume_On[] = {'k','e',$20,'0','1',$20,'0','1',$0d} //Mute Off
    CHAR LG_Volume_Off[] = {'k','e',$20,'0','1',$20,'0','0',$0d} //Mute On
    CHAR LG_Mute_Get[] = {'k','e',$20,'0','1',$20,'F','F',$0d} //Mute Get
    
    
    Integer nLG_Warmdly = 100	// 10 Sec.
    Integer nLG_ReadyOff = 150	// 15 Sec.
    Integer nLG_Cooldly = 150	// 15 Sec.
    Integer nLG_Cmd = 30	// 3 Sec.
    
    (***********************************************************)
    (*              DATA TYPE DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_TYPE
    
    (***********************************************************)
    (*               VARIABLE DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_VARIABLE
    
    volatile integer nSelection = 0 // Last Button Press
    
    volatile integer DebugLgMonitorModule = 0
    
    //LONG TLLGMonitorTime[4]={2000,2000,2000,2000}
    
    volatile integer nLGLock = 0		//LGNotReady
    volatile integer nLGOffreq = 0	//LG Power Off Request
    volatile integer nLGOnreq = 0	//LG Power On Request
    volatile integer nLGDly	 = 0	//LG Delay
    volatile integer nLGOn = 0		//LG power state
    volatile integer nLGOff	= 1	//LG Power state
    volatile integer nLGReady = 1	//LG is ready
    volatile integer nLGWarm = 0		//LG Warming
    volatile integer nLGCool = 0		//LG Cooling
    volatile integer nLGr2Off = 0	//LG Ready to Off
    volatile integer nLGr2On = 0		//LG Ready to On
    volatile integer nLGBusy = 0		//LG is Fully Busy
    volatile integer nLGSequence = 1 	//LG Command Sequence 1: Power, 2: Source, 3: Volume
    volatile integer nLGPowerFb = 0	//LGMonitor Power Feedback
    volatile integer nLGSourceFb = 0	//LGMonitor Source Feedback
    volatile integer nLGVolumeFb = 0	//LGMonitor Volume Feedback
    volatile integer nLGMuteFb = 0	//LGMonitor Mute Feedback
    
    (***********************************************************)
    (*               LATCHING DEFINITIONS GO BELOW             *)
    (***********************************************************)
    DEFINE_LATCHING
    
    (***********************************************************)
    (*       MUTUALLY EXCLUSIVE DEFINITIONS GO BELOW           *)
    (***********************************************************)
    DEFINE_MUTUALLY_EXCLUSIVE
    (nLGOnreq,nLGOffreq) // One or the other not the both of them should be request
    
    (***********************************************************)
    (*        SUBROUTINE/FUNCTION DEFINITIONS GO BELOW         *)
    (***********************************************************)
    (* EXAMPLE: DEFINE_FUNCTION <RETURN_TYPE> <NAME> (<PARAMETERS>) *)
    (* EXAMPLE: DEFINE_CALL '<NAME>' (<PARAMETERS>) *)
    
    DEFINE_FUNCTION fnCLEAR_INPUT()
    {
        STACK_VAR INTEGER i
        for(i=1;i<=7;i++)
        {
    	OFF[dvport,nBUTTON[i]]
        }
    }
    
    DEFINE_CALL 'LGPower' (nLGPower)// Power Selection
    {
     IF(!nLGDly)
     {
        SWITCH (nLGPower)
        {
    	CASE 1:
    	{
    	    ON[nLGDly]
    	    ON[nLGLock]
    	    WAIT nLG_Warmdly off[nLGdly]
    	    WAIT nLG_ReadyOff off[nLGLock]
    	    on[nLGOn]
    	    on[nLGOnreq]
    //	    nLGSequence = 1
    	    send_string dvport,LG_Power_ON
    	}
    	
    	DEFAULT:
    	{
    	    ON[nLGDly]
    	    ON[nLGLock]
    	    wAIT nLG_Cooldly off[nLGdly]
    	    WAIT nLG_cooldly OFF[nLGLock]
    //	    nLGSequence = 1
    	    SEND_STRING dvport,LG_Power_OFF
    	    off[nLGOn]
    	    on[nLGOffreq]
    	}
        }
     }
    }
    
    DEFINE_CALL 'LGInput' (Integer nLGInput) // Input Selection
    {
        IF(!nLGDly)
        {
    	SWITCH (nLGPowerFb)
    	{
    	    CASE 1:
    	    {
    		ON[nLGDly]
    		WAIT nLG_Cmd OFF[nLGDly]
    //		nLGSequence = 2
    		select
    		{
    		    active(nLGInput=10): SEND_STRING dvport,LG_ATV1
    		    active(nLGInput=20): SEND_STRING dvport,LG_AV1
    		    active(nLGInput=21): SEND_STRING dvport,LG_AV2
    		    active(nLGInput=40): SEND_STRING dvport,LG_AV3
    		    active(nLGInput=60): SEND_STRING dvport,LG_RGB
    		    active(nLGInput=90): SEND_STRING dvport,LG_HD1
    		    active(nLGInput=91): SEND_STRING dvport,LG_HD2
    		}
    	    }
    	    DEFAULT:
    	    {
    		ON[nLGDly]
    		ON[nLGLock]
    		WAIT nLG_Warmdly off[nLGdly]
    		WAIT nLG_ReadyOff off[nLGLock]
    		on[nLGOn]
    		on[nLGOnreq]
    //		nLGSequence = 1
    		send_string dvport,LG_Power_ON
    		WAIT_UNTIL (!nLGdly)
    		{
    //		    nLGSequence = 2
    		    if(DebugLgMonitorModule) send_string 0,"'dvLG Input Select:',itoa(nLGInput)"
    		    select
    		    {
    			active(nLGInput=10): SEND_STRING dvport,LG_ATV1
    			active(nLGInput=20): SEND_STRING dvport,LG_AV1
    			active(nLGInput=21): SEND_STRING dvport,LG_AV2
    			active(nLGInput=40): SEND_STRING dvport,LG_AV3
    			active(nLGInput=60): SEND_STRING dvport,LG_RGB
    			active(nLGInput=90): SEND_STRING dvport,LG_HD1
    			active(nLGInput=91): SEND_STRING dvport,LG_HD2
    		    }
    		}
    	    }
    	}
        }
    }
    
    DEFINE_CALL 'LGVolume' (integer nLGValue) // Volume Control
    {
        IF(nLGPowerFb)
        {
    	//ON[nLGDly]
    	//WAIT nLG_Cmd OFF[nLGDly]
    //	nLGSequence = 3
    	SEND_STRING dvport,"'kf',$20,'01',$20,format('%02X',nLGValue),$0d"
    	if(DebugLgMonitorModule) SEND_STRING 0,"'kf',$20,'01',$20,format('%02X',nLGValue),$0d"
        }
    }
    
    DEFINE_CALL 'LGMute' (nLGMute)// Mute Selection
    {
        IF(nLGPowerFb)
        {
    //	nLGSequence = 3
    	SWITCH (nLGMute)
    	{
    	    CASE 1:
    	    {
    		send_string dvport,LG_Volume_On
    	    }
    	    DEFAULT:
    	    {
    		SEND_STRING dvport,LG_Volume_Off
    	    }
    	}
        }
    }
    (***********************************************************)
    (*                STARTUP CODE GOES BELOW                  *)
    (***********************************************************)
    DEFINE_START
    
    
    (***********************************************************)
    (*                THE EVENTS GO BELOW                      *)
    (***********************************************************)
    DEFINE_EVENT
    /*
    timeline_event[TLLG]
    {
        if(nDebugLG) send_string 0,"'dvLG TimeLine Sequence:',itoa(timeline.sequence)"
    
        switch(Timeline.Sequence)
        {
    	Case 1:
    	{
    	    if(nDebugLG) send_string 0,"'Polling Power'"
    	    nLGSequence = Timeline.Sequence
    	    send_String dvport, LG_Power_Get    
    	}
    	Case 2:
    	{
    	    if(nDebugLG) send_string 0,"'Polling Source'"
    	    nLGSequence = Timeline.Sequence
    	    send_String dvport, LG_Source_Get    
    	}
    	Case 3:
    	{
    	    if(nDebugLG) send_string 0,"'Polling Volume'"
    	    nLGSequence = Timeline.Sequence
    	    send_String dvport, LG_Volume_Get    
    	}
    	Case 4:
    	{
     	    nLGSequence = 1
     	    if(nLGOnreq)
    	    {
    		if(nDebugLG) send_string 0,"'LG Resquest On Send'"
    		send_String dvport, LG_Power_ON
    	    }
    	    if(nLGOffreq)
    	    {
    		if(nDebugLG) send_string 0,"'LG Resquest Off Send'"
    		send_String dvport, LG_Power_OFF
    	    }
    	}
    
        }
    }
    */
    
    data_event[dvport]
    
     {
        online:
        {
    	if(DebugLgMonitorModule) send_string 0,"'LG ',itoa(data.device.number),' Online',$0d"
    	send_command dvport,'SET BAUD 9600,N,8,1'
    	wait 30 send_String dvport, LG_Power_Get
    	wait 40 send_string dvport, LG_Source_Get
    	wait 50 send_String dvport, LG_Volume_Get
    	wait 60 send_string dvport, LG_Mute_Get
    	on[dvtp,nbutton[85]]
    	//timeline_create(TLLG,TLLGMonitorTime,4,TIMELINE_relative,timeline_repeat)
        }
        offline:
        {
    	if(DebugLgMonitorModule) send_string 0,"'LG ',itoa(data.device.number),' Offline',$0d"
    	//timeline_kill(TLLG)
    	off[dvtp,nbutton[85]]
        }
        string:
        {
    	stack_var Char Cdump[50]
    	if(DebugLgMonitorModule) send_string 0,"'LG ',itoa(data.device.number),' string: ',data.text"
    	//timeline_pause(TLLG)
    	cdump = remove_string(data.text,'OK',1)
    	select
    	{
    	    active(cdump = 'a 01 OK'):
    	    {
    		nLGPowerFb=atoi(Left_String(data.text,2))
    		nLGon = nLGPowerFb
    	    }
    	    active(cdump = 'b 01 OK'):
    	    {
    		fnCLEAR_INPUT()
    		nLGSourceFb=atoi(Left_String(data.text,2))
    		switch(nLGSourceFb)
    		{
    		    case 10: on[dvtp,nbutton[1]]
    		    case 20: on[dvtp,nbutton[2]]
    		    case 21: on[dvtp,nbutton[3]]
    		    case 40: on[dvtp,nbutton[4]]
    		    case 60: on[dvtp,nbutton[5]]
    		    case 90: on[dvtp,nbutton[6]]
    		    case 91: on[dvtp,nbutton[7]]
    		}
    	    }
    	    active(cdump = 'e 01 OK'):
    	    {
    		nLGMuteFb=(atoi(Left_String(data.text,2)))
    	    }
    	
    	    active(cdump = 'f 01 OK'):
    	    {
    		nLGVolumeFb=HEXTOI(Left_String(data.text,2))
    		send_level dvtp,nbutton[86],nLGVolumeFb*255/100
    	    }
    	}
    	//timeline_restart(TLLG)
        }
    } 
    
    button_event[dvtp,nButton]
    {
        push:
        {
    	nSelection=Get_Last(nButton)
    	switch(nSelection)
    	{
    	    case 1: // ATV
    	    {
    		CALL 'LGInput' (10)
    		break
    	    }
    	    case 2: // Av1
    	    {
    		CALL 'LGInput' (20)
    		break
    	    }
    	    case 3: // Av2
    	    {
    		CALL 'LGInput' (21)
    		break
    	    }
    	    case 4: // Component
    	    {
    		CALL 'LGInput' (40)
    		break
    	    }
    	    case 5: // VGA
    	    {
    		CALL 'LGInput' (60)
    		break
    	    }
    	    case 6: // HDMI1
    	    {
    		CALL 'LGInput' (90)
    		break
    	    }
    	    case 7: // HDMI2
    	    {
    		CALL 'LGInput' (91)
    		break
    	    }
    	    case 20: //Power Off
    	    {
    		CALL 'LGPower' (0)
    		break
    	    }
    	    case 21: //Power On
    	    {
    		CALL 'LGPower' (1)
    		break
    	    }
    	    case 23:// Audio Mute
    	    {
    		call 'LGMute' (!nLGMuteFb)
    	    }
    	    case 30:// Volume Up
    	    {
    		if(nLGMuteFb=0) nLGMuteFb=1
    		nLGVolumeFb=nLGVolumeFb+2
    		if(nLGVolumeFb>=100) nLGVolumeFb=100
    		CALL 'LGVolume' (nLGVolumeFb)		
    	    }
    	    case 31:// Volume Dn
    	    {
    		if(nLGMuteFb=0) nLGMuteFb=1
    		nLGVolumeFb=nLGVolumeFb-2
    		IF(nLGVolumeFb<=1 || nLGVolumeFb>100) nLGVolumeFb=0
    		CALL 'LGVolume' (nLGVolumeFb)		
    	    }
    	}
        }
        hold[3,REPEAT]:
        {
    	switch(nSelection)
    	{
    	    case 30:// Volume Up
    	    {
    		if(nLGMuteFb=0) nLGMuteFb=1
    		nLGVolumeFb=nLGVolumeFb+5
    		if(nLGVolumeFb>=100) nLGVolumeFb=100
    		CALL 'LGVolume' (nLGVolumeFb)		
    	    }
    	    case 31:// Volume Up
    	    {
    		if(nLGMuteFb=0) nLGMuteFb=1
    		nLGVolumeFb=nLGVolumeFb-5
    		IF(nLGVolumeFb<=5 || nLGVolumeFb>100) nLGVolumeFb=0
    		CALL 'LGVolume' (nLGVolumeFb)		
    	    }
    	}
        }
    }	
    (***********************************************************)
    (*            THE ACTUAL PROGRAM GOES BELOW                *)
    (***********************************************************)
    DEFINE_PROGRAM
    
    [dvtp,nbutton[84]] = !nLGLock
    [dvtp,nbutton[23]] = !nLGMuteFb
    [dvtp,nbutton[20]] = !nLGPowerFb
    [dvtp,nbutton[21]] = nLGPowerFb
    
    
    (***********************************************************)
    (*                     END OF PROGRAM                      *)
    (*        DO NOT PUT ANY CODE BELOW THIS COMMENT           *)
    (***********************************************************)
    
    
Sign In or Register to comment.