Macros and scheduled events:

Macros are configurable single commands that execute a series of immediate or timed events.

NetPlay supports up to 99 predefined macros per system.

NetPlay also supports 1 special macros, called the background script.  The background script is a single macro that the Virtual Matrix will start running on power up and continue running (looping) forever.  The script can be used for weekly, daily, and timed scheduled events that you would like to happen automatically without external control.

All Macros consist of a "playlist file".  These are text file which define the functionality of the macro.  The contents of the file are NetPlay Protocol commands, one per line.

For example, a playlist file to select input 5 on displays 2,4, and 8 would be:

File:  macro1.txt     (name itself can be anything, extension should be .txt)

V002005    ; select input 5 on display 2
V004005    ; select input 5 on display 4
V008005    ; select input 5 on display 8

This file would have 3 lines.  Each line has a single NetPlay Protocol command.  Anything after the ";" character is a comment and ignored by Virtual Matrix.

NetPlay Protocol commands support every NetPlay feature.  It also includes three scheduling functions:

  1. WAIT command allow execution to pause for the given amount of time
  2. TIME command allows execution to wait until the given TIME OF DAY occurs   (next command will happen at a given time of day)
  3. DAY command allows execution to wait until the given DAY OF WEEK occurs   (next command will happen at a day of the week)

These 3 commands can be used together (for example, DAY then TIME) to fully schedule when events occur.

You can enable the macros and link them to the playlist files using the Virtual Matrix "Macro Setup" page (vm_ip_addr/vm_macros.php).

Your Virtual Matrix also includes a Protocol Generator page which will greatly simplify creating your playlist files.
This page allows you to graphically select your desired command, and it will return the corresponding NetPlay Protocol command to put in the playlist file.  You can access the Protocol Generator at vm_ip_addr/vm_protocol.php.

Playlist file location and URL

The playlist files your macros will use can be placed

Example playlist files

Macro Parameters

Macro Playlist files now support parameters.

The MACRO NetPlay Protocol command can optionally pass up to 6 parameters to your playlist file. Each parameter is an integer value, and are referenced in the playlist file by the lower case letters (b,c,d,e,f,g)

By convention, the first parameter (b) is used to denote the "current" sink number. NetPlayTV will populate this value automatically when sending a macro command. This allows you to single macro playlist for setting tiled modes on any TV.

When replacing a protocol number with a parameter, use the same letter for all digits. For example, Vbbb002 would be the command to switch the "current" sink to source 2.

Note: All commands in a macro playlist must be UPPER CASE to avoid replacement by parameters

Example playlist for 2x2 tiling: macro_2x2.txt

Advanced Scheduling

Using PHP scripting for more complex scheduling

If you use full weekly scheduling, we recommend using PHP scripting via our built in "User" web server on your Virtual Matrix Manager.

To enable a PHP based script,

  1. Enter "http://ip_address_nvmm/user/script_schedule.php" as your active script
  2. Download this PHP file and edit for your schedule
  3. Upload your new PHP file to NVMM using the "User web server" link on the Virtual Matrix config screen

Please see the comments in the PHP file for details on how to write your script. Use the right click "save as" to download the file. Rename the file extension to .php (instead of .txt) before uploading to the NVMM.