Programming the Mio R-4
Button Query Commands
Button Query commands reply back with a custom event. Each button/state combination has one custom event. Each
query is assigned a unique custom event type.
The following example is for debug purposes only:
NetLinx Example: CUSTOM_EVENT[device, Address, type]
DEFINE_EVENT
CUSTOM_EVENT[TP,529,1001] // Text
CUSTOM_EVENT[TP,529,1002] // Bitmap
CUSTOM_EVENT[TP,529,1003] // Icon
CUSTOM_EVENT[TP,529,1004] // Text Justification
CUSTOM_EVENT[TP,529,1005] // Bitmap Justification
CUSTOM_EVENT[TP,529,1006] // Icon Justification
CUSTOM_EVENT[TP,529,1007] // Font
CUSTOM_EVENT[TP,529,1008] // Text Effect Name
CUSTOM_EVENT[TP,529,1009] // Text Effect Color
CUSTOM_EVENT[TP,529,1010] // Word Wrap
CUSTOM_EVENT[TP,529,1011] // ON state Border Color
CUSTOM_EVENT[TP,529,1012] // ON state Fill Color
CUSTOM_EVENT[TP,529,1013] // ON state Text Color
CUSTOM_EVENT[TP,529,1014] // Border Name
CUSTOM_EVENT[TP,529,1015] // Opacity
{
SEND_STRING 0,"'ButtonGet Id=',ITOA(CUSTOM.ID),' Type=',ITOA(CUSTOM.TYPE)"
SEND_STRING 0,"'Flag =',ITOA(CUSTOM.FLAG)"
SEND_STRING 0,"'VALUE1 =',ITOA(CUSTOM.VALUE1)"
SEND_STRING 0,"'VALUE2 =',ITOA(CUSTOM.VALUE2)"
SEND_STRING 0,"'VALUE3 =',ITOA(CUSTOM.VALUE3)"
SEND_STRING 0,"'TEXT =',CUSTOM.TEXT"
SEND_STRING 0,"'TEXT LENGTH =',ITOA(LENGTH_STRING(CUSTOM.TEXT))"
}
All custom events have the following 6 fields:
"^" Button Commands (Cont.)
^UNI Set Unicode text. For the ^UNI command (%UN and ^BMF command), the Unicode text is sent as ASCII-HEX
nibbles.
Syntax:
"'^UNI-<vt addr range>,<button states range>,<unicode text>'"
Variables:
• variable text address range = 1 - 4000.
• button states range = 1 - 2 (1 = Off state, 2 = On state).
• unicode text = Unicode HEX value.
Example:
SEND_COMMAND Device,"'^UNI-500,1,0041'"
Sets the button’s unicode character to ’A’.
Note: To send the variable text ’A’ in unicode to all states of the variable text button 1, (for which the character
code is 0041 Hex), send the following command:
SEND_COMMAND Device,"'^UNI-1,0,0041'"
Note: Unicode is always represented in a HEX value.
Field Description
Uint Flag 0 means text is a standard string, 1 means Unicode encoded string
slong value1 button state number
slong value2 actual length of string (this is not encoded size)
slong value3 index of first character (usually 1 or same as optional index)
string text the text from the button
text length button text length