Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with reading the serial port

Solved!
Go to solution

Good morning guys,

I'm having a problem to read data from my serial, I have a device that continuously sends11 bytes, so I hope you get 11 bytes in my serial, what happens is the following by a time interval I receive serial data and then and did not return for any error, as if waiting to getdata.

Does this bursting the input buffer? What better way to read the serial data continuously?

Thank you for your attention.
 
Gustavo Carlos da Silva

PROBES - Engineering Solutions - Brazil
0 Kudos
Message 1 of 17
(4,303 Views)

I don't understand your problem completely.

Do you get back more than 11 chars, or none at all?

And maybe you could add your vi to see what is wrong.

greetings from the Netherlands
0 Kudos
Message 2 of 17
(4,272 Views)

Have you tried in general Hyperterminal or try to append termination in labview to your writing command to serial device. Your message is not clear.

0 Kudos
Message 3 of 17
(4,266 Views)

grateful

the program continuously listens a packet of 11 bytes, no time lag between a packageand another, the program receives some packages and then crashes.
Ja put to clear the buffer and still hangs as if waiting to receive a package.

Gustavo Carlos da Silva

PROBES - Engineering Solutions - Brazil
0 Kudos
Message 4 of 17
(4,261 Views)

please attach your VI, so that someone will help you.

0 Kudos
Message 5 of 17
(4,258 Views)

 

That's basically it

Grateful

Gustavo Carlos da Silva

PROBES - Engineering Solutions - Brazil
0 Kudos
Message 6 of 17
(4,252 Views)

Your continously reading bytes from serial device until you press the stop button on front panel. Is it your data changes everytime and is that really need you to read everytime?

 

Do you really need to flush everytime? Remove that try again. Take a look at basic example for SERIAL here

http://zone.ni.com/devzone/cda/epd/p/id/2669

0 Kudos
Message 7 of 17
(4,250 Views)

I removed  to flush the locking and continues, must read the data continuously as the unitsends me packets of 11 bytes with no interval between them.

Gustavo Carlos da Silva

PROBES - Engineering Solutions - Brazil
0 Kudos
Message 8 of 17
(4,246 Views)
Solution
Accepted by topic author Gustavo Carlos

Ok then try with giving some delay time on every read operation. Go to  programming---> time options, wire 500ms or 1000ms to wait millisecond Vi after reading every 11 bytes.

0 Kudos
Message 9 of 17
(4,241 Views)

Thank you shjukheter,


I put a delay of 50ms and so far has not caught more, is receiving no problems.

 

 

Thank you

Gustavo Carlos da Silva

PROBES - Engineering Solutions - Brazil
0 Kudos
Message 10 of 17
(4,235 Views)