Home AMX User Forum AMX General Discussion

devchan with dev TPs issue

The below button event won't work. WHY.
It works if I remove the the touchpanels from the dev array
dev dvTPS[] = {dvTP,dvTP2}
devchan dvChans[]={{dvTPs,1},{dvTPs,2}}

BUTTON_EVENT[dvChans]
{
	Push:{}
	Release:
	{
		PULSE[dvRelays,button.input.channel]
	}
}
I have a work around but I really want to know why this won't work.

Kenny

Comments

  • Joe HebertJoe Hebert Posts: 2,159
    I?m surprised you can get that to compile, it looks like it shouldn?t.

    A DEVCHAN is a structure that contains a DEV (a single DEV) and an INTEGER. You are trying to stuff an array of devices (dvTPS) into a container that can only hold one device. That won?t fit or work.

    You have an array of devchans (dvChans) but that doesn?t mean you can plug in an array of devices. It means you can have an array where each element in the array is a combination of one dev and one integer.

    Hope that clears it up a bit.

    Kenny wrote: »
    The below button event won't work. WHY.
    It works if I remove the the touchpanels from the dev array
    dev dvTPS[] = {dvTP,dvTP2}
    devchan dvChans[]={{dvTPs,1},{dvTPs,2}}
    
    BUTTON_EVENT[dvChans]
    {
    	Push:{}
    	Release:
    	{
    		PULSE[dvRelays,button.input.channel]
    	}
    }
    
    I have a work around but I really want to know why this won't work.

    Kenny
  • KennyKenny Posts: 209
    That makes sense.
    This code was given to me as a base to start from for a new project. I'm wondering now if the old project that it came from works.
    Maybe this worked in an old version of FW. The old project is was done in '05.

    Thanks Joe for your explanation.

    Kenny
Sign In or Register to comment.