01-01-2012 07:18 AM
Hello all,
I'm trying to send some variables back from the labview to the arduino with no success till now.
I tryed to add new case for the sketch of the arduino interface and send value via the send receive Vi.
no responding.
I will be very happy if anyone can help.
Sketch add in the cases:
case 0x1E: // test case
pinMode(12,OUTPUT);
digitalWrite(12,HIGH); // indicate if execute
Setpoint[command[1]]==700; // just try to give new value
Serial.write( byte(0) );
break;
case 0x1F: // test case
pinMode(0,OUTPUT);
digitalWrite(12,LOW); // indicate if execute
Setpoint[command[1]]==200; // just try to give new value
Serial.write( byte(0) );
break;
01-03-2012 10:15 AM
Hey hraanan,
Looking at the write digital pin as an example:
case 0x03: // Write Digital Pin
digitalWrite(command[2], command[3]); //Write out on the pin specified at command[2] the value at command[3]
Serial.write('0'); //Write a confirmation back to LabVIEW
break;
In this example you would set the Send/Receive in LabVIEW to expect 1 byte. You need to pass Send/Receive the command byte first followed by as many data bytes as you want.
In the code you provided I am not sure what you are trying to do with this line: Setpoint[command[1]]==200; // just try to give new value
To use the value you send to the Arduino board I would expect you to want something like Setpoint =command[2];
Post back if you have any questions.
02-03-2012 06:58 AM
hraanan,
Were you able to accomplish this task? If so, would you post the solution?
I am trying to do something similar.
Thanks