Working With Function Codes
145
PDesign4 Touch Panel Design Software (v2.10 or higher)
This is particularly useful for setting up things like numeric keypads, where you need the channel codes
to begin at a specific value, since you might be using offset math in your code to process the button
pushes.
Ensure Contiguous Code Assignment
This is used when the channel codes have to be in order, with no breaks between them, as in a numeric
keypad. In these cases, since the order is important, use CTRL-select to select the buttons in the order
you want to assign the channels.
If you don't care what channels are assigned, uncheck this option, and TPDesign4 will find the next
available free channels, skipping used channels and continuing on until all available channels have been
assigned.
In this case the values will be subject to whether or not you've set the Begin Assignment At checkbox.
Wrap Within Port ID
Since touch panels support more than one port, you're not limited to 256 channel and address codes.
However, things like
SYSTEM_CALLs are based upon all the channels coming from a single device
(port). If the channels are split across ports, the feedback part of the System Call won't work. Another
thing that comes into play with being able to use multiple ports on the bus is that you may need to
confine certain ranges of channel codes to a single port to take advantage of the
DEFINE_MUTUALLY_EXCLUSIVE channel grouping in the code. Since MUTUALLY EXCLUSIVE
works on a particular port, one must ensure that the group of buttons is entirely within a single port. In
either of these cases, check the Wrap Within Port ID option, which ensures that all channel codes
assigned fall within a single port.
One nice thing about the Power Assign palette is that it retains its settings after use, which is handy when
you need both the channel and address codes to have the same numeric values.
First, use the Functions tab of the Workspace Navigator and click back and forth between the channel
and address options. Look for a clear range of channel and address codes large enough, and make a note
of the start channel. Next, open the Power Assign dialog.
Here's the setup you would use:
1. Check Begin Assignment At and Ensure Contiguous Code Assignment.
2. Then supply the port and channel code values, click Channel under Function Code Type, and click
Assign.
3. Next, click Address under Function Code Type, and click Assign again. You can visually verify that
the desired action was accomplished by ensuring that the Display Function & State Overlay option
is selected from the View menu. This will visually display the channel, address, and level codes (in
addition to the currently displayed state) in the corners of the buttons.
While initially somewhat confusing, an immense amount of power is available in the options within the
floating Power Assign dialog.
Since the selection is retained after any operation, if you make a mistake, it's easy to click
Clear Codes and hit the assign button again. One can also simply undo the action if desired.
Remember that Power Assign processes the function code assignments based on the order in
the selection so, if the order is important to you, make sure to create the selection using
CTRL-Select.