LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have an array in which I want to check and see if it falls within a certain range with about 7 different ranges. I have tried the range and coerce function but something is going wrong.

Also, I have a timer that lets me know how long the trigger has been active. I want to know if it is possible if that time would be reset everytime the trigger goes off.

0 Kudos
Message 1 of 17
(3,694 Views)

1. Do not run using the Continuous Run button! This is intended only for certain types of trouble shooting and not for normal operation.

2. Put a while loop around your entire program.  Add a stop button wired to the stop terminal of the loop.

3. Then you can replace all the feedback nodes with one shift register with the input expanded to five elements. Sum the three bottom ones for your averaging.

4. Nothing is wrong with the In Range and Coerce.  You should only check it when you have data.  That is what the Data Available output from Trigger and Gate is for.

5. I am not sure what you want to reset for your timer or exactly when, but it should be possible.

6. I did not try to figure it all out but you may not need the timer while loop once you wrap the loop suggested in 2 around the rest of the code.  You may be able to move the shift registers to the outer loop. 

 

Lynn

 

Code2 with loop.png

Message 2 of 17
(3,688 Views)

Hello. Thanks for the response. Some of these questions might sound funny but I am new to this.

 

3. Why the two extra nodes on the shift register and not just 3?

 

5.I need the timer to reset because I need to know when the elements in the array consistently exceed my threshold.

 

6. I didn't understand what you meant by this.

0 Kudos
Message 3 of 17
(3,683 Views)

Also, it seems that the range and coerce function responds to the trigger being on/off and not to the specific range that I have specified. For example, if I remove the trigger vi and it's components and wire the averaged array straight into the range and coerce vi, it does not ever respond.

0 Kudos
Message 4 of 17
(3,675 Views)

3. When I converted the three feedback nodes to shift registers, it created three shift registers.  One of the nodes had a 3 element delay, so I interpreted that as meaning that you did not want to include the first two elements in the average.  If you just want the three most recent elements, you only need a three element shift register.

 

5. I have been watching this thing and I am thoroughly confused about what the Trigger and Gat VI is actually doing.  I think I understand what it is supposed to do, but it does not seem to be doing it.  It seems to me that Triggered Data "N" should be a subset of Averaged Waveform. It is not.  I have been pausing the program and trying to match the points and they NEVER match.

 

Can you describe exactly what the timer is expected to do? What causes it to start? What should reset it?

 

Lynn

0 Kudos
Message 5 of 17
(3,671 Views)

I think the problem with In Range and Coerce is that for the Boolean to be True, EVERY element in the array must be between 140 and 149. The way you are generating the signal, that will never be true.  That would correspond to systolic and diastolic both being in that range for several heart beats.

 

Lynn

0 Kudos
Message 6 of 17
(3,669 Views)

Thanks Lynn. What I want to do is check element by element to see if they fall within the range of 140-149 and get a true/false response in each instance if this is possible. Is the trigger vi even necessary for this?

0 Kudos
Message 7 of 17
(3,643 Views)

If you want to check every element then just connect the entire array to In Range & Coerce. The array of booleans at the Coerced? output will have a True element for every input data element OUTSIDE the range.  You would not need the Trigger VI.

 

Lynn

0 Kudos
Message 8 of 17
(3,623 Views)

If you could look at this for me...I cannot get the range vi. to respond when the elements are in the specified range.

0 Kudos
Message 9 of 17
(3,601 Views)

It seems to work for me.

 

How are you running this and exactly what to you see that is not what you expect?

 

Lynn

0 Kudos
Message 10 of 17
(3,585 Views)