From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Last pulse data indicator

Hello,

 

I would like to create an algorithm to get array including pulse data. I use Labview 2019.

 

Normally, i will receive pulses from a DAQmx channel (NI 9423 - DI), but before connecting to cRIO, i created a pulse detection algorithm in a random vi file. I have found elapsed time calculation between pulses algorithm in an another forum content. Based on this algorithm, i have successful results to receive pulse time. However, i could not get auto-indexed values of pulse times. In design case, user will write an input number to specify the required pulse numbers. Then, program will get average time of these pulses. Then it will be used to calculate a flow rate data in a more precise way. To get pulse time, we use a namur sensor and in real application we will use pulse data that is received from this namur sensor.

 

I tried to get auto-indexing by using a for loop inside a while loop, but it always indexes the last value and indicates at 0th indice of array, i could not get success to list more than 1 value into the array 🙂

 

Could you please support about this algorithm ?

0 Kudos
Message 1 of 2
(892 Views)

Hi arda,

 

You're currently reinitializing your array of time values every iteration of the While loop.

Instead, you should use a Case Structure and something like Build Array, then Array Subset (to allow changing the array length at run time, perhaps with some maximum size, more complicated but possible) or with Replace Array Subset and Rotate 1D Array (or a rotating pointer to the element to replace) if you initialize the array outside and don't allow changing "Counter value" during execution (it can still be a control, it would then just only matter at the beginning).

 

Here's a quick set of hints on your block diagram (rearranged to make it easier in my opinion to read - you might disagree...)

Pulse list_BD.png


GCentral
0 Kudos
Message 2 of 2
(875 Views)