LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filters Errors

Solved!
Go to solution

Dear crossrulz

 

I have found the main reason why the VI is not working but i just cant tell why . 

 

 

well when i run the VI and it says error at the peak detector . i double clicked the staistics VI and i let it display the number of samples and the time between samples. well the time is right as i configured it . 0.001 BUT the number of samples is giving  only 1 ! eventhough i have collected 25000 samples . 

 

what is causing this ?  i feel like we're very close to the solution .... I am going out of my mind ..:S

Bill David
0 Kudos
Message 11 of 18
(953 Views)

Have you really captured that many samples (25000)?  Just because your collector is set to that doesn't mean you really have that many samples.

 

How many iterations of your loop before the error?  Again, if you are only capturing 1 data point per loop, you will have to wait at least 15 iterations before performing the peak detect.

 

I also question your string to number conversion scheme.  What is the format supposed to be coming from the micro.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 12 of 18
(949 Views)

ah okay . well  I am using a string to byte array function .and teh output of it is connected to a waveform that displays the signal . so every single byte s drawn here . so yes I am dealing with a single point . 

 

what do i have to do in this case . can you suggest anything to solve this ..kindly 🙂

 

Thank you . 

Bill David
0 Kudos
Message 13 of 18
(945 Views)

sorry i fogot to answer the other part of the question .

 

concernin the conversion to a number . if you take a look at the VI you will see that was using a for loop and some stuff to convert from hex values to decimal .but now i am only using a singla function that does all that . it is a string to byte array function . since the microcontroller (16F874  from microchip) sends a word or a byte . so i am dealing with bytes at the serial port . 

 

I hope i made it clear 🙂

 

Bill David
0 Kudos
Message 14 of 18
(944 Views)

@Bildavid wrote:

ah okay . well  I am using a string to byte array function .and teh output of it is connected to a waveform that displays the signal . so every single byte s drawn here . so yes I am dealing with a single point . 

 

what do i have to do in this case . can you suggest anything to solve this ..kindly 🙂

 

Thank you . 


Ok, since you only have a single byte coming in at a time, you need to hold off your peak detection.  As I stated earlier, use the statistics VI to output the number of samples collected.  If more than 15 samples have been collected you can perform the peak analysis.  If not, do nothing.  Use a case structure.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 15 of 18
(938 Views)

Dear crossrulz 

sorry for the misunderstanding i am making here , i beg your pardon . but i meant to say that the microcontroller sends a stream of bytes at a time . but i just cant know specifically the number of bytes the microcontroller sends .

 

what to do in this case please 

 

AGAIN sorry :S

 

Bill David
0 Kudos
Message 16 of 18
(931 Views)

The solution I gave you is not dependent on the number of samples you are acquiring in each iteration.  Get the number of samples collected.  If greater than 15, then you can do the peak detection.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 17 of 18
(927 Views)

Does it make sense ? 

Bill David
0 Kudos
Message 18 of 18
(924 Views)