08-06-2014 10:48 AM
I have successufully make interface with the HC HR04 to the labview. I have used LINX tool to acuire data from sensor.Here i am also adding vi file for same.
Thanks.
09-21-2014 04:20 PM
Hello Nathan.
I have installed 2.2.0.79 LIFA. I've also gone to File, Open. Go to "C: \ Program Files \ National Instruments \ LabVIEW 2011 \ vi.lib \ LabVIEW Interface for Arduino \ Firmware \ LIFA_Base" and LIFA_Base.ino open. and I will compile correctly.
My program in arduino 1.0.5 is:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int trigger=8;
int echo=9;
float pulso, cm;
void setup(){
pinMode(7,OUTPUT);//electrovalvula de llenado
pinMode(6,OUTPUT);
Serial.begin(9600);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
lcd.begin(16,2);
void loop(){
digitalWrite(7,HIGH);
delayMicroseconds(5);
digitalWrite(6,HIGH);
delayMicroseconds(5);
digitalWrite(trigger,LOW);
delayMicroseconds(5);
digitalWrite(trigger,HIGH);
delayMicroseconds(10);
digitalWrite(trigger,LOW);
pulso= pulseIn(echo, HIGH);
cm = pulso / 29 / 2;
lcd.setCursor(0,0);
lcd.print("dist:");
Serial.println(cm);
lcd.setCursor(5,0);
lcd.print(cm);
delay(1000);
}
In labview 2011:
But when I test, the value of the distance varies very fast for a few seconds and then stays at 10cm.
Also, I have installed the LINX.
I installed in Labview2011->tools->LabView Hacker->LINX->
But the problem persist. Please your support.
Thanks.
09-21-2014 06:04 PM
You cannot use your Arduino code directly when you are using either LINX or LIFA. Also, the LabVIEW code that you have shown in the image is not a valid program for either LIFA or LINX.
I would recommend that you stick with LINX and first make sure that you can get the example program to work (for blinking the LED). Then, once you have control of the LED, take a look at the code for that example and base your new code on that example.
If you run into issues while using LINX, please start a thread in the LINX forum.
11-29-2014 02:07 AM
I need help, How to add code in labviewinterface.pde file?I want to use Sonar Hc-S04 with Arduino Uno interface with Labview2014, the problem is that how i can implement "Inpulse" function in labview (that can check Echo HIGH state and then counts until the pin goes LOW) or how to use Arduino code of Sonar with labview....please help me,
11-29-2014 02:58 AM
LINX has the SR04 already implemented. Otherwise, you can look at the modifications that I made to LIFA for that sensor here.
12-08-2014 03:51 PM
Hello, I have do all the steps, but I got this error.
can anyone help me to solve this problem ?
12-08-2014 03:55 PM
If you are using an Arduino Uno then you need to use the default baud rate
of 115200. If using the mega, you need to specify that in addition to
having the 9600 basis rate.
Also, check out the documentation for that error.
12-08-2014 03:56 PM
Mr.Nathan, i have seen you in LVH forum, yeah you right that in LINX have a ultrasonic sensor, and it works greatly.
but I need to use a ultrasonic sensor and servo in the same time, and Mr.Sam have said 'Servo is high into the linx, so the servo won't available in linx in a few next month / year ( he said he need more time to think ).
So, I changed from using LINX back to LIFA.
but until now I have a problem to using ultrasonic sensor to LIFA. can you help me ?
12-08-2014 04:04 PM
Hello Mr.Nathan, i'm using arduino uno. andi used 9600 baudrate because in VISA the baudrate is 9600, and I dont know how to change that to 115200. so what i do is change the baudrate in IDE to 9600 and then using 9600 in labview.
is there something wrong in what i have done so makes that labview can't work ?
12-08-2014 08:24 PM
The firmware that is deployed to the Arduino is hardcoded to use 115200 so you must use that. I've never had to change the baudrate in Device Manager or MAX (I've never even looked at MAX for Serial ports; in fact, I didn't even know until recently that they existed in MAX lol).
If 115200 doesn't work then you should change the baudrate of your Serial port (through max or device manager; in both cases, it's on the "Port Settings" tab). If you can't or don't see the "Port Settings" tab, then you might not have administrator permissions.