| cmdVM_RUN | Index |
Command Code:
Packet to run a file:
| 0 | 1 | 2 | 3 | 4 | 5 | |||||
| address | 4 | cmdVM_RUN | RUNCTRL | FileID | VMDATA |
| RUNCTRL - | [ (3) DBG=0 | (2) PROC=0 | (1) FINAL | (0) FIRST=1 ] |
| FileID - | Index of a 1K TEA file. Range depends on module. |
| VMDATA - | 0-5 input data bytes. |
Packet to run a file using a specific Process ID:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | ||||||
| address | 5 | cmdVM_RUN | RUNCTRL | FileID | ProcID | VMDATA |
| RUNCTRL - | [ (3) DBG=0 | (2) PROC=1 | (1) FINAL | (0) FIRST=1 ] |
| FileID - | Index of a TEA file. Range depends on module. |
| ProcID - | Index of VM slot. Range depends on module. |
| VMDATA - | 0-4 input data bytes. |
Packet to debug a file:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | ||||||||
| address | 7 | cmdVM_RUN | RUNCTRL | FSIZEH | FSIZEL | RETSIZE | INPSIZE | VMDATA |
| RUNCTRL - | [ (3) DBG=1 | (2) PROC=0 | (1) FINAL | (0) FIRST=1 ] |
| FSIZEH - | High byte of debug file size. |
| FSIZEL - | Low byte of debug file size. |
| RETSIZE - | Number of return bytes. |
| INPSIZE - | Number of input parameter bytes. |
| VMDATA - | 0-2 input data bytes. |
Packet to debug a file using a specific Process ID:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |||||||||
| address | 8 | cmdVM_RUN | RUNCTRL | FSIZEH | FSIZEL | RETSIZE | INPSIZE | ProcID | VMDATA |
| RUNCTRL - | [ (3) DBG=1 | (2) PROC=1 | (1) FINAL | (0) FIRST=1 ] |
| FSIZEH - | High byte of debug file size. |
| FSIZEL - | Low byte of debug file size. |
| RETSIZE - | Number of return bytes. |
| INPSIZE - | Number of input parameter bytes. |
| ProcID - | Index of VM slot. Range depends on module. |
| VMDATA - | 0-1 input data bytes. |
Packet of input data for a VM:
| 0 | 1 | 2 | 3 | 4 | 5 | |||||
| address | 4 | cmdVM_RUN | RUNCTRL | ProcID | VMDATA |
| RUNCTRL - | [ (3) DBG=0 | (2) PROC | (1) FINAL | (0) FIRST=0 ] |
| ProcID - | Index of VM slot. Range depends on module. |
| VMDATA - | 1-5 input data bytes. |
Description:
This command starts a VM process or VM debugging session. The format of this command varies according to the control byte that must come after the cmdVM_RUN byte. After an initial cmdVM_RUN packet, additional cmdVM_RUN packets contain input data for the VM process.
If the DBG flag is clear and the FIRST flag is set, this command will begin execution of a TEA file that is stored in the EEPROM. A file ID that is out of range will generate an error message. If the PROC flag is set, the VM with the process ID given in the ProcID byte will manage TEA file execution. A process ID that is out of range will generate an error message. If the PROC flag is clear, the first available VM slot will be used to manage TEA file execution. A lack of free slots will generate an error message. Input data bytes may be included in VMDATA. The FINAL flag may be set if the first packet contains all the data for starting the process. The reply packet is cmdVM_RUN followed by the process ID.
If the DBG flag is set and the FIRST flag is set, this command will begin a debugging session for a TEA file that is stored on the Host. If the PROC flag is set, the VM with the process ID given in the ProcID byte will manage TEA file execution. A process ID that is out of range will generate an error message. If the PROC flag is clear, the first available VM slot will be used to manage TEA file execution. A lack of free slots will generate an error message. Input data bytes may be included in VMDATA. The FINAL flag may be set if the first packet contains all the data for starting the process. The reply packet is cmdVM_RUN followed by the process ID.
If only the FINAL flag is set or no flags are set, the packet contains input data for a process. (In input data packets, the PROC bit is a "don't care" bit.) For a TEA file in EEPROM, the total number of input data bytes must match the count in the TEA file header. When debugging a TEA file, the total number of input data bytes must match the count in first cmdVM_RUN packet. The reply packet is cmdVM_RUN followed by the process ID.
Examples:
Some examples for a variety of TEA program executions are shown below for a module with an address of 2. Note that the Console inserts a size byte into outgoing commands and extracts the size byte from incoming reply packets. When no process slot is specified, the program gets the first available process slot. In these examples, the first available process slot is assumed to be 0.
| Task | Param Data | Console Command(s) | Reply Packet(s) |
| Launch file 0, no params | (none) | 2 21 3 0 | 02:15,00 |
| Launch file 7, 5 param bytes | 1, 2, 3, 4, 5 | 2 21 3 7 1 2 3 4 5 | 02:15,00 |
| Launch file 1, 8 param bytes | 1, 2, 3, 4, 5, 6, 7, 8 | 2 21 1 0 1 2 3 4 5 2 21 6 0 6 7 8 | 02:15,00 02:15,00 |
| Launch file 7, 12 param bytes | 1,2,3,4,5,6,7,8,9,10,11,12 | 2 21 1 7 1 2 3 4 5 2 21 4 0 6 7 8 9 10 2 21 6 0 11 12 | 02:15,00 02:15,00 02:15:00 |
| Launch file 0 as process 1, no params | (none) | 2 21 7 0 1 | 02:15,01 |
| Launch file 0 as process 1, 8 param bytes | 1, 2, 3, 4, 5, 6, 7, 8 | 2 21 5 0 1 1 2 3 4 2 21 2 1 5 6 7 8 | 02:15,01 02:15,01 |
| Launch file 7 as process 2, 12 param bytes | 1,2,3,4,5,6,7,8,9,10,11,12 | 2 21 5 7 2 1 2 3 4 2 21 0 2 5 6 7 8 9 2 21 2 2 10 11 12 | 02:15,02 02:15,02 02:15:02 |