Question: ( 3 0 points ) Using a flat sequence structure is an effective method for controlling execution order when bench - marking code performance. By
points Using a flat sequence structure is an effective method for controlling execution order when bench
marking code performance. By combining the flat sequence structure with tick count function nodes, users can
accurately measure the execution time of code within a sequence frame. As an example, Figure shows two
methods for creating a D array of bit signed integers. One approach uses a for loop, while the second uses
a while loop. It turns out that one of these approaches takes less time to execute than the other; this is true
even if we add an Equal? function node in the for loop to balance out the tinne required by the similar function
in the while loop. In this exercise, you will use the flat sequence structure to determine execution time of both
loop structures. Be sure to include the VIs you create for this problem with your solutions.
Figure : Block diagram for the sub VI
a points The for loop and while loop structures use autoindexing tunnels to generate D arrays of signed
bit integers. Assume the value for N is set to be How many elements are in the D arrays
displayed by the indicators labeled output and output respectively? What are the th elements
in output and output respectively?
b points Describe the indicators labeled output and output in a sentence or two.
c points Code and execute the sub VI shown in Figure Using the LabVIEW code provided in
pspstarter.vi as a starting point, complete a VI to automate the measurement of the average loop
execution time. Place the subVI inside a for loop and execute it times. Initialize the subVI to make a
small change to the size of the array it creates during each iteration. Use the loop to generate arrays of the
execution times for both the for and while loops within the subVI Exclude the first measured time
and compute the average execution time for each loop type. Run your code and include screenshots of
both the front panel and block diagram in your written submission. Additionally, submit the entire code
as a zip file along with your written solutions. Record the average execution time for both the for and
the while loops, and based on your results, determine which loop structure is more efficient.
Figure : Initialization code for the sub VI
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
