From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from serial , help needed

Hello, I am a student trying to develop a Labview VI that talks with TDK blue2i module (with at style commands) via serial port, just like Hyperterminal.My VI consists of a while loop, inside of that I do VISA write, then VISA read using Bytes at serial port since answers are variable in lenght. When i run the program the first loop works ok ( i send message and get the right answer ) but in the second loop i still read the fisrt answer even if send a different command.
Is there a way to make sure that buffer of the serial port is cleared after every reading?
Sounds like a timing problem, Everything works well if I run the program Step by Step

thanks
0 Kudos
Message 1 of 3
(2,370 Views)
"Francesco83" ha scritto nel messaggio
news:5065000000080000005FD90000-1079395200000@exchange.ni.com...
> Hello, I am a student trying to develop a Labview VI that talks with
> TDK blue2i module (with at style commands) via serial port, just like
> Hyperterminal.My VI consists of a while loop, inside of that I do VISA
> write, then VISA read using Bytes at serial port since answers are
> variable in lenght. When i run the program the first loop works ok (
> i send message and get the right answer ) but in the second loop i
> still read the fisrt answer even if send a different command.
> Is there a way to make sure that buffer of the serial port is cleared
> after every reading?
> Sounds like a timing problem, Everything works well if I run the
> progra
m Step by Step
>
> thanks


Hi!
I'm a student too, and I made a VI very similar to yours. My VI used the
serial port to communicate with a modem, exchanging Hayes commands and
answer from the modem.

- Ma sei italiano anke tu! io non ho usato la VISA, ho usato solo le
funzioni relative alla porta seriale messe in due o tre frame, non ricordo
bene.. credo venga più complicato ma funziona! se vuoi vederlo scrivimi una
mail! -

--

Vicio
0 Kudos
Message 2 of 3
(2,370 Views)
Ciao, prima di tutto grazie per aver risposto..
Sono costretto ad usare le funzioni VISA, anche perchè mi hanno detto che dovrebbero funzionare meglio
Mi farebbe piacere vedere il tuo Vi cosi mi posso fare un'idea
La mia mail : fileppo1983@libero .it

Grazie ancora
0 Kudos
Message 3 of 3
(2,370 Views)