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: 

How to display each value inside a string on an indicator?

Solved!
Go to solution
Solution
Accepted by topic author promanaid

Why are you sending your Arduino code, which is text, as a picture?  What if we want to suggest changes -- do you want us to retype your code?  Think, and be considerate!

 

I see that I misled you (for which I apologize).  The Snippet I sent you for reading data from a VISA Stream assumed that you were using a "Terminated" String (since you configured your VISA that way).  But you clearly are not doing this -- you are just sending data, with no separators and no terminators.

 

I don't know Arduino code, so I may get some of this wrong, but here are the changes you should make:

  • Make a routine called "Send a Line" that takes, as parameters, the values (x, y) that you want to send.
  • Have the code do something like the following:
    • Serial.print(x); Serial.print(tab); Serial.print(y); Serial.print(lf);
    • "tab" is the control character for a tab, 0x9, and "lf" is line feed, 0xA.

This handles the "separation" (since "print" seems to give as many characters as its argument requires, so you can't tell where "x" ends and "y" begins without it) and also correctly implements the "Termination" protocol that you are using (by default), telling LabVIEW when Arduino has sent all the data.

 

It is (almost always) a good idea to give us as much information "up front" as possible, particularly if you don't really know what you are doing.

 

Bob Schor

0 Kudos
Message 11 of 14
(535 Views)

@Bob_Schor wrote:

Why are you sending your Arduino code, which is text, as a picture?  What if we want to suggest changes -- do you want us to retype your code?  Think, and be considerate!

 

I see that I misled you (for which I apologize).  The Snippet I sent you for reading data from a VISA Stream assumed that you were using a "Terminated" String (since you configured your VISA that way).  But you clearly are not doing this -- you are just sending data, with no separators and no terminators.

 

I don't know Arduino code, so I may get some of this wrong, but here are the changes you should make:

  • Make a routine called "Send a Line" that takes, as parameters, the values (x, y) that you want to send.
  • Have the code do something like the following:
    • Serial.print(x); Serial.print(tab); Serial.print(y); Serial.print(lf);
    • "tab" is the control character for a tab, 0x9, and "lf" is line feed, 0xA.

This handles the "separation" (since "print" seems to give as many characters as its argument requires, so you can't tell where "x" ends and "y" begins without it) and also correctly implements the "Termination" protocol that you are using (by default), telling LabVIEW when Arduino has sent all the data.

 

It is (almost always) a good idea to give us as much information "up front" as possible, particularly if you don't really know what you are doing.

 

Bob Schor


I apologize that i had some concepts about sending data serially to labview confused so i didn't know exactly what information to provide. 

I tested the changes that you suggested (written in a little different manner) and they worked. I also used the Spreadsheet String to Array function as @ suggested ,alongside Index Array function to separate the elements and displayed them on indicators.

So my problem is solved now. Thanks to you all for the help, much appreciated.

0 Kudos
Message 12 of 14
(514 Views)
Hello, @promanaid Now, are you able to display data continuously on dial ? Can you please help us if you get it
0 Kudos
Message 13 of 14
(369 Views)

@ITLdesign wrote:
Hello, @promanaid Now, are you able to display data continuously on dial ? Can you please help us if you get it

It's marked as "solved".  Did you look at the post marked as the solution?

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 14 of 14
(348 Views)