![background image](http://html1.mh-extra.com/html/neuronexus/smartbox/smartbox_instruction-manual_1676335043.webp)
NeuroNexus Technologies, Inc. ©2014
| 655 Fairfield Court, Suite 100, Ann Arbor, Michigan USA
Telephone: +1.734.913.8858 | Fax: +1.734.786.0069 |
APPENDIX B
Board digital input data file: digitalin.dat
This file contains samples of digital inputs 0-15 on the SmartBox
™
, in
uint16
format. All 16 digital inputs are encoded bit-by-bit in each 16-bit word. For
example, if digital inputs 0, 4, and 5 are high and the rest low, the
uint16
value for this sample time will be 20 + 24 + 25 = 1 + 16 + 32 = 49.
If no board digital input channels are enabled in the GUI, this file will not be written. If
any
SmartBox
™
digital inputs are enabled, the
uint16
numbers in
this file record data from all digital inputs 0-15. If no auxiliary input channels are enabled in the GUI, this file will not be written.
The following MATLAB code reads a board digital input data file and creates vector of 16-bit words:
fileinfo = dir(
‘digitalin.dat’
);
num_samples = fileinfo.bytes/2;
% uint16 = 2 bytes
fid = fopen(
‘digitalin.dat’
,
‘r’
);
digital_word = fread(fid, num_samples,
‘uint16’
);
fclose(fid);
Board digital output data file: digitalout.dat
This file contains samples of digital outputs 0-15 on the SmartBox
™
, in
uint16
format. All 16 digital inputs are encoded bit-by-bit in each 16-bit word.
For example, if digital outputs 0, 4, and 5 are high and the rest low, the uint16 value for this sample time will be 20 + 24 + 25 = 1 + 16 + 32 = 49.
If the “Save Digital Outputs” box is not checked in the Select File Format dialog, this file will not be written.
The following MATLAB code reads a board digital output data file and creates vector of 16-bit words:
p.43