From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to draw a simple lines and/or boxes in Labview?

How is it possible to draw lines, squares, rectangles, circles in Labview? They don't need to be interactive or anything. Just the basics.

 

I've been trying to figure this out for a while now. Basically, the overall project is that I have a schematic of a machine which shoots lasers out of it. The schematic is visible in Labview and that's not a problem. But I want to show step-by-step, consecutively how far the "beam" has traversed down the machine's beamline. As in the beamline is seperated into three segments, and given different parameters the beam will only traverse down a portion at a time. I want to show on the schematic itself, how far down the beamline the beam has traveled. And I want to do this with a simple red line indicator of some sort, for example.

0 Kudos
Message 1 of 5
(10,501 Views)

Hi Orta,

 

there is a function palette dedicated to 2d graphics. It has functions to draw several shapes in a 2D picture indicator!

Best regards,
GerdW


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

Look at the Picture Control (which is really an indicator) under the Graph palette on the front panel, and the Picture functions under the Graphics & Sound palette on the block diagram. The picture functions are all documented in the help, and there are probably examples as well.

0 Kudos
Message 3 of 5
(10,491 Views)

If you only need horizontal or vertical lines, try the progress bar controls.  The numeric is shown default size for comparison.

 

Lynn

 

skinny progress bar.png

0 Kudos
Message 4 of 5
(10,487 Views)

Sounds interesteing.  Yes a picture control can do this for you and I'm always impressed with the amount of work that some put into making picture controls, not look like picture controls.  But a much easier way, if you can get away with it, is to use normal controls skinned to look different, with constant images as a background.  

 

Like johnsold demonstrated that standard controls can make lines and movements.  Picture Rings can be used to cycle between static pictures too.  The reason I recommend normal controls (rather than an elaborate picture control) is because they are much easier to interact with.  Need to draw a line that takes up 1/10 the size?  Well a slider is real easy just set the value to 1/10 the max range.

0 Kudos
Message 5 of 5
(10,471 Views)