LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

serial modem communication

Solved!
Go to solution

With the VISA READ in a loop the String Constant that the read buffer goes to refreshes each iteration.

 

With C++ I could create a String Array in memory and append to it, delete stuff from it, sort, reorder, etc  - and then I could dump it into a visible text object so that it could be read by the user.

 

Is there a means to do this in LV?  I'd like each iteration to append the what's shown in the String vs. clearing it each time and starting fresh.

 

thanks

(Soon to retire) US Coast Guard CPO
0 Kudos
Message 21 of 29
(1,230 Views)

Jerry In Maine wrote:

With the VISA READ in a loop the String Constant that the read buffer goes to refreshes each iteration.

 

With C++ I could create a String Array in memory and append to it, delete stuff from it, sort, reorder, etc  - and then I could dump it into a visible text object so that it could be read by the user.

 

Is there a means to do this in LV?  I'd like each iteration to append the what's shown in the String vs. clearing it each time and starting fresh.

 

thanks


Sure.  Take a look at "shift registers" and I think you'll be good to go!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 22 of 29
(1,227 Views)

As I understand I can't get the accumulated value of the register until the loop quits. Trouble is the info I need to accumulate is in a loop that runs continously as long as the app runs.

 

Maybe I misunderstood the HELP file. I'll re-read and keep digging....

 

thanks!

(Soon to retire) US Coast Guard CPO
0 Kudos
Message 23 of 29
(1,213 Views)

I think my "problem" is in the proper operation of the string control itself.  I stripped  the related functions out of any loops and what I see  makes sense now. Each time text is assigned the string control it first blanks. Subsequent additions will all start with a blank - I had the impression that the controls contents would be appended with additional strings and perhaps the object had a "clear" method to empty it.

 

Any tips on accumulating the contents of a VISA read buffer in a string object?  This would allow the user to scroll down if necessary to see previous results.

 

thanks

 

 

(Soon to retire) US Coast Guard CPO
0 Kudos
Message 24 of 29
(1,201 Views)

As Billko said, you need to use a shift register.  For that matter, you need to use a loop also.  The code as you have it only executes one time.

 

Message Edited by Ravens Fan on 09-17-2009 09:26 PM
0 Kudos
Message 25 of 29
(1,195 Views)

>>For that matter, you need to use a loop also.  The code as you have it only executes one time.

 

I realize that (I might be dumb but geeez gimme a little credit Smiley Wink)..

 

As mentioned, I striped the code out of the loop to see if the problem remained - and that's what the .vi I attached above reflecteds.  The point was that the string control didn't seem to append new strings below the existing - rather it cleared each time new text is added.

 

I tried the shift register - but in a different manner than you showed. I'll give that a shot. 

 

Thanks for the patience and help  

 

Message Edited by Jerry In Maine on 09-18-2009 06:05 AM
(Soon to retire) US Coast Guard CPO
0 Kudos
Message 26 of 29
(1,185 Views)

Your fix worked. I was concatenating the data incorrectly with the shift registers.  New text is now appended to existing.

I've got to work on the scroll bars as they scroll tothe top each iteration rather than keeping the new text in view but I think I should be able to handle that.

 

Thanks again

(Soon to retire) US Coast Guard CPO
0 Kudos
Message 27 of 29
(1,180 Views)

Great.

 

I see now you wanted the new information to go on top.  Just go ahead and reverse the order of the inputs on the concatenate so the new data goes to the top input, and the shift register data goes to the bottom input.

 

Another possibility is to use a property node to cause the scroll bar to move to the bottom.  I believe it is Text.ScrollPosition.

 

I myself would prefer the first option because with the second, if someone wants to scroll back to older information, the box will keep jumping to the latest everytime that property node is executed.  I've seen this kind of thing happen in other programs (non LabVIEW) and it is annoying to have to the box jump around and continually have to find your spot again when trying to look at another part of the text box.

0 Kudos
Message 28 of 29
(1,174 Views)

Jerry In Maine wrote:

Your fix worked. I was concatenating the data incorrectly with the shift registers.  New text is now appended to existing.

I've got to work on the scroll bars as they scroll tothe top each iteration rather than keeping the new text in view but I think I should be able to handle that.

 

Thanks again


Yay!!!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 29 of 29
(1,165 Views)