From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-02-2011 04:28 AM
Hi,
I need to log/store the data of measurements acquired from my micro-controller for further readings by the operator.
So far my readings for Four (4) parameters are working perfectly, therefore i need to modify my Vi design to store these four parameters as well. Please help me.
Solved! Go to Solution.
09-02-2011 08:59 AM
OK.... so what's your question? You have not indicated in what format you're supposed to store the values. Do you want columns? If so, use the Write to Spreadsheet File VI.
Code comments:
09-02-2011 09:28 AM
Storing the values can be in any format since there is no restriction about it. Columns is good if i can have.
Since my knowledge is poor about it, and i am still a beginner and reading books. Can you please help me to modify the necessary changes?
Thanks in advance.
09-02-2011 12:24 PM
I would, but I can't make code change on a picture. You will need to upload your actual VI.
09-02-2011 10:55 PM
Yes sure, Now you can find the attached .vi file over here to do necessary modification.
Thanks in advance.
09-03-2011 01:34 PM - edited 09-03-2011 01:34 PM
Attached is a modification of your VI. I put in the modifications I had suggested, as well as fixing up your error handling. Previously you had the case structure inside the loop. Thus, if any errors were encountered prior to the loop, the loop would execute the false case, which did absolutely nothing. Worse, your VI would simply contine looping around and around, consuming 100% of your CPU. I changed it so that the loop doesn't even execute if there's an error during the setup. You probably don't want to stop the VI if there's a read error since this may happen occasionally, and it is not necessarily a "must stop" error condition. Thus, I just set it up to log an error on the front panel. You can make up whatever string you want.
See if you understand the changes I made.
09-03-2011 02:06 PM
It's working perfectly and as the requirement of the project. Thanks alot.
Now the only thing which lefts is to maximize the accuracy of this multi-channel data acquisition. By the way, the values which are shown in my LCD is like this (light=15.4 , Temp=30C, Voltage=12.4V, current= 2.3A). but in LABVIEW it only shows the the inter like this light=15, voltage= 12 and ....)
DO you have any idea on how i can decimilize it. Since i am using PIC16F877A and it converts by 10-bit. But when i sent to through UART it becomes 8-bit only and affect the acuracy.
Basically what do you advise to do to maximize the accuracy? Any changes at the PIC code part?I can send you my pic code which is written in .c (Hi-tech compiler). Let me know if it helps.
09-04-2011 08:46 AM
Hi
do you have by accident a localized decimal point and this one is not seen from your controller by LabVIEW.
The USA is so nice to us Europeans that we always have problems with it.
If this is the case uncheck localised decimal point in the options.
There is another way but that is more work and anyhow I'm used to a decimal point.
09-04-2011 10:39 AM
Hi,
I just unchecked the localised decimal point in the option as you said, and the result remained the same.
Regarding this sentence, (The USA is so nice to us Europeans that we always have problems with it.) i shall add that, i am not American. I am Asian and basically in Asian perception, they beleive that they are hurt by both American & European during the history ;). However i still love the land of flowers 😉
Anyways, here is a nice place to share ideas about technical issues.
Back to my problem, i share some part of the PIC16F877A code (C Language, Hitech Compiler) which i think is related to ADC configurations and accuracy of the readings.
//--------------------------Light Sensor LDR
//sensor A //LDR
ADCON0=CHANNEL0;
lcd_goto(8);
read_adc(); ////This function generates the average reading value of ADC
light=read_temp(); ////This function stores the generated value by ADC into the variable "temp"
dis_num(light/10);
send_char('.');
dis_num(light%10);
putch(light/10);
//--------------------------Temperature Sensor LM35
//sensor B //LM35
ADCON0=CHANNEL1;
lcd_goto(28);
read_adc();
temperature=read_temp();
temperature = (temperature*0.48876);
putch(temperature);
dis_num(temperature);
//==================subroutine ADC=========================
void read_adc(void) ////This function generates the average reading value of ADC
{
unsigned short i;
unsigned long result_temp=0;
for(i=2000;i>0;i-=1) //looping 2000 times for getting average value
{
ADGO = 1; //ADGO is the bit 2 of the ADCON0 register
while(ADGO==1); //ADC start, ADGO=0 after finish ADC progress
result=ADRESH;
result=result<<8; //shift to left for 8 bit
result=256*result|ADRESL; //10 bit result from ADC
result_temp+=result;
}
result = result_temp/2000; //getting average value
}
unsigned short read_temp(void) ////This function stores the generated value by ADC into the variable "temp"
{
unsigned short temp;
temp=result;
return temp;
}
09-08-2011 02:49 AM
If supposed to present the multi channel data acquisitio.vi, how do you prefer to present it?
Basically, if we divide it into several concepts which are accomodated within this labview program, how do you define this concepts?
Since my knowledge about labview is poor, i want to go and study about implemented concepts within this software for my presentation