LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling variable timing to analyze data between two conditions

Hello all,

 

I am a novice to LabVIEW and am struggling with an issue with while/for loops. I am analyzing 30 isokinetic muscle contractions and am trying to obtain the torque produced during the contractions, but only when the subject had reached the desired speed (178-180 deg/sec). My goal is to have the program be able to spit out values after it runs all 30 contractions, but when I run my vi currently, it only runs the first contraction continuously. I have it calculating the total amount of samples analyzed for the first contraction and tried using that with shift registers to tell the while loop when it should begin the next iteration in time, but to no luck. Any help on this issue would be greatly helpful.

 

I will attach my vi to this post. Thank you in advance!

0 Kudos
Message 1 of 5
(1,459 Views)

Hi Ben,

 


@BenDalton wrote:

My goal is to have the program be able to spit out values after it runs all 30 contractions, but when I run my vi currently, it only runs the first contraction continuously. 


Because in each iteration you start to search from the beginning again!

You need to store the current search result in a shift register and in the next register you need to search after that index…

 

Btw. those WHILE loops used for searching should be autoindexing FOR loops…

Best regards,
GerdW


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

Hi Gerd,

 

Thank you for the response! I have added the shift registers and changed the while loops to for loops, but I guess I am confused how I wire the shift register to then have the for loop start the next iteration at the correct time. I will attach what the changes to my vi that I made.

 

Thank you so much again for the help.

0 Kudos
Message 3 of 5
(1,429 Views)

Can you run your VI once more until "vel" and "TQ" show typical data, make that data the default, and attach it once more so we can actually play with it?

 

How much noise is there? What are you actually trying to do? Your current code seems extremely convoluted.

0 Kudos
Message 4 of 5
(1,408 Views)

Hello,

 

I know that this isn't exactly what you're asking for, but as a "noob" with no experience in coding prior to this, it's the best I can do haha. The graph with several waves on top of each other has every variable plugged into it and then there are graphs with only one of the variables for better visualization. The "Automated TQ/VEL Signal" graphs are graphing the respective signal during the first iteration of the for loop. I will also attach an excel file that has the data from the when I ran this set of contractions. You will notice that it ran it 30 times, but just the same contraction every time rather than moving through the signal in time.

 

Sorry again for not knowing quite how to explain these things.

 

 

Download All
0 Kudos
Message 5 of 5
(1,396 Views)