A NAV420CA Inertial Measurement Unit is connected on the COM1 port of a PC running Windows XP SP2. The EEPROM of the NAV420CA has been configured to deliver NAV streams of data, at 38400 bauds, no parity, 1 stop bit, no flow control. On the PC machine, the COM1 is also configured using the aforementioned settings. The Serial Receive block from the Instrument Control Toolbox has an inherited sample time, and a receive buffer of 37 bytes (size of a NAV stream). Any receive buffer whose size differs from that number leads to no data reception. However, the important point here is that the data is received shifted, the last 5 bytes coming first, and the first 32 coming last, which leads to byte reordering in order to decode the streams. This shift by 5 bytes has also been observed for streams of different nature: Scaled sensor packets (35), AHRS packets (35). I wrote an application in C++ that would decipher the data as well, without any Simulink environment, and I never had to shift the data in that program. I hence suspect that either I got one of my settings wrong in the simulation, or it's a bug in MATLAB.
Link to this comment:
All Comments (0)