Home
LabVIEW Execution Trace Toolkit User Guide
Contents
1. 4 LabVIEW Execution Trace Toolkit User Guide This document provides an overview of the LabVIEW Execution Trace Toolkit The LabVIEW Execution Trace Toolkit is a real time event and execution tracing tool that allows you to capture and display the timing and event data of applications you build with the LabVIEW Real Time Module Refer to the LabVIEW Real Time Module User Manual for information about developing deterministic applications using LabVIEW Contents Installation MS CHC ONS se n csini ianiai 2 Introduction to the LabVIEW Execution Trace Toolkit 0000000000 2 Capturing a Trace SCSSIOM oi tcinssceinsicdnnnseiith aducsheinteeSeatanndendeedddeiaddsshcetentanatanaes 2 Starting a Trace SessiOfi ssssiisssrooocrn oan i aa 2 Stopping a Trace Session icssc eres sceeadiacasensaderaccteesdcacdednsadeancetiniteenendies 3 Viewing Trace SCSSI OMS a5 sasacenssandaisauvatantncdadenspacteatenendeanadotudemtecncatdenasont 4 Viewing and Analyzing VI Event ccccccceeeesesesseeeeeeeeseeeeeees 5 Viewing and Analyzing Thread Events ccc0ceseeeeeseeeeeeeeeeees 8 Logging Analysis and Custom Events ccccccccceeececeeeeeeeeeeeeeeaeeeaeeees 9 Displaying Analysis Events cccccccceseeeeeeeeeeeeeeeceeeeeeeeeeeeeeeeeeees 9 Logging and Displaying Custom Event sseeeseeeeeeeeeeeeees 10 Working with Trace Sessions ccccccccccsseeeeseesssnsesssesseseseess
2. You can load the trace session into the LabVIEW Execution Trace Tool at a later time Select File Close Session to close a trace session You must save the trace session before closing if you want to load the session into the LabVIEW Execution Trace Tool at a later time Loading Trace Sessions You can load saved trace sessions into the LabVIEW Execution Trace Tool by selecting File gt Open Session If you have more than one trace session open in the LabVIEW Execution Trace Tool use the pull down list at the top of the window to choose the trace session you want to view Troubleshooting Refer to the Troubleshooting topic of the LabVIEW Execution Trace Toolkit Help available by clicking the Troubleshooting button on the LabVIEW Execution Trace Tool palette for answers to common questions you might have when using the LabVIEW Execution Trace Tool Where to Go from Here The LabVIEW Execution Trace Toolkit provides example VIs that you can explore to learn more about using the LabVIEW Execution Trace Tool and the Execution Trace Tool VIs to analyze LabVIEW applications You can access the LabVIEW Execution Trace Toolkit examples by selecting Help Find Examples in LabVIEW 323738A 01 Apr04
3. events you want to view from the Analysis menu of the LabVIEW Execution Trace Tool The LabVIEW Execution Trace Tool displays a flag followed by a dashed line in the Thread Events view to indicate the time range for the occurrence of the analysis event You can show the following analysis events e Sleep Span Occurs when a thread sleeps to allow lower priority threads to execute The LabVIEW Execution Trace Tool displays Sleep Span events using a blue flag e WaitFor Object Span Occurs when a thread must wait for access to a low level resource before executing The LabVIEW Execution Trace Tool displays WaitFor Object Span events using a red flag e WaitForMem Span Occurs when a thread conducts any memory management operation The LabVIEW Execution Trace Tool displays WaitForMem Span events using a green flag National Instruments Corporation 9 LabVIEW Execution Trace Toolkit User Guide Figure 8 shows a Sleep Span event that begins in an unnamed thread running at normal priority The unnamed thread sleeps and other threads execute during the Sleep Span event The unnamed thread continues to execute when the Sleep Span event ends 3 ETS Timer Thread 16 LabVIEW Thread Standard 14 Unnamed Thread 216 LabVIEW Thread Standard 10 Unnamed Thread 2 ETS Null Thread 13 Unnamed Thread 6 ETS TCPVIP Timer Thread Figure 8 Analysis Event Flag Logging and Displaying Custom Events The LabVIEW Execution Trace To
4. assigned to the Standard execution system The custom event flag shows the exact time when the TraceTool Log User Event VI executes in the application 16 LabVIEW Thread Standard 14 Unnamed Thread 216 LabVIEW Thread Standard DT 10 Unnamed Thread 2 ETS Null Thread Figure 10 Custom Event Flag Refer to the LabVIEW Execution Trace Toolkit Help for more information about how to create a custom event using the LabVIEW Execution Trace Tool Working with Trace Sessions You can print the current trace session from the LabVIEW Execution Trace Tool You also can save a trace session and then load the session in the LabVIEW Execution Trace Tool at a later time Printing Trace Sessions You can print the current view of a trace session by selecting File Print Window from the LabVIEW Execution Trace Tool You can print the entire trace session or you can print a specific range of the trace session by using the zoom tools to display the range before printing Refer to the Viewing Trace Sessions section for information about using the tools on the LabVIEW Execution Trace Tool palette to display specific ranges of a trace session National Instruments Corporation 11 LabVIEW Execution Trace Toolkit User Guide Saving Trace Sessions After the LabVIEW Execution Trace Tool receives a trace session from the RT target you can save the trace session on the host computer Select File Save Session to save the trace session to file
5. ion VI Events View The left pane of the VI Events view lists the names of all VIs in memory on the RT target when you captured the trace session The number that precedes the VI name is the dataspace ID assigned to the VI by the real time operating system The dataspace ID identifies the memory dataspace assigned to a VI The Execution Trace Tool lists reentrant subVIs more than once with a different dataspace ID for each copy of the VI in memory as shown with the Shared VI in Figure 3 The LabVIEW Execution Trace Tool draws the events for each VI directly to the right of the VI name with respect to time You can click on a VI name and drag it up or down in the list to rearrange the order of events in the VI Events view The LabVIEW Execution Trace Tool redraws the VI Events view to show the new order You can use the tools in the LabVIEW Execution Trace Tool palette to display a specific region of the trace session Figure 4 shows a zoomed region of the trace session shown in Figure 3 23 TraceTool Start Trace vi 29 TopLevel I vi 26 Shared VI vi 27 AboveNormalLoop vi 21 TimeCriticalLoop vi mal 13 Triangle Wave PtByPt vi 14 Sine Wave PtByPt vi 12 Square Wave PEByPE vi 20 Shared VI vi 18 Shared VI vi 19 Shared VI vi 28 NormalLoop vi 24 TraceTool Stop Trace And Send 15 global variable vi N T T T 99 911mS 105ms 110ms 115ms Figure 4 Zoomed View of the VI Events View LabVIEW Executi
6. me running at a priority that matches the priority of the AboveNormalLoop VI The TimeCriticalLoop VI attempted to send a waveform to the NormalLoop VI using a global variable The above normal priority thread running the AboveNormalLoop VI blocked the time critical priority thread that was executing the TimeCriticalLoop VI from accessing the global variable This example illustrates how resource contention causes unexpected timing behavior The real time operating system allowed a lower priority thread to block the time critical thread in order to release the resource Refer to the LabVIEW Real Time Module User Manual for information about shared resources and resource contention Logging Analysis and Custom Events The LabVIEW Execution Trace Tool can show when events such as sleep spans memory manager calls and resource mutexes occur in an application You also can create custom events that you can log in a trace session to show the execution of specific sections of an application Kp Note You must enable detailed tracing and thread tracing using the TraceTool Start Trace VI when you start the trace session to display analysis and custom events Refer to the Capturing a Trace Session section for information about enabling detailed tracing when starting a trace session Displaying Analysis Events The LabVIEW Execution Trace Tool can show the occurrence of specific analysis events in the trace session of an application Select the analysis
7. ol also can display custom user events Select Analysis Custom Event Flags to open the Customize Event Flags dialog box Use the Customize Events Flags dialog box to create a custom event flag You must assign a color and event code for the custom event flag You can use any number from 0 to 255 to differentiate different custom events by event codes Use the TraceTool Log User Event VI to log a custom event in the trace session The Event ID input of the TraceTool Log User Event VI must contain the event code of a custom event flag that you create in the Customize Events Flags dialog box Figure 9 shows the block diagram of the AboveNormalLoop VI from the example application with the TraceTool Log User Event VI added The Event ID input receives the event code of 17 The trace session logs any occurrence of this custom event You then can create a custom event flag in the LabVIEW Execution Trace Tool with an event code of 17 to display the occurrences of the custom event in the Thread Events view LabVIEW Execution Trace Toolkit User Guide 10 ni com Tick Count ms Tick Count ms Subtract Greater Or Equal Wait Until Next Multipl Sawtooth it Time Fay E h LEJ Ly opooooooooooooooooooooooooooooooooooooooooooooooo0oag Figure 9 Logging Custom User Events in the AboveNormalLoop VI Figure 10 shows a custom event logged in the AboveNormalLoop VI The AboveNormalLoop VI executed in a LabVIEW thread running at normal priority and
8. on Trace Toolkit User Guide 6 ni com The zoomed region starts with the execution of the TimeCriticalLoop VI from Figure 5 The VI Events view shows that the TimeCriticalLoop VI launches three VIs that generate waveforms The TimeCriticalLoop VI then launches three copies of the reentrant Shared VI one after another Tick Count ims Subtract Tick Count ms gt Greater Or Equal Figure 5 TimeCriticalLoop VI Block Diagram The TimeCriticalLoop VI sends the three waveforms to the NormalLoop VI shown in Figure 6 using global variables The TimeCriticalLoop VI then sleeps allowing other VIs to execute Tick Count fms Subtract Greater Or Equal Tick Count ris CA D gt global variable vi global variable vi global variable vi global variable vi Sawtooth Wawe Sawtooth EDEL iHz Figure 6 NormalLoop VI Block Diagram National Instruments Corporation LabVIEW Execution Trace Toolkit User Guide B Note The LabVIEW Execution Trace Tool lists the VI names of global variables in the left pane of the VI Events view but does not draw events for the variables Viewing and Analyzing Thread Events The LabVIEW Execution Trace Tool displays thread event data in the Thread Events view The Thread Events view shows the execution of threads in the real time operating system of the RT target The left pane of the Thread Events view lists the thread names preceded by a dataspace ID The LabVIEW Execution Trace Tool sho
9. seeeeseeeeeees 11 Printing Trace SeSSiONS pivcasssdcecnsaseaavacuceacscvetuciactienencuscecuaiseuniiveweraid 11 Saving Trace SESSIONS wxecosdcavesihonaetneesaundiovtespadetmescsatincdccausnedadtoseatecss 12 Loading Trace Sessions sseeseeererersssereseeessserssssesssssensssesssesst 12 TROWUB IES MO GUUS asc sescesassexnesdnedonstnedddaedegieusdtaupestinddscadesaan acanstusdetoesescaddscnees 12 Where to GO Trom Hore secseenoiorri itin edain N RNA 12 LabVIEW National Instruments NI and ni com are trademarks of National Instruments Corporation Product and April 2004 company names mentioned herein are trademarks or trade names of their respective companies For patents covering 323738A 01 National Instruments products refer to the appropriate location Help Patents in your software the patents txt file on your CD orni com patents TNT 2004 National Instruments Corp All rights reserved Printed in Ireland INSTRUMENTS Installation Instructions Complete the following steps to install the LabVIEW Execution Trace Toolkit 1 Windows 2000 NT XP Log in as an administrator or as a user with administrator privileges before you install the LabVIEW Execution Trace Toolkit 2 Insert the LabVIEW Execution Trace Toolkit CD into the CD ROM drive The LabVIEW Execution Trace Toolkit installation program runs automatically 3 Follow the instructions that appear on the screen Introduction to the LabVIEW Exec
10. sion The VI in Figure 1 uses a Flat Sequence structure to define the dataflow of the block diagram and force the TraceTool Start Trace VI to execute before VIs in the application The TraceTool Stop Trace and Send VI executes after the application completes You can start and stop the trace session in a subVI of an application to target a specific section of code and to conserve space in the memory buffer National Instruments Corporation 3 LabVIEW Execution Trace Toolkit User Guide You also can use the TraceTool Stop Trace and Save VI to stop logging event data and save the trace session to a file on the RT target You can transfer the trace session file to the host computer using the TraceTool Load Trace and Send VI Refer to the Working with Trace Sessions section for information about working with trace sessions on the host computer Refer to the LabVIEW Help by selecting Help VI Function amp How To Help in LabVIEW for VI reference information about the Execution Trace Tool VIs Viewing Trace Sessions The LabVIEW Execution Trace Tool displays a trace session graphically using the VI Events and Thread Events views as shown in Figure 2 Lab IEW Execution Trace Tool Torx File Edit Yiew Analysis Help o Sessions Available For viewing vio sec ay gle 59 52 2 Thread Events view VI Events view Figure 2 LabVIEW Execution Trace Tool Views When the LabVIEW Execution Trace Tool loads a trace session i
11. sion tool to display the entire trace session in the VI Events and Thread Events views Viewing and Analyzing VI Events The LabVIEW Execution Trace Tool displays VI event data in the VI Events view The VI Events view shows all VIs in memory on the RT target when you captured the trace session and when the VIs executed on the RT target with respect to time from left to right The LabVIEW Execution Trace Tool displays VI events in different colors to distinguish the execution priority of each VI Table 1 lists the colors associated with each LabVIEW priority Table 1 Priority Color Representation National Instruments Corporation 5 LabVIEW Execution Trace Toolkit User Guide The LabVIEW Execution Trace Tool displays the time range for the current view below the VI Events view Figure 3 shows the VI Events view of the trace session for the example application from Figure 1 14 TraceTool Start Trace vi 22 TopLevel I vi ll abst of ll 0 ol ao ico H IC a Oo Oo m O Oo Oo Wee SEN REK RER RAE GAE REE KEE RRE KAR KES fen REE REN fhe KAA RER REE EE KEN CAE KER DEE HEE 4 Triangle Wave PtByPt vi i mar tt at tt tt 5 Sine Wave PtByPt vi 21 AboveNormalLoop vi 20 Shared VI vi 12 TimeCriticalloop vi 3 Square Wave PEByPE vi 11 Shared VI vi 9 Shared VI vi 10 Shared VI vi 13 NormalLoop vi 15 TraceTool Stop Trace nd Send Figure 3 Example Applicat
12. t displays the entire trace session in the VI Events and Thread Events views To display only the Thread Events view or only the VI Events view in the LabVIEW Execution Trace Tool deselect from the View menu the view that you want to hide LabVIEW Execution Trace Toolkit User Guide 4 ni com You can zoom in and out of a region of the trace session or measure the timing of a specific range in the trace session using the following tools available in the LabVIEW Execution Trace Tool palette Use the Cursors tool to display two cursors in the VI Events or Thread ps Events view to measure the timing of the range contained between the two cursors Click and drag each cursor on the VI Events or Thread Events view to set the range you want to measure Use the pull down menu to the left of the Cursors tool to select the units for the timing measurement The text box to the left of the Cursors tool displays the measurement results Use the Zoom Region tool to zoom into a region you select Click and drag in the VI Events or Thread Events view to select a zoom range Use the Zoom In tool to zoom into the VI Events and Thread Events view Click on the VI or Thread Events view with the Zoom In tool to zoom into the currently displayed range Use the Zoom Out tool to zoom out of the VI Events and Thread Events views Click on the VI Events or Thread Events view with the Zoom Out tool to zoom out of the currently displayed range Use the View Entire Ses
13. tart Trace VI You must reboot the RT target to resize the memory buffer LabVIEW Execution Trace Toolkit User Guide 2 ni com C Wait Time ms Time Detailed Tracing F error out out NormalLoop vi jormal Loop Count Figure 1 Starting and Stopping a Trace Session The amount of time you can capture in a trace session depends on the size of the memory buffer and the type of events that you choose to capture You can disable the logging of VI thread and detailed events The Thread Tracing and VI Tracing inputs of the TraceTool Start Trace VI specify whether to log thread and VI events The Detailed Tracing input of the TraceTool Start Trace VI specifies whether to log detailed events which the LabVIEW Execution Trace Tool uses to display analysis and custom events Refer to the Logging Analysis and Custom Events section for information about analysis and custom events Stopping a Trace Session The TraceTool Stop Trace and Send VI stops logging event data on the RT target and then sends the trace session to the LabVIEW Execution Trace Tool running on the host computer Specify the IP address of the host computer running the LabVIEW Execution Trace Tool using the Trace Host Network Address input of the TraceTool Stop Trace and Send VI Figure shows the block diagram of a VI with the TraceTool Stop Trace and Send VI added Kp Note The LabVIEW Execution Trace Tool must be running on the host computer to receive the trace ses
14. ution Trace Toolkit The LabVIEW Execution Trace Toolkit includes the LabVIEW Execution Trace Tool and the Execution Trace Tool VIs The Execution Trace Tool VIs allow you to capture the timing and execution data of VI and thread events for applications running on an RT target The LabVIEW Execution Trace Tool displays the timing and event data or trace session on the host computer Launch the LabVIEW Execution Trace Tool by selecting Tools Lab VIEW Execution Trace Tool in LabVIEW Capturing a Trace Session The LabVIEW Execution Trace Tool displays trace sessions you capture using the Execution Trace Tool VIs You must add Execution Trace Tool VIs to the block diagram of an application running on the RT target to start and stop the logging of timing and event data from VIs and operating system threads Starting a Trace Session The TraceTool Start Trace VI starts logging event data on the RT target Figure 1 shows the block diagram of a VI with the TraceTool Start Trace VI added The Buffer Size input of the TraceTool Start Trace VI sets the size of the memory buffer that collects all event data for the application on the RT target Set the size of the memory buffer large enough to contain all event data If you reach the memory buffer limit when logging event data the TraceTool Start Trace VI overwrites the oldest data in the buffer ny Note You cannot change the size of the memory buffer on the RT target after you run the TraceTool S
15. ws the name of the execution system where a thread runs in brackets for all LabVIEW threads The LabVIEW Execution Trace Tool displays thread events in different colors to distinguish the execution priority of each thread Table 1 lists the colors associated with each LabVIEW priority The priority of thread events matches the priority of VI events of the same color Figure 7 shows a section of the example trace session gt Lab IEW Execution Trace Tool File Edit view Analysis Help Session 0 IP 10 0 40 142 1 7 2004 11 25 AM Main Application Thread ETS Timer Thread ETS TCPVIP Timer Thread Unnamed Thread Unnamed Thread Unnamed Thread Unnamed Thread LabVIEW Thread Standard Lab IEW Thread Standard Lab IEW Thread Standard Unnamed Thread LabVIEW Thread Standard ETS Null Thread Unnamed Thread TraceTool Start Trace vi TopLevelVI vi Shared VI vi AboveNormalLoop vi TimeCriticalloop vi Triangle Wave PLByPE vi Sine Wave PEByPE vi Square Wave PtByPt vi Shared VI vi Shared VI vi Shared VI vi NormalLoop vi TraceTool Stop Trace And Send 5 global variable vi 198 873mS 19 440mS Figure 7 Thread Events View LabVIEW Execution Trace Toolkit User Guide 8 ni com The TimeCriticalLoop VI and the AboveNormalLoop VI appear to execute at the same time at about 206 ms However the Thread Events view shows a thread executed during this ti
Download Pdf Manuals
Related Search
Related Contents
AirPal Patient Transfer System Service Manual Dual DVI USB KVM Switch Panasonic KX-TA624-4 User Manual Addendum Baixar Manual Jury : mode d`emploi ». - Le Fonds d`Expérimentation pour la Forum des métiers Insignia NS-DPF7WM-09 Digital Photo Frame User Manual Copyright © All rights reserved.
Failed to retrieve file