LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

accessing hyperteminal data using labview

Solved!
Go to solution

Hello sir,

I am getting a problem to access hyperterminal data directly through LabVIEW. Each time i have to go to hyperterminal and and use capture text option to select data and save it to another file. My application requires automatic access of hyperterminal instead of doing it manually each and evary time.Is it possible? I am attaching a VI that i have tried. Please give me a suggestion regarding this.

0 Kudos
Message 1 of 7
(2,799 Views)
Solution
Accepted by topic author kimhyun
Don't use hyperterminal. Use the VISA serial functions. Look at the examples that come with LabVIEW.
0 Kudos
Message 2 of 7
(2,795 Views)

Thank you sir,

your suggestion was so helpful. At a time only one line of string is read. However, i have multiline strings to read in my application. I am using 2 or 3 READ.vi in sequence to get final line. Is there any other way to get last line directly??? I am attaching my VI. 

0 Kudos
Message 3 of 7
(2,789 Views)

The VISA Configure Serial Port has an input called 'Enable Termination Char'. The default is True so when a termination character (linefeed) is detected, the read will automatically terminate. Set the input to False and use the VISA Bytes at Serial Port to determine how many bytes to read.

 

0 Kudos
Message 4 of 7
(2,771 Views)

Thank you Dennis,

          But actually i don't know the exact number of bytes which should be read. The content that should be read is a multi line string. So there is no chance of knowing the exact number of bytes in each line. To get final line the byte count is unknown to me. So what should i do to stop read when i reach last line?

 

0 Kudos
Message 5 of 7
(2,756 Views)

On hyperterminal we get the data line by line. If VISA Read is used directly, it can read only one line at a time based on its sequence. For two lines i used two READ VIs to get the second line. What to do if the number of lines are more or unknown?

0 Kudos
Message 6 of 7
(2,753 Views)

Hi kim,

 

ever heard about the programming concept of using loops?

Especially while loops are used when the iteration count is unknown at loop start...

 

Have you ever looked at the examples coming with your LabVIEW installation? There are ready-to-use examples for reading the serial port!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(2,747 Views)