Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial port not reading data

I have an application that use serial RS232 port for reading data with baudrate 115200 and writing data also through joystick with same baudrate and using same port the data are received and transmit through transceiver I have a problem with my code that I receive the data for just short time I think that just the data in buffer and then the program halt or stick with update the data receiving without any error declaration and I have to force closing the program to run it again with the same situation I hope anybody can help I guess the problem with how to mange the serial port, by the way I am using indicator through activex to display my data once I remove the indicator from my program the data receiving not stopped from the port, but again I guess the problem not from the gauge but from the port itself I attach my program may be any body can help me to solve that problem. 

Download All
0 Kudos
Message 1 of 11
(4,367 Views)

First guess:  You don't need the VISA Open inside of the loop.  In fact, you don't need it at all.  That is taken care of in the Configure Serial Port.

 

The other thing I noticed is your ActivieX control.  You should only open that up once before you main loop.  And then make sure you are closing it afterwards.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 11
(4,358 Views)

Dear

 

I do what u ask, first I put the activex outside the while loop, and use the property node to get the data inside the while loop, and finally close the reference of the activex outside the loop, without any progress.

0 Kudos
Message 3 of 11
(4,353 Views)

I guess that the activex for guages maybe when reading invalid data or out of range data make this problem "halt the program without any error indication and stop reading from the serial port" it just guess could u plz if u have any experience on that problem tell me. 

0 Kudos
Message 4 of 11
(4,321 Views)

Hey AlaaShaw,

 

Out of curiosity, why are you using active x controls to display data? I wonder if you get this same behavior when you are using an array or some other data type to display the data. Also what kind of data are you getting in through the serial port? It would help to know what kind of device it is (model number).

 

And just to clarify, this only works for a brief time, then it freezes up without any error? Is hte VI still responsive? 

Kurt P
Automated Test Software R&D
0 Kudos
Message 5 of 11
(4,298 Views)

Dear Kurt

 

thank u for ur interest, first of all the data related to navigation system, and i would like to display the navigation data on a horizon indicator, with rate 115200 baudrate, and also yes the progam are freeze up without any error with any response from the VI, i have to close LabView to start again.

Alaa

0 Kudos
Message 6 of 11
(4,278 Views)

Hey Alaa,

 

How about we try running a simple example just to make sure we are getting good data from the VISA read:

 

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

 

This is a simple one that can do both VISA read and VISA write. Let me know how it turns out.

Kurt P
Automated Test Software R&D
0 Kudos
Message 7 of 11
(4,255 Views)

Thanks Kurt

 

I check it before with same simple read and write serial port also the advanced serial read write serial port without any error and also with different PC once I insert the guages it start for a moment and then freeze up. As I told before maybe the range of data maybe exceed for the gauge for example if the gauge range between 0 to 360 degree and the input come for a while more and more that range can do that problem.

 

alaa  

0 Kudos
Message 8 of 11
(4,249 Views)

Alaa,

 

Is there a model number for this gauge? How is it connected to the computer? Were you able to read from it before? What were you reading from the serial port before the gauge was attached?

Kurt P
Automated Test Software R&D
0 Kudos
Message 9 of 11
(4,230 Views)

Dear Kurt

 

I read the serial data from modem, and then display the data through atificial guage from Global Magic Software, so the gauge are artificial.

 

alaa

0 Kudos
Message 10 of 11
(4,204 Views)