02-25-2025 11:53 AM
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
Solved! Go to Solution.
02-25-2025 12:02 PM
Please do a "save for previous" (2020 or below) so more than 5% of readers can look at your example.
02-25-2025 12:06 PM
My apologies, see attached
02-25-2025 12:18 PM
@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?
02-25-2025 12:52 PM
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:
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.
02-25-2025 01:21 PM
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...
02-25-2025 01:45 PM
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.
02-25-2025 01:49 PM
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.
02-25-2025 01:51 PM
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.
02-25-2025 01:53 PM
@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.