Embedded Systems, Microwaves, Software, Android Apps

X-ACT Manual Scripts

 Scripts

Scripts are a powerful new feature allowing you to define a sequence of commands (including precise delays) to be executed automatically.

For instance, let's assume that you have 4 simulators connected through an X-ACT Bridge Controller, at addresses 0, 1, 3 and 5. A script may allow you to fire the simulators in any order, with any delay between them in a predictable and reproducible way.

A script is a text file stored in the Download folder of your tablet that contains a sequence of commands and optional delays. Here is an example which arms two simulators, fires them at 1 seconds interval and return them to Idle mode.

	0
	#1,0
	#1,3
	#2,3
	#1,4
	w 800
	#2,4
	w 4000
	#1,2
	w 1000
	#2,2
	
Here is what this script does:
  • "0" this is an ID Query command sent to the X-ACT Bridge Controller
  • "#1,0" this command instructs the X-ACT Bridge Controller to send command "0" (an ID Query) to the simulator at address 1.
  • "#1,3" this command instructs the X-ACT Bridge Controller to send command "3" (an ARM command) to the simulator at address 1.
  • "#2,3" this command instructs the X-ACT Bridge Controller to send command "3" (an ARM command) to the simulator at address 2.
  • "#1,4" this command instructs the X-ACT Bridge Controller to send command "4" (a FIRE command) to the simulator at address 1.
  • "w 800" this command creates an additional delay between commands of 0.8 second.
  • "#2,4" this command instructs the X-ACT Bridge Controller to send command "4" (a FIRE command) to the simulator at address 2.
  • "w 4000" this command creates an additional delay of 4 seconds.
  • '#1,2" this command instructs the X-ACT Bridge Controller to send command "2" (an IDLE command) to the simulator at address 1
  • "w 1000" this command creates an additional delay of 1 second.
  • '#2,2" this command instructs the X-ACT Bridge Controller to send command "2" (an IDLE command) to the simulator at address 2
Note that if you want to send a FIRE command followed by an IDLE command to a given simulator, a 5 second delay is always neccessary after the fire command. If the IDLE command was sent immediately after the FIRE command, it would abort the FIRE command. However, when sending commands to different simulators or other types of commands, no delay is necessary.

Note that the delay programmed with command "w xxx" is an additional delay between commands and does not include the built-in delay between commands (about 200mS). The built-in delay is the time it takes for a command to travel to the simulator and the simulator's response to travel back to the app. In effect, the delay is measured between the response to a command and sending the next command.

The execution of a script is verified on the screen. The picture below shows the execution of the script above:

 

Figure 8: Example of script result

In the screen shot above, the app displays the response to commands ARM, FIRE and IDLE as a 4 character string. This indicates successful execution of the command. A command that cannot be executed would ellicit a response of "NAK", for Not Acknowledge.

Editing a script

To edit a script, simply select a record by clicking on it. Now each record is preceeded with the line number and the currently selected record will be printed near the bottom of the screen for reference and a row of buttons are now displayed right below that at the bottom of the screen as shown below.

 

Figure 9: Example of script editing

You can use these buttons to respectively insert a new record (the new record will be inserted in the cursor location, the rest of the script will be pushed down), delete a record, edit a record or save the new script, under the same name or under a new name.

You cannot create a new script from scratch or delete an existing script directly within the app but if you want to create a new script, it is easy to open the demo script, modify it and save it under a new name.

The scripts are saved in the Download folder which makes it easy to exchange scripts via email. Scripts sent via email attachment can be easily saved to the download folder and opened from within the X-ACT app.

Available commands:

The following is a list of the commands most commonly used with scripts:

Action Example Comments
 Idle Command  '#1,2'  Places the simulator at address 1 in Idle state
 Arm Command  '#1,3'  Places the simulator at address 1 in Armed state
 Fire Command  '#1,4'  Executes the firing sequence on simulator at address 1
 Wait <xxx> mS  'w <xxx>'  Maximum: 30000 milliseconds (30 seconds)

 

The single quote characters ' are used to show the start and end of the command message. They should not be used in the script.

 

The "Help with Scripts" menu is useful to remind you of the available commands: