LabView

Hi!!

Im making some tests using LabView, its really easy to interface with it, but a have some problems:

  • If i send from labview and a dial (0-255) valors, the problem is that it will be send one character at the time.... how can i receive a string of more than 2 characters in the serial port?

i try this:

a = Serial.read();
b = Serial.read();
c = Serial.read();
Serial.print("Se recibio: ");
Serial.print(a);
Serial.print(b);
Serial.println(c);

For receiving 3 characters, but i only get this on the monitor:

Se recibio: 1ÿÿ
Se recibio: 23ÿ

and o would like to receive:

123

jejejeje

can it be done?

how could i do it?

10x!!

cheers!!

Hey, Aldo!

I think your problem may be that you are not waiting long enough for the characters to arrive. Serial.read() returns -1 if no character is (yet) available and this will print as "ÿ". To fix this, just a minor addition:

while (Serial.available() < 3)
  ; // do nothing;
a = Serial.read();
b = Serial.read();
c = Serial.read();

Mikal

Hi Aldo,

I'm almost done writing VISA driver for arduino, I should have it up soon. But LabVIEW keeps crashing on my Mac, and it's been deterring me.

Have you tried using any of the generic VISA vis?