Show Posts
Pages: [1]
1  Using Arduino / Interfacing w/ Software on the Computer / Re: Sending multiple variables from Arduino to Labview with serial.write() on: March 05, 2012, 05:01:26 pm
Thanks for response!

If anybody wondered - yes, adding different cases for given headers along with corresponding commands in Arduino does the trick smiley-wink
2  Using Arduino / Interfacing w/ Software on the Computer / Sending multiple variables from Arduino to Labview with serial.write() on: March 04, 2012, 03:06:24 pm
Hello.

I would like to send multiple variables from Arduino to Labview to plot them in real time. Serial.print command is insufficient (laggy), so I've done some searching and found this example: http://www.stefanocottafavi.com/?p=412&page=2. With this VI and code I can now send one float variable without any lag. I don't know how to send more of them though smiley

Here's the Arduino code:

Code:
{
  // 5-byte packet
  Serial.write((byte)0x69); // header
  serialWriteFloat(var/*bmp.readAltitude(103500)*/);

  delay(100);
  
}

void serialWriteFloat(float arg) {
  byte * data = (byte *) &arg;
  Serial.write (data, sizeof (arg));
}

and here's VI:



Is it about adding cases in Labview with different headers and respectively serial.write commands with their names and variable names in Arduino code?

I would be grateful for some help or pointing me in right direction.

Cheers
Pages: [1]