LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set variable samples per chanel from counter

Solved!
Go to solution

Hi, all. I have to set variable samples per chanel for sample clock. I want to take that samples from counter input with different number of edges for every second (different speed of metal plate). What can i do for that task? Is there a god example for this problem?

 

Thanks.

0 Kudos
Message 1 of 4
(3,144 Views)

Hi stefo,

 

what exactly is the problem?

You can set sample rate using DAQmxTiming function and you can read different amount of samples using the "number of samples" input of DAQmxRead function…

 

Btw. do you really need MatLab nodes to calculate those simple formulas in your screenshot?

Best regards,
GerdW


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

Hi, . Thanks for reply. I want Sample Rate and Samples per Chanel to come from couter. CI is a metal plate with 52 tooth. The speed of metal plate is 500 cycles/min but it is not constant ( may be 490-520). For example rate of cycles is 500/60=8.33 cycles/sec. Rate of edges (tooth) is 8.33*52=433 edges/sec, but when speed goes over or under 500 the rate is different. How to put that variable samples in sample clock on AI?

 

 

P.S. Matlab script is to calculate max samples per chanel for mean function in while loop. In the picture control "Speed cycles/min" is that 500 cycles/min speed. I have to put in that control the variable rate of edges. Other solution is to set 1 sample per edge, but i have problem here to :).  

0 Kudos
Message 3 of 4
(3,073 Views)
Solution
Accepted by topic author stefo83

Hi stefo,

 

you need to use the external pulses to trigger the AI channel. There are example VIs coming with LabVIEW/DAQmx explaining how to use external timing/triggers…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 4
(3,064 Views)