Prev: The fix
Next: xpc compile error...
From: JetJungle on 1 Nov 2005 17:44 I'm trying to communicate to an Ashtech Z-FX GPS receiver via RS-232 using Matlab's serial command (R14 ver 7.0.4 on XP), but no joy. This device works and passes data to GBSS and Ashtech's RCS (Commander) software. My code gps=serial('COM1') % No error message set(gps, 'Baudrate', 57600, 'Terminator', 'CR') % Stop bits, parity etc as required by Receiver Reference manua. No error message fopen(gps) % No error message fprintf(gps, '$PASHQ, SID \r') % No error message % above line sends a query for device serial no. % Now for the problem out = fscanf(gps) % above line results in error message: Warning: A timeout occurred before the Terminator was reached. out = '' The terminator is defined as 'CR' and I've tried different ways of parsing it in fprintf(gps, '$PASHQ, SID \r'). E.g fprintf(gps, '$PASHQ, SID\r') fprintf(gps, '$PASHQ, SID') fprintf(gps, '$PASHQ, SID \n') %new line, not CR fprintf(gps, '$PASHQ, SID\n') fprintf(gps, '$PASHQ, SID \r', 'async') even inserted a pause(0.15) before out = fscanf(gps) None of these options seem to work Any suggestions? %Pass a GPS query
|
Pages: 1 Prev: The fix Next: xpc compile error... |