NB.BaudRate = BaudRate;
NB.IOFileName = IOFileName;
try
s = serial(NB.IOFileName);
end
system(sprintf('stty -F %s %d', NB.IOFileName, NB.BaudRate));
NB.IOid = fopen(NB.IOFileName, 'w+');
k = 0;
while(1)
b = fread(NB.IOid, 1, 'uint8'); % Один байт с порта
k = k + 1;
byte_array(k) = b;
end