Need some help on program about keywords.
ricky3688
Posts: 3
All my greetings.I learn to use this program in my company.
The trouble is , if I could use this codes beblow :
PUSH[device1,chnl1]
{
PUSH[device2,chanl2]
{
"codes to be executed"
}
}
or how can I achieve this perpose to execute the codes under this condition :after push two buttons in certain order.
The trouble is , if I could use this codes beblow :
PUSH[device1,chnl1]
{
PUSH[device2,chanl2]
{
"codes to be executed"
}
}
or how can I achieve this perpose to execute the codes under this condition :after push two buttons in certain order.
0
Comments
May I take my project for example, there is a VGA switcher needs to be controled with 8 inputs and 8 outputs.I design the User's interface menu on my touch pannel showing buttons represent for those inputs and outputs,also with a button "SWITCH" .My plan is when User touch AN INPUT-button on touchpannel,then select AN OUTPUT-button and use the "SWITCH" button to confirm . ONCE the controller receive this confirm message,it send a string to switcher to execute this instruction.
so , is this method workable?
This is why i ask for...i'm a beginner in this area.So it is very kind of you to help me out.
Thanks again.
I think this is correct, but I don't have time to compile it and try it. Basically, I am using the button feedback to track the selected inputs and outputs to be applied. I made the inputs mutually exclusive to prevent more than one input being selected at once. Make sure the buttons on the touchpanel are set to allow CHANNEL feedback.
Jeff
P.S.
This is written in Netlinx, but it shouldn't be too difficult to switch to Axcess.
My advice is to never depend on button feedback for an evaluation; button feedback should be used only for its main purpose: feedback. If the panel should go offline for any reason, and you're not driving the feedback with a variable - the panel will lose all feedback states. And if you are using a variable to drive feedback - why not just use that for any evaluations; variables don't lose their values unless the program is restarted (except for persistant variables), feedback is lost when a panel goes offline.
Just food for thought . . .
One nice thing about his code is that you can select multiple outputs for a given input and have the code make the switches with one button push. Probably, the Apply_Switch buttons should clear all the input and output selections, as suggested.
Here's another way to do it (I'm sure there are infinitely many ways), though it's not nearly as compact and doesn't allow for multiple outputs for a given input. It's also possible to have an input or output selected without having the appropriate button feedback; a problem that can easily be corrected with a couple feedback lines in main or with a data_event handler. There are other solutions.
I avoid the use of DEFINE_MUTUALLY_EXCLUSIVE just because of personal preference (mostly because it has given me trouble with multiple touchpanel situations) and I also use character variables as integers, which some people may not like. I'm not even sure that I like it, but it works in this case (the type_cast function eliminates warnings).
There's probably a dozen other ways to do this and if it works, it works. Everyone has there own preferences and quirks and as long as it works it's not wrong it's just different.
edit note: I forgot the push!
added 2nd = to if
Thank you.