LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering the Write to measurement file

Hi,

 

I am using BNC2110 and PCI 6123 card to data log the signal from piezo pressure sensors and PCI 6251 to get the RPM from the motorcycle.

 

I would now like to trigger the writing to measurement file from pressure sensors in regards to RPM. I would like the VI to write my data when the RPM would reach let's say 3000 RPM and stop when it would reach 3005 RPM.

I tried to do that with Case structure, but I have trobule at conditioning the RPMs, I get the 1-D array from AND function instead of only Boolean.

 

Take a look at my VI I built. I wrote the Lower threshold as double, compare it to RPMs, used it again and added it 5 RPM and compare it again with input from RPM. If the RPM would be somewhere in between, this should trigger the Case True and writing would happen.

 

Is my approach even appropriate for this kind of job? Any help would be appreciated. Thank you.

 

 

0 Kudos
Message 1 of 5
(2,729 Views)

So, you want to write only the datasets that apply to these conditions; but you wire an array of bools to the case structure. It might already help if you run a for loop through the boolean array and if true, pick the according set of data from the Waveform Chart 3 data.

 

I made a scetch for this here, I am sure you get the idea.

conditional saving.jpg

0 Kudos
Message 2 of 5
(2,722 Views)

in addition to questionmarker reply i will suggest you to use in range and coerce function for comparison and getting boolean array to make your block digram clean and not to use express vi's.

Message 3 of 5
(2,720 Views)

In range and coerce function was great idea, it simplifies the comparison, thank you. Learned something new.

 

Now for the data writing. As it is obvious from the VI I attached, I have a separate loop for RPM and for data logging from sensors. I need the information about RPM in the upper while loop to condition the data writing there. 

When I wire the data about RPM range from lower loop to upper, the lower works and the upper stops, the while loop just stops. Any idea?

 

Questionmarker, did I get your idea right? English is not my native language, so I can't always deduce everything from an answer.

0 Kudos
Message 4 of 5
(2,713 Views)

Hello Hexagonal,

You are missing a very basic but key concept.

if your while loop continue working it will not give any output.

Why don't you use producer/consumer design( oy can find a standard vi from "vi form templetes")

for multiple loop configuration.

0 Kudos
Message 5 of 5
(2,708 Views)