LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication reading problem

hi
sir  ihave made a vi for reading data from serial port com1 sir data is tarnsmitted by the other pc using hyper terminal ,i use cross cable
for connecting the the both and configuring with same specs (buad2400,datbit8,parityN,stop2,flowcont N)
a vi is attached her with .
i facing problem  a character that is transmitted some time appear some  time not and some time grabege value apear 
 iwant to read any thing that is tarnsmitted by the other pc and save it for further process
any one who know whats problem or wheer is the problem plz tell me waiting 
0 Kudos
Message 1 of 4
(3,221 Views)
The problem could be related to the fact that you left the Use Terminal Char input of Visa Configure Serial Port.vi unwired. As you can see if you open this VI, this input is set to TRUE by default and the default value for termination char is 0xA. Regardless to the number of bytes in the buffer, the reading will stop if the termination char is found in the data. This is very useful if all messages end with a given reserved character. By setting the number of bytes to read to a value that is greater than the longest possible message, VISA Read will then read and return the data message by message. If this is not the expected behaviour, Use Terminal Char must be set to FALSE.
0 Kudos
Message 2 of 4
(3,212 Views)

A big problem is that the VI is not set up to keep reading the port. If you are using the Run Continuous button, that is incorrect. That button is not to be used except in rare cases. when you do that, each time you initialize and then close the port. Use a while loop around the read instead like the attached example. I also straightened out those wires. Neatness counts.Smiley Wink

Having the termination character enabled may not be a problem. Since the other end is someone using Hyperterminal, each of those messages will be terminated.

Message 3 of 4
(3,206 Views)
thanks  thanks,,,,my problems have  solved 
0 Kudos
Message 4 of 4
(3,192 Views)