LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Electronic comparator

I would improve my program by adding these tasks:

  1. I would do electronic comparator and counter as is shown in the picture: when the voltage is bigger than the signal until the voltage becomes lower than the threshold, the counter increments by 1. Please see the picture, I would do the same thing when the voltage is lower than the signal and also when is equal to 0.
  2. In serial communication, I would first read the tdms file or txt file where all informations are in: time, signal, and counter values. Second, send these informations to another computer. I don’t know how to stock these informations and read them. I did the sending step.
  3. When the TDMS file arrives in its maximum size when the acquisition signal is being done, an other tdms file will be created automatically to stock the voltage values in real time.
Download All
0 Kudos
Message 1 of 45
(2,503 Views)

Hi ki4,

 

  1. Create your electronics as is shown in that image. Building electronics is something different than creating a LabVIEW VI…
  2. This "serial communication topic" was already solved in your other thread!
  3. You need to program that!

(I don't see any improvements in the VI  when compared to your other thread…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 45
(2,497 Views)

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

0 Kudos
Message 3 of 45
(2,491 Views)

Hi ki4,

 

  1. then recreate that functionality in LabVIEW. Doing comparison and counting is quite easy stuff: you can do that after taking the training lessons offered in the header of this LabVIEW board!
  2. How to handle TDMS files is shown in those example VIs coming with LabVIEW…
  3. Yes.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 45
(2,486 Views)

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.


GCentral
Message 5 of 45
(2,482 Views)

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!

 

0 Kudos
Message 6 of 45
(2,480 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 45
(2,460 Views)

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

0 Kudos
Message 8 of 45
(2,456 Views)

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.

Message 9 of 45
(2,435 Views)

and how to know the tdms size? is The "TDMS reserve file size"  the convenient command?

0 Kudos
Message 10 of 45
(2,433 Views)