LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform .... Problem

Solved!
Go to solution

Well I Take The (MutiChannel ADC )Input From A  Microcontroller.i.e uC has 6ADC uC does its work and sends it serially..

 

my problem is when i use a write waveform to file....

the TDMS contians more than 2 values for the same time

hence when i o/p the waveform is wrong.....its much igger(time sense)

 

How to Build A Waveform With Instantaneous Values Of Amplitude

0 Kudos
Message 1 of 6
(2,730 Views)
You are going to have to show your code. For me, there are simply too many conflicting statements and missing details.
0 Kudos
Message 2 of 6
(2,712 Views)

void setup() 
{
Serial.begin(9600);
pinMode(A0,INPUT);
pinMode(A1,INPUT);
pinMode(A2,INPUT);
pinMode(A3,INPUT);
pinMode(A4,INPUT);
pinMode(A5,INPUT);
while(1)
{
if(Serial.available())
{
Serial.write("TESTING\r\n");
Serial.read();
Serial.read();
break;
}
}
}

 


void loop() 
{
int ip0,ip1,ip2,ip3,ip4,ip5;
ip0=analogRead(A0);
ip1=analogRead(A1);
ip2=analogRead(A2);
ip3=analogRead(A3);
ip4=analogRead(A4);
ip5=analogRead(A5);
char signal[25];
sprintf (signal, "%04u%04u%04u%04u%04u%04u",ip0,ip1,ip2,ip3,ip4,ip5);
Serial.write(signal);



}

 

 

 

this is the code for the arduino

 

As u can see from attached image.... for the same time it shows it shows different values .... henc the output is longer

 

 

the laview code is not complete yet.... so please dont sy the code is bad ....i know it is .... this is just to see if everything works

 

Download All
0 Kudos
Message 3 of 6
(2,683 Views)
Solution
Accepted by topic author karthik9

What is the .tar file you attached?

 

Looking at your screenshot, I see the timestamps in your table.  Are you relying on Windows timing to get the timestamps?  Do you know that Windows only has a resolution on its clock of about 16 milliseconds?  That is why you see several pieces of data with the same time, then it jumps 16 milliseconds.

Message 4 of 6
(2,677 Views)

Ok so how do i write waveform data .... into some file and use it later

0 Kudos
Message 5 of 6
(2,672 Views)

Thanks Man...16ms was the problem i just had to resample the signals

0 Kudos
Message 6 of 6
(2,665 Views)