[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Serial communication on octave for windows
From: |
Tatsuro MATSUOKA |
Subject: |
Serial communication on octave for windows |
Date: |
Tue, 15 Apr 2008 05:57:47 +0900 (JST) |
Hello
On one of the Octave threads in Japan, topic of the serial comminucation octave
are posted.
I do not know serial commucation on windows because I usually use vb6+OCX.
I found the below from the Nabble search,
http://www.nabble.com/RS232-Serial-Comms-to7009561.html#a7009561
However the topic is rather old. Have the situation been changed ?
The below is the translataion from questioner (translated Japanese by me)
***********************************************************************
In octave on cygwin
octave>f=fopen('/dev/ttyS0','r+');
makes open com1
octave>fprintf(f,'ATI\n');
sometime reliarize the writting commamds, however read from device fails
octave>id=fscanf(f,'%s')
make octave hangup.
Thefore just after fopen it is required to execute
octave>fcntl(f,F_SETFL,O_NONBLOCK)
(Modem in Note PCs' are almost software modem and then AT codes sometimes is
failed)
In MSVC and Mingw octave
octave>fcntl(f,F_SETFL,O_NONBLOCK)
cannot work.
So I do not execute fcntl and execute f=fopen('COM1','r+') wihout fcntl does
not give an error and
file handle =3 returns.
However, fscanf gets junk data from buffer somewhere else but not COM1.
***************************************
Any suggestion?
Regards
Tatsuro
--------------------------------------
GANBARE! NIPPON! Win your ticket to Olympic Games 2008.
http://pr.mail.yahoo.co.jp/ganbare-nippon/
- Serial communication on octave for windows,
Tatsuro MATSUOKA <=