10-17-2014 01:10 PM
So just a little background of what Im trying to do: Make a labview to send a character over to the arduino and the arduino reads that in and then writes to its EEPROM a value if it recieved something. Basically i wrote a simple program to test this out although it only works when I have the debugger active. First I thought this may be a timing issue so I added in a wait paramter but still no luck. Any one know what the solution to getting the program to work using the regluar run command?
(Also the serial Port does open when in the debugger I know)
Arduino Code:
String x="";
#include <EEPROM.h>
void setup() {
// initialize serial:
Serial.begin(9600);
// make the pins outputs:
}
void loop() {
// if there's any serial available, read it:
if(Serial.available() > 0) {
EEPROM.write(1,3);
}
}
10-17-2014 01:17 PM
10-17-2014 02:12 PM
No thought to using LIFA or LINX?
10-18-2014 10:51 AM
If you have done a little work and read some of the other threads about Arduino and serial problems, then you would have seen that you need a delay inbetween configuring the serial port and writing to the serial port in your LabVIEW program.
The delay should be around 1.5 sec, but true to increase the value to 2 sec. if it does not work.
Second, the Arduino code shown does not read the value in the serial buffer, it only check if there is values in the buffer. Once a value is sent to the Arduino, it will stay in the buffer all the time. You need to read the value or clear the buffer, so that the function Serial.available() does not return true all the time.
10-19-2014 12:54 AM
@dkfire wrote:
If you have done a little work and read some of the other threads about Arduino and serial problems, then you would have seen that you need a delay inbetween configuring the serial port and writing to the serial port in your LabVIEW program.
The delay should be around 1.5 sec, but true to increase the value to 2 sec. if it does not work.
Second, the Arduino code shown does not read the value in the serial buffer, it only check if there is values in the buffer. Once a value is sent to the Arduino, it will stay in the buffer all the time. You need to read the value or clear the buffer, so that the function Serial.available() does not return true all the time.
10-19-2014 01:04 AM
@dkfire wrote:
If you have done a little work and read some of the other threads about Arduino and serial problems, then you would have seen that you need a delay inbetween configuring the serial port and writing to the serial port in your LabVIEW program.
The delay should be around 1.5 sec, but true to increase the value to 2 sec. if it does not work.
Second, the Arduino code shown does not read the value in the serial buffer, it only check if there is values in the buffer. Once a value is sent to the Arduino, it will stay in the buffer all the time. You need to read the value or clear the buffer, so that the function Serial.available() does not return true all the time.
10-19-2014 01:13 AM
@dkfire wrote:
If you have done a little work and read some of the other threads about Arduino and serial problems, then you would have seen that you need a delay inbetween configuring the serial port and writing to the serial port in your LabVIEW program.
The delay should be around 1.5 sec, but true to increase the value to 2 sec. if it does not work.
Second, the Arduino code shown does not read the value in the serial buffer, it only check if there is values in the buffer. Once a value is sent to the Arduino, it will stay in the buffer all the time. You need to read the value or clear the buffer, so that the function Serial.available() does not return true all the time.
10-19-2014 01:42 PM
Did you have anything to say Ranjeet_Singh?