03-08-2017 08:17 AM
I have multiple values on VISA READ. I want to display them seperately on the front panel of LABVIEW . How should I do that?
Right now am getting all values together in a single tab
For example - I have 4 values on VISA READ. I want to get each values seperately on the front panel.
03-08-2017 09:05 AM
1. What is sending you the data?
2. What is the format of the data?
Is the device sending multiple data points in a single message?
Is the data formatted in ASCII (ie you can understand the data when opened in Text Pad)?
If ASCII format, does the message end with a particular character?
03-08-2017 09:09 AM
I am sending the data using ARDUINO UNO..
Am sending two continuous Numerical values
03-08-2017 09:37 AM
What are you using to separate the values in the message? Space? Tab?
03-08-2017 09:40 AM
this is part of the arduino code-
Serial.println(distance);
Serial.println(distance2);
How to seperate these values , so that it can displayed seperately in front panel?
03-08-2017 10:00 AM
@iam_rupam wrote:
this is part of the arduino code-
Serial.println(distance);
Serial.println(distance2);
How to seperate these values , so that it can displayed seperately in front panel?
As you currently have it, you need a second VISA Read inside of the same loop. But then you have no guarantees about which distance measurement you are reading. You might want to consider using a single println command. Something like "println(distance + "\t" + distance2)" should work. Then a single message has both values separated by a tab. Then you have a few options on the LabVIEW side: Spreadsheet String To Array followed by an Index Array, Scan From String with a format string of "%f\t%f".
07-04-2017 07:57 AM
Hi!
I was trying to do something really alike. I am reading pressure signals from an Arduino Mega and setting a serial connection to read them in Lab view. I want to star reading 4 values and was doing something like you said: with the serial print and the Scan From String with a format string of "%f\t%f" but it is not working... don't know why...
I have already try with the Spreadsheet String To Array followed by an Index Array and nothing is read.
If you could tell me why you would do me a great favor...
Thanks in advance
07-04-2017 07:58 AM
Here is my Arduino code...
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
char Buffer[100];
int sensor0 = 0;
int sensor1 = 0;
int sensor2 = 0;
int sensor3 = 0;
void loop() {
// put your main code here, to run repeatedly:
sensor0=analogRead(0);
sensor1=analogRead(1);
sensor2=analogRead(2);
sensor3=4325;
sprintf(Buffer,"%04i\t %04i\t%04i\t%04i",sensor0,sensor1,sensor2,sensor3);
Serial.println (Buffer);
delay(1000);
}
07-04-2017 08:20 AM
I already solved it! NO prob!
thank you anyway!
07-04-2017 09:49 AM
@carlosTU wrote:
I already solved it! NO prob!
thank you anyway!
You should really state what you did to fix your issue so others can learn as well.
But looking at the VI you posted, you should get rid of that Bytes At Port and just use a constant for the number of bytes to read. The VISA Read will stop when the termination character (the Line Feed) is read. So set the bytes to read to something like 50.