From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My indicator reads only the first line from the string

Solved!
Go to solution

Hello all,

I'm having some problems with strings, could you help me?

I'm using a device linked to my computer in a RS-232 port.

I've configured the VISA Serial properly. When I write a command to my device, the response is something like this:

"XXXXX

YYYYYY

2222

44444

WWWW"

The problem is when I try to read this answer. The string indicator show one line at a time every single loop. And the other commands received are stored in the buffer until their time to be displayed come. I mean:

In the first loop the device answers XXXXX.

In the second loop the device answers YYYYYY but now I've stored this to be shown:

2222

44444

WWWW

XXXXX

YYYYYY

2222

44444

WWWW

In the third loop the device answers 2222 and again stores:

44444

WWWW

XXXXX

YYYYYY

2222

44444

WWWW

XXXXX

YYYYYY

2222

44444

WWWW

 

How do I configure my blocks to show the complete string?

 

Thanks,

Murilo

 

 

0 Kudos
Message 1 of 6
(3,240 Views)
Solution
Accepted by topic author Murilo Altheman

Post your code and we can better understand what is going on.

 

My first though is you are only passing the corrent reading to the indicator.

Are you using a string shift reg with a Concatenate String node?

 

ReadString.png

 

 

Post your code and we will have a look.

 

 

Omar
0 Kudos
Message 2 of 6
(3,235 Views)

To you have the termination character enabled on the VISA read?  If so, the VISA read will stop every time it sees the new line character.

 

How are you determining how much data to read at a time?

0 Kudos
Message 3 of 6
(3,224 Views)

I'll try to use a shift register...

What interests me is located only in the third read.

I'll be back to tell you.

0 Kudos
Message 4 of 6
(3,160 Views)

Despite the broken VI, in the writter is "W?".

0 Kudos
Message 5 of 6
(3,157 Views)

Hey, it worked perfectly!

Now I'll make some tests to learn how to manage this string.

 

Thanks a lot guys,

Murilo

0 Kudos
Message 6 of 6
(3,141 Views)