05-13-2019 04:33 AM
I would improve my program by adding these tasks:
05-13-2019 04:37 AM - edited 05-13-2019 04:39 AM
Hi ki4,
(I don't see any improvements in the VI when compared to your other thread…)
05-13-2019 04:40 AM
01.I would build counter not electronic compenent.
02.Ya it was solved but not stock value in txt file or tdms file and read them before sending them to an other computer. I don't do that!
03.Ya I need to programm that
05-13-2019 04:49 AM
Hi ki4,
05-13-2019 04:53 AM
To get started with the first point, you might find the Threshold Detector VI, available under Signal Processing > Signal Operation > Threshold Detector (near the bottom) useful.
To check for values crossing through the lower bound, negate both the threshold and the input array (there's a node to negate numeric values, i.e. to multiply by -1).
If you use this VI, you'll need to check what value of Width to set based on your data (for noisy data, you probably need a larger value). This prevents multiple counting when you're close to the threshold and going above-below-above-below due to noise in the signal.
To check for =0, you really want to look at the sign changing. Checking for =0 will usually not work in this case (imagine you sample the value at 0.1, then again at -0.1. You believe sometime in between it was 0, but you don't record that value, so it was never =0). There's a Sign node on the numeric palette that might be helpful - perhaps there's a better way that someone else can suggest.
05-13-2019 04:55 AM
Hi
1.Have you seen my programm? I did comparaison and counter but it s not what is required because it counts all samples which are bigger than the threshold.
2. I dont understand!
05-13-2019 05:35 AM
Hi ki4,
I did comparaison and counter but it s not what is required because it counts all samples which are bigger than the threshold.
Then you created a VI which is not the equivalent to your desired algorithm.
You need to change your VI to match your requirements!
05-13-2019 05:52 AM
And after I divise the number of threshold detected by two ( I understand).
I will test it. So how to creat an other tdms automatically when the file arrives to its maximum size i would do that to avoid crushing the data detected and replace it by new ones. Thnks
05-13-2019 07:28 AM
What do you mean by "crushing the data detected"?
If you want to open a new file, keep checking the file size of the current file. If it exceeds a size, inside the True case of a case structure, close the current file reference and open a new file reference. The file reference wire should be maintained in a shift register.
05-13-2019 07:33 AM
and how to know the tdms size? is The "TDMS reserve file size" the convenient command?