LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to input both new data and state data with RMS pt by pt?

Solved!
Go to solution

Hello,

 

I am a newbie trying to take a very simple vi that reads and displays raw and RMS(ptbypt) of voltage from a single channel and upscale it to read 8 at once. 

 

My question revolves around getting the RMS ptbypt to work inside the for loop. I believe that I need to wire the auto indexed measurement to the RMS vi, then wire the output into a shift register to build an array of the outputs for each channel. I'm struggling to understand whether calling the RMS ptbypt vi inside the for loop will work the way I want to it though. Am I re-initializing the function every time I call the for loop and just getting a result for one value? If so how can I input both the new data and the state data into the function to be processed? 

 

I have attached the code I'm trying to upscale, as I am still struggling with the new version. I will post my best attempt if it would help. Thanks all,

 

-Bryan

0 Kudos
Message 1 of 13
(988 Views)

Please do a "save for previous" (2020 or below) so more than 5% of readers can look at your example.

0 Kudos
Message 2 of 13
(983 Views)

My apologies, see attached

0 Kudos
Message 3 of 13
(980 Views)

@Bryan7 wrote:

Hello,

 

I am a newbie trying to take a very simple vi that reads and displays raw and RMS(ptbypt) of voltage from a single channel and upscale it to read 8 at once. 

 

My question revolves around getting the RMS ptbypt to work inside the for loop. I believe that I need to wire the auto indexed measurement to the RMS vi, then wire the output into a shift register to build an array of the outputs for each channel. I'm struggling to understand whether calling the RMS ptbypt vi inside the for loop will work the way I want to it though. Am I re-initializing the function every time I call the for loop and just getting a result for one value? If so how can I input both the new data and the state data into the function to be processed? 

 


  • Please define ambiguous words such as "upscale". Do you want to read 8 samples of a single channel at once or eight different channels at once? (both have nothing to do with any scaling).
  • I don't see a FOR loop.
  • If you want RMS on eight channels, you need 8 instances of the ptbypt VI. You can also write your own that operates in arrays.
  •  
0 Kudos
Message 4 of 13
(973 Views)

Ok, are there guidelines to posting here that I neglected to read? I am not trying to be frustrating and I'm concerned that I am. 

 

To address your bullet points:

  • I simply used upscale to mean 'increase the scope of', in this case to take the program from handling one channel to 8. 
  • In the last line, I wrote that I had posted the code I was trying to modify. I will attach the WIP version of the code including the for loop on this post, but it is incomplete. 
  • Based on the code mentioned above, if you think it would be better for me to run 8 instances of mean ptbypt I can do that. 

 

In the attached code, my intention is to use the boolean array to stop the while loop when all channels RMS drops below a certain value (currently 0.05). I have not figured this part out yet.

 

My question is whether the RMS ptbypt will work the way I have it wired right now or if I need to find a way to include the array in the shift register in its inputs.

 

Thank you for your time. 

Message 5 of 13
(957 Views)

Hi Bryan,

 


@Bryan7 wrote:

In the attached code, my intention is to use the boolean array to stop the while loop when all channels RMS drops below a certain value (currently 0.05). I have not figured this part out yet.


So you want to act when ALL conditions are met? In boolean logic this typically is done with an AND function...

 


@Bryan7 wrote:

Ok, are there guidelines to posting ...


Well: be as precise as possible. And keep in mind this is a worldwide forum and many users don't speak English natively...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 13
(949 Views)
Solution
Accepted by Bryan7

You cannot use a FOR loop, because there will only be one instance of the ptbypt VI, so it will mix all channel data as it arrives. the ptbypt is relatively simple code (and you can open and look at it!). It would be easy to use it as a template to create one that deals with N channels without many changes.

Message 7 of 13
(939 Views)

Hi GerdW, thank you for the feedback. I will endeavor to be as precise as possible in all future posts. 

 

I have a basic understanding of boolean logic and I think I can figure that part out. 

 

I'm just trying to understand whether the RMS ptbypt function will 'remember' the data from previous iterations of the for loop or if I need to change that part. 

 

 

0 Kudos
Message 8 of 13
(936 Views)

Ok, thank you! I was worried that was the case. I will take a look at it and see if I can make that work. 

0 Kudos
Message 9 of 13
(934 Views)

@Bryan7 wrote:

I'm just trying to understand whether the RMS ptbypt function will 'remember' the data from previous iterations of the for loop or if I need to change that part. 


The ptbypt function will remember the define history and will only reset if you wire a true to that special terminal.

 

Assuming that the history size and number of channels remains constant during the run, you could probably take my old multichannel mean ptbypt and change it do calculate RMS instead. should be trivial.

Message 10 of 13
(929 Views)