Example Code

Mohr Circle and Failure Envelope

Code and Documents

Attachment

Overview:

Draw Mohr circles with a related failure envelope based on tangent between reference circles.  These concepts are used in Civil and Mechanical Engineering. 

Description:

The function implements a Mohr circle based on front-panel controls designated Qn (x-axis minimum) and Max (radius).  It then plots a line tangent to two circles designated on the front panel, where the number of the circle designated by the control correlates to the order they were added to the plot.  The code uses sub-VIs to implement much of the functionality.  Sub-VIs include createAxis, createCoordinates, createTangentParameters, drawCircle, drawTangent, and orijin.  These VIs are called based on user events when the user either adds a circle (using the Insert Circle button) or draws a tangent (using the Draw Tangent button).  When adding circles, the user has control over the x-axis minimum value and the radius; Qn and Max, respectively.  When drawing the tangent line, the user has control over which two circles the line will be drawn tangent to.  It is possible for the tangent line to be drawn outside the standard area of the plot; if this occurs, try resizing the plot to view the entire circles.

Steps to Implement:

1.  Download and unzip the Mohr Circle and Tangent LV 2010 ZIP folder.

2.  Place the unzipped files into a common folder to ensure the main VI can reference the sub-VIs.

3.  Open and run Draw Mohr Circle and Tangent Main VI.

4.  Set values for Qn and Max, then click Insert Circle to add a circle.  Repeat this step as many times as necessary.

5.  Set which circles you desire to use as tangential references.  Typically, you should use the first and last circle added.  Click Draw Tangent to plot the line.

Requirements:

Software: LabVIEW 2010 or later

Hardware: No requirements

Draw Mohr Circle and Tangent Main VI Front Panel

Mohr Circles FP.png

Draw Mohr Circle and Tangent Main VI Block Diagram

Mohr Circles BD.png

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread**


Himmet GENCER
Software Development Coordinator at TDG
himmetgencer@gmail.com

View Himmet Gencer's profile on LinkedIn

View on Instagram

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors