Q: How do I create a macro that does something different depending on the port where it's been entered?

The 7330 has an IF/THEN/ELSE command that can check one of the controller's values to determine which macro to execute.  One of the values you can check is whether the command is being executed from a particular port.  The ELSE is optional so you can write a single macro with a list of these commands checking for each port in turn.  The one that's tested as true would execute and the others would just be skipped. 

Here's the example:

; Common Macro
99 20 2000 99 76 04 0100 A001 *   ; speak "port 1" if entered on port 1
99 29 2000 99 76 04 0200 A002 *   ; speak "port 2" if entered on port 2
99 29 2000 99 76 04 0300 A003 *   ; speak "port 3" if entered on port 3
99 29 2000 99 76 04 0900 A009 *   ; speak "port 9" if entered on serial port
99 29 2000 99 15 9960 0741 *      ; speak "End"

; Port-specific Macros
99 20 A001 99 15 9960 1238 0001 * ; speak "Port 1"
99 20 A002 99 15 9960 1238 0003 * ; speak "Port 2"
99 20 A003 99 15 9960 1238 0005 * ; speak "Port 3"
99 20 A009 99 15 9960 1238 0017 * ; speak "Port 9"
 

References:

  • See the If-Then-Else command on page 5-21.
  • See the Boolean Table on page A-49.

 

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer