LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with LabVIEW VI: Plotting a Circle Using State Machine Design Pattern

Hey everyone,

I'm working on a LabVIEW project and need some help understanding how to implement it properly using a state machine design pattern.

📌 Task Description:

I need to design and implement a simple VI that:

  • Prompts the user for:

    • Name

    • Radius

  • Then plots a circle with the given radius on an XY Graph.

  • The VI should have:

    • A Start button to begin the sequence

    • A Stop button to exit

💡 Functional Requirements:

  • The VI should idle initially, waiting for either Start or Stop.

  • Once Start is clicked:

    • Prompt for Name and Radius.

    • Plot the circle using the radius on XY Graph.

  • Use a state machine design pattern to structure the VI.

Has anyone done something similar? Any tips, example VIs, or suggestions on how to structure the states would be super helpful!

Thanks in advance! 😊

0 Kudos
Message 1 of 5
(98 Views)

Hi KAUCHA,

 


@KAUCHA wrote:

Has anyone done something similar? Any tips, example VIs, or suggestions on how to structure the states would be super helpful!


Many/most of us have implemented state machines before.

LabVIEW even comes with an example for state machines: did you try to learn from that example? (Open the example finder and search for "state"…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(69 Views)

Can you make Vi. Solution of it? I would like to go through the solution. Thank you 🙂

0 Kudos
Message 3 of 5
(65 Views)

Hi KAUCHA,

 


@KAUCHA wrote:

Can you make Vi.


Yes.

 


@KAUCHA wrote:

Solution of it?


It's your homework, so you have to do the actual work!

 


@KAUCHA wrote:

I would like to go through the solution.


Use the example provided by NI to learn from it.

Post what you have done so far, ask specific questions - then we (many of us) will help you with your task…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(60 Views)

@KAUCHA wrote:

Has anyone done something similar? Any tips, example VIs, or suggestions on how to structure the states would be super helpful!


This will be a "simple VI" (your words) and should not take more than 5 minutes to complete.

 

As has been said, we don't do your homework, but here are some tips.

 

  • Define all possible states ands all allowed transitions between states.
    • idle
    • prompt for input
    • validate inputs (e.g. radius positive and in a certain range, name not empty string, etc.)
    • draw circle
    • exit
    • etc.
  • Create a typedef[d enum with items for all states.
  • Find out how to plot the circle (all at once? one point at a time? Timing?)
  • Turn off autoscale for the xy graph, make the plot area square, and ensure that dx = dy in pixel units.
  • What is the allowed range for the radius? Is zero allowed? Should it always fit completely on the graph?
  • What should happen with the entered name?
  • For the circle, using a complex datatypes will dramatically simplify the code. No trigonometry needed. Also xy graphs understand complex arrays with will graph IM vs RE.
  • etc.

Now start coding! 😄

0 Kudos
Message 5 of 5
(21 Views)