04-06-2014 12:03 AM
hey i am communicating labview with arduino using visa.i have achieved the communication.now my problem is:
i want that after running front panel, user must select the desired values from the numeric controls and then transmission of data (codes in my case) from labview to hardware begin only after clicking a OK button .i have attached my program in first kindly go through and my desired OK button or any other option which will transmit the selected codes after clicking this option as in second attachment.
note: all codes transmitted from labview to arduino only once.
regards,
vanashree
Solved! Go to Solution.
04-06-2014 01:36 AM - edited 04-06-2014 01:39 AM
you donot attach the snap shot of your block diag and your vi is not opening in my LV 8.5
however i am attaching a vi and its snapshots. basically you need a case structure controlled by OK button inside which you send your data via serial port. you need to convert your numerical data to string before sending on serail port. i hope it will help you. i left the visa serial port config (baud rate etc) on you.
04-06-2014 09:37 AM
08-29-2014 01:08 PM
THANKS
08-29-2014 01:10 PM
WASMREALLY ILL FOR LAS FEW MONTHS COULDNT WORK..BUT NOW FOUND THE SOLUTION THANKS
08-29-2014 09:54 PM
i have attached my DAC08 program interfaced using arduino.when i command from serial monitor from arduino DAC responds means arduino prog is ok. but when i command from LabVIEW it doesnt. i dont want to use LIFA. i just wnt to use VISA to pass stuffs to my arduino upon selection and my arduino to be programmed as to when ever a particular hex string is recieved from visa which corresponding hex code should be routed to the device.labview interfacing is not achieved.
i couldnt attach the .ino file of arduino prog. so i am copy pastin the same here
#include <SPI.h>
#include "htoi.h"
void setup()
{
Serial.begin(9600);
DDRC = 0xff;
}
void loop()
{
char a = Serial.read();
switch(a)
{
case '164':
PORTC = 0xFF; //THESE VALUES CAN BE VARIED AS YOU WANT
break;
case 'B':
PORTC = 0x00;
break;
case 'C':
PORTC = 0xC0;
break;
case 'D': //MORE CASES CAN BE ADDED FOR TESTING IF REQUIRED
PORTC = 0xD0;
break;
//default:
//PORTC = 0x00;
}
}
and print screens of block dia of labview
kindly reply quickly m really in need
regards
vanashree
08-29-2014 09:56 PM
i had added htoi file in order to generate a table as when a hex string is available from visa arduino will be ready as to what shud be done..i think there is some error either in my htoi r in labview
the htoi file is:
int ten(char tens)
{
switch(tens)
{
case '0':
return 0;
case '1':
return 16;
case '2':
return 32;
case '3':
return 48;
case '4':
return 64;
case '5':
return 80;
case '6':
return 96;
case '7':
return 112;
case '8':
return 128;
case '9':
return 134;
case 'A':
return 160;
case 'B':
return 176;
case 'C':
return 192;
case 'D':
return 208;
case 'E':
return 224;
case 'F':
return 240;
}
}
int unit(char units)
{
switch(units)
{
case '0':
return 0;
case '1':
return 1;
case '2':
return 2;
case '3':
return 3;
case '4':
return 4;
case '5':
return 5;
case '6':
return 6;
case '7':
return 7;
case '8':
return 8;
case '9':
return 9;
case 'A':
return 10;
case 'B':
return 11;
case 'C':
return 12;
case 'D':
return 13;
case 'E':
return 14;
case 'F':
return 15;
}
}
int htoi(char tens, char units)
{
int a = ten(tens);
int b = unit(units);
int sum = a + b;
return sum;
}
09-01-2014 06:48 AM