Two Qs; Exponent and "device array"?
VMarc
Posts: 10
Now this will be my third post and my previous two were answered in a single line so I'm starting to feel a little... worried of asking questions that seem so simple. Not gonna happen this time, I've got TWO questions.
1) I'm nervous about asking this one but I can't seem to find documentation on it. How do I make an exponent? Normal programming its just a "^". Same in Studio?
A=10^B
B = 0 then A = 1
B = 1 then A = 10
B = 2 then A = 100
2) In a system with one controller I've got mutliple touch panels, say three. For each touch panel I have an AXI file where I define the button actions. All panels are the same so I'm certain I'm being redundant in creating a axi file for each panel. I'm certain I could something similar to...
BUTTON_EVENT[dvMastTP01,100]
BUTTON_EVENT[dvMastTP02,100]
BUTTON_EVENT[dvMastTP03,100]{
PUSH:{ A = 4 }
} //note, I haven't tried this
But the day where I want to add a 4th panel I'd have to manually enter BUTTON_EVENT[dvMastTP04,100] to each event. could I not set up a variable, somewhat like define_combine to do this?
allTP = {dvMastTP01,dvMastTP02,dvMastTP03}
BUTTON_EVENT[allTP,100]{
PUSH:{ A = 4 }
}
*If any TP pushes thier button 100 then "A" equals three. Would a problem occure if two seperate panels push their own button 100 simultaneously?
Thank you for your time.
Marc
1) I'm nervous about asking this one but I can't seem to find documentation on it. How do I make an exponent? Normal programming its just a "^". Same in Studio?
A=10^B
B = 0 then A = 1
B = 1 then A = 10
B = 2 then A = 100
2) In a system with one controller I've got mutliple touch panels, say three. For each touch panel I have an AXI file where I define the button actions. All panels are the same so I'm certain I'm being redundant in creating a axi file for each panel. I'm certain I could something similar to...
BUTTON_EVENT[dvMastTP01,100]
BUTTON_EVENT[dvMastTP02,100]
BUTTON_EVENT[dvMastTP03,100]{
PUSH:{ A = 4 }
} //note, I haven't tried this
But the day where I want to add a 4th panel I'd have to manually enter BUTTON_EVENT[dvMastTP04,100] to each event. could I not set up a variable, somewhat like define_combine to do this?
allTP = {dvMastTP01,dvMastTP02,dvMastTP03}
BUTTON_EVENT[allTP,100]{
PUSH:{ A = 4 }
}
*If any TP pushes thier button 100 then "A" equals three. Would a problem occure if two seperate panels push their own button 100 simultaneously?
Thank you for your time.
Marc
0
Comments
The *best* (IMO) way to handle multiple panels is doing the same things is to use a DEV array. You'd set them up like this:
Now, you can use GET_LAST to determine which panel pressed button 100 (example: A = GET_LAST(dv_TP)), and do whatever you want. I'd stay away from DEVCHANs and they put you too much into a box. The key is flexibility (which you are finding out) - and using arrays is a great start.
Also - I haven't seen your other posts, but if you're new to the programming world (or just getting started again after a while), do not hesitate to ask any questions. We've all been there before, and the best piece of advice is to just ask it - who knows, hopefully your question will help others out along the way.
Oh, one more thing - for ease of readability and distinction of code snippets, include the CODE brackets (i.e. [ CODE ] and [/ CODE ] - remove spaces however!) when posting code.
Ty all very much for the answers. Got the Math.axi to work no problems and I'll work on the DEV array today.
I don't think I've ever been on such a great and supportive forums. cudos to all.
Marc