LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to receive and read continuous data

hi, i need to receive and read the continuous data from serial communication port. but i don't know how to do it.
 
in tera pro, i can type command and see the result in continuous data in windows. how can i result in labview.
 
thanks 
0 Kudos
Message 1 of 14
(5,200 Views)
does anyone knows it??
0 Kudos
Message 2 of 14
(5,172 Views)

let me make clear the questions.

actially, i can read the data from the serial port, but the problem is: it's continuous data and i think buffer has a default value(4096) and it will stop when received 4096 bytes.

i am wondering how  i can receive the continuous data until i press the stop button.

many thanks

0 Kudos
Message 3 of 14
(5,161 Views)
Hi srt,
 
You should start by creating a while loop.  Wire a stop button to the loop control.
 
Outside (before) the while loop, configure the serial port, open the serial port, check to see if there is any data at the port.  Feed the number of bytes into a Read Serial Vi and use this data to initialize your loop (use a shift register).
 
Within the loop, place the check no of bytes at serial port and feed this value to the read Serial Port.  Make sure you do not use the setting to timeout for a certain amount of bytes.  Merge the newly obtained data to the previous data by wiring the input shift register to the merge string vi (top port) and wire the new data to the bottom port.  Feed the output of the merge string to the output shift register (located at the right of the loop).  You can place a display inside the loop (a better way is to place it outside... but that is beyond the scope of this explanation 😉  ). 
 
You can also use the data coming out of the shift register after the while loop is stopped.  It will contain all the data coming from the serial port.
 
Regards,
 
JLV
Message 4 of 14
(5,147 Views)

thanks, JLV

but i am quite new in labview ans so i  still have a little confused. could you attach a example or .jpg graphy to make me clear understand

 

many thanks

 

 

0 Kudos
Message 5 of 14
(5,132 Views)
There are 3 examples in under LabVIEW-->Help-->Find Examples.... Just type in serial under the search.  The VIs described above are there.  You would need to slightly modify one of them to get it to work.  But going through the example will be one of the better ways to learn LabVIEW.  The examples are well documented.

Paul
0 Kudos
Message 6 of 14
(5,129 Views)

Hi srt,

As suggested, review the examples.  If you still need help, let me know and I will send you a vi tonight.  🙂

JLV

Message 7 of 14
(5,122 Views)

yes, please send a example as you said and i will make clear to understand it

many thanks

0 Kudos
Message 8 of 14
(5,119 Views)
You can get the example yourself easily.  Open Labview.  Click on the down arrow next to the Open button.  Click on Examples.  The NI Example Finder window appears.  Click on the Search tab.  Enter serial in the Enter Keyword box, then click the Search button.  Look for the Basic Serial Write and Read vi in the list of vi's in the middle column.  Double click on that vi and it will open.  Study the block diagram to get an idea of how to use the serial port.  If you put a while loop around the read section, the vi will read the serial port continuously.  You will have to modify the vi to handle the incoming data as you wish, and to stop the while loop when you wish.  This is a good start.  If you have any more questions, post them after you have learned how to use the serial port.
- tbob

Inventor of the WORM Global
Message 9 of 14
(5,048 Views)

Thanks all

Actually, I know these examples and i also read them. But the actual questions is:

I had to use the labview to build a test sysetem which is used by tera term before. in tera term software, i can manully control the serial communication until access test model.

so when i transfer the test system in labview platform,  firstly, i configures the serial ports and use the bytes at serial ports and read serail vi and while loop to read the data from the test termianl through rs232.and it can work (see 1.jpg) and after accessing the test model, i need to write a command and watch the response from the test termianl. that is my problem, i can receive the continuous data but it will stop when 4096 bytes arrive( i think this is the default value in buffer). but i need to look the result( the response) from the test termianl until i want to stop.

i think JLV suggest me to use the shhift register in whie loop, but i am not quite sure how to do it.

so I hop get some example to see.

many  thanks

0 Kudos
Message 10 of 14
(5,044 Views)