Button Latching
rmjsts
Posts: 19
I am fairly new to AMX. But I have experience in other touch panel systems. Is there a way to LATCH a buon to the ON position until the next time it is pushed. I have tried channel tracking and that does not work. Also what is the best way to latch opposing buttons. Example: Audio conferencer MIC ON and MIC OFF, this requires 2 buttons MIC ON and MIC OFF. If I press MIC ON I want it to indicate ON and the MIC OFF to indicate OFF, and when MIC OFF is pressed for the MIC ON to become OFF and the MIC OFF to be ON. I may just use PRIVACY with it staying in the ON position when pressed and OFF when off if that is much simpler. So is there a way to make one button react in a specific manner based on the condition of another button?
0
Comments
You might find DEFINE_LATCHING and DEFINE_MUTUALLY_EXCLUSIVE in the help files. It should have all the answers you need.
For example
will mean that feedback can only be on for one buttons 1-10 to be on. If 1 was on, and then you turn 3 on, 1 will go off automatically.
OK. I tried the HELP in both TP4 and NS3, neither had information on the the formating for these commands. I am guessing that when you stated:
DEFINE_MUTUALLY_EXCLUSIVE
( [dvTP_1,1] .. [dvTP_1,10] )
that the 1,1 and 1,10 indicate port,channel so if my TP4 file button programming tab indicates the the buttons I am interested in making MUTUALLY_EXCLUSIVE is PORT 12 and CHANNEL 145 and CHANNEL 147, I would use the following in the main.axs file:
DEFINE_MUTUALLY_EXCLUSIVE
( [dvTP_12,145] .. [dvTP_12,147] ) (understanding that there should not be a channel 146 button UNLESS i want it included in this exclusive set.
Sinc I could not find any reference to these commands in the help files i am also assuming the Latching command would work like this:
DEFINE_LATCHING
([dvTP_12,145]..[dvTP_12,147])
this will make all buttons on port 12 channels 145-147 latching.
Are my assumptions correct?
I very much appreciate your assistance.
--John
--John
Thank you Eric and John, I will try this out tomorrow once on site with system. Looks easy enough, I did not think to look in the Keywords section of Help.
but then if you want to include more than one TP you"ll have to rethink the device name. Thankfully the search and replace works quite well.
DEFINE_LATCHING
([dvTP1_ACONF1, 145], [dvTP1_ACONF1, 147])
DEFINE_MUTUALLY_EXCLUSIVE
([dvTP1_ACONF1, 145], [dvTP1_ACONF1, 147])
Where ACONF1 has already been defined in the Device definitions section.
and where 145 and 147 are the channels I am trying to affect, or do I need to state the button/function name?
Thanks to all again.. This is a great learning experience. I look forward to becoming much better in time.
I can't display it because it will break out that section!
DEFINE_DEVICE
// Touch Panels
dvTP1 = 10001:1:0
dvTP1_DVR1 = 10001:10:0
dvTP1_MOTOR1 = 10001:11:0
dvTP1_ACONF1 = 10001:12:0
dvTP1_MODE_WelcometoClarkNexsen1 = 10001:15:0
dvTP1_NAV_Components1 = 10001:20:0
dvTP1_NAV_System1 = 10001:22:0
dvTP1_SUBFEATURE_VolumeController1 = 10001:21:0
dvTP1_PREAMP1 = 10001:19:0
dvTP1_NAV_ConferencePhone1 = 10001:16:0
dvTP1_NAV_Computer1 = 10001:17:0
dvTP1_NAV_DVDVCR1 = 10001:18:0
dvTP1_VPROJ1 = 10001:14:0
dvTP1_SWT1 = 10001:13:0
// Other Devices
dvDVR1 = 5001:5:0
vdvDVR1 = 41002:1:0
dvMOTOR1 = 5001:7:0
vdvMOTOR1 = 41003:1:0
dvACONF1 = 5001:1:0
vdvACONF1 = 33001:1:0
dvPREAMP1 = 5001:6:0
vdvPREAMP1 = 41004:1:0
dvVPROJ1 = 5001:3:0
vdvVPROJ1 = 33002:1:0
dvSWT1 = 5001:2:0
vdvSWT1 = 33003:1:0
DEFINE_VARIABLE
// Touch Panel Arrays
VOLATILE DEV dvTP[] = { dvTP1 }
VOLATILE DEV dvTP_ACONF1[] = { dvTP1_ACONF1 }
VOLATILE DEV dvTP_DVR1[] = { dvTP1_DVR1 }
VOLATILE DEV dvTP_MOTOR1[] = { dvTP1_MOTOR1 }
VOLATILE DEV dvTP_PREAMP1[] = { dvTP1_PREAMP1 }
VOLATILE DEV dvTP_SWT1[] = { dvTP1_SWT1 }
VOLATILE DEV dvTP_VPROJ1[] = { dvTP1_VPROJ1 }
DEFINE_LATCHING
//"MICs" Latching group
([dvTP1_ACONF1, 145], [dvTP1_ACONF1, 147])
DEFINE_MUTUALLY_EXCLUSIVE
//"MICs" mutually exclusive group
([dvTP1_ACONF1, 145], [dvTP1_ACONF1, 147] )
Is this correct???
Thank you for your help.
If this is the case you might think about this another way.
I'd just create a variable flag in the program to do it.
There are many ways to do this. I'll just do a simple one to illustrate
This will make the latching happen automatically. If the preamp provides feedback, you can tie this to the state of the variable so the feedback will be real.
The TP Button Feedback statement in DEF_PROG can be handled in a multitude of ways. This particular version updates the button feedback every second only if a change in state has occured. It does not send out 'button_off' every second.
Well, there is an easy way to use the feedback statement to do this as well.
There's really no need for define_latching or define_mutally_exclusive. It's actually easier and more flexible with out them.
Ooooh, I could tell some stories.
OK I hear what you are saying and I actually thought of some this myself today. I did try to get the latching to work but it did not. We cut it to just one button for the MICs ON state shows on and OFF states shows off. I used DEFINE_LATCHING section and set the channel to latching
DEFINE_LATCHING
([ACONF1,145])
AND I SEE WHERE PART OF THE PROBLEM IS NOW AS I LOOK AT THIS: THIS SHOULD LOOK LIKE THIS:
DEFINE_LATCHING
([dvACONF1,145])
I forgot the dv (device indicator)
I set the button feedback to "channel" and nothing happens. I am sure I just did this wrong, but I was looking at this as the DEFINE_LATCHING sets the actual channel state to latching and the button feedback being set to channel monitors this state and reacts appropriately. Again I am wrong and it did not work. Since this is a single button situation this is a toggling event command for the codec. I can use device queries to get exact state of the mic inputs individually or as a group, in this case I will use the entire group query. Then see about using the info Eric submitted to use the exact channel state for the button. In this case, in TP4 button programming would be set to "Channel" I am assuming. I am a little confused on the example Eric provided (sorry for the ignorance) but I am trying to follow the code and I do not follow where the program is getting the channel state from.
I do not know what the data.text portion ( I know this is just a placeholder for what I would have to insert, just do not know what to insert here) would be below.
data_event[dv_Mic_Pre ]
{
string:
{
if(find_string(data.text,'mic is on string',1))
{
Mic_Stat=1
}
if(find_string(data.text,'mic is off string',1))
{
Mic_Stat=0
}
}
}
I SERIOUSLY DOUBT THIS ...BUT: could it be as simple as: dvACONF1.response expected for this condition.
I know the other part above this for the code to turn on and off in the IF/ELSE statements the // has to be dropped so the code is not considered a remark statement, and I have that info. The rest looks like I can understand it.
Sorry I was not trying to open such a can of worms for you guys on this, and I HIGHLY appreciate everyone's time and efforts.
data.text is a legit thing. It is part of the data_Event structure. highlight DATA_EVENT and hit F1 and it'll take you to the section on DATA_EVENTS.
go to the bottom of that page and click 'EVENT HANDLERS'
go to that page and scroll to the bottom of that. You see a link to the event handlers for data_events.
Those all work. While you're at it you might check out all the event. There's a whole world of stuff you'll find very useful.
I'd write it this way...
Report the status of the Mic to the physical device used in the netlinx then update the TP in Mainline or a timeline event. Then use a channel_event to run stuff off of the event of a mic muting and unmuting. All of this is driven from actual feedback from the Dv_Mic_Pre.