| cmdVEC_WR | Index |
Command Code:
The Packet Is Either:
| 0 | 1 | 2 | 3 | 4 | ||||
| address | 3 | cmdVEC_WR | FOFFS | VDATA |
| FOFFS - | [ (7) WFLAG=0 | (6:0) VBOFFS ] |
| VDATA - | 2, 4, or 6 vector data bytes. |
Or:
| 0 | 1 | 2 | 3 | 4 | ||||
| address | 3 | cmdVEC_WR | FOFFS | VDATA |
| FOFFS - | [ (7) WFLAG=1 | (6:0) VBOFFS ] |
| VDATA - | SLOT byte followed by 2 or 4 vector data bytes. |
Description:
This command is used to save reflex vector data to a BrainStem module.
When WFLAG=0, this command writes up to 6 vector data bytes to a write buffer starting at the the vector byte offset, VBOFFS. When WFLAG=1, this command calculates the address of the appropriate vector slot using the first data byte for SLOT number, writes the remaining byte pairs to the buffer starting at VBOFFS, and finally writes the vector to the EEPROM. This saves EEPROM cycles. A full 16-byte vector may be saved with 3 commands. The first and second commands have a FOFFS byte and 6 bytes. The last command has a FOFFS byte, SLOT byte, and 4 bytes.
A packet size that is invalid will generate an error message.
The following table has some examples for defining vectors in a module with an address of 2. The first vector contains 8 records and must be broken up into three commands. The second vector contains 4 records and must be broken up into two commands. The third vector has 2 records and can be sent as one command.
| Vector ID | Vector Records | cmdVEC_WR command(s) |
| 100 | [1, 128] [2, 128] [3, 128] [4, 128] [5, 128] [6, 128] [7, 128] [136, 128] | 2 11 0 1 128 2 128 3 128 2 11 6 4 128 5 128 6 128 2 11 140 100 7 128 136 128 |
| 101 | [1, 128] [2, 128] [3, 128] [132, 128] | 2 11 0 1 128 2 128 3 128 2 11 134 101 132 128 |
| 102 | [1, 128] [130, 128] | 2 11 128 102 1 128 130 128 |