Example Code

Retaining a 2D Path in a LabVIEW 2D Picture Control

Code and Documents

Attachment

Introduction

In a lot of situations, there may be a need to retain an xy path. A good example of this is a robot. It may broadcast its instantaneous x,y positions, and you may want a program that plots accumulated positions in a path.

FP PATH.PNG

This VI does just that, using a 2D picture control to display the path. You can select between manual control, or a pre-defined circular path. If you ever wanted to integrate this into a real application, you could the replaces the x and y control on the front panels with the real data received from the robot. Please note, this VI does not perform any form of interpolation on the points. If broadcast rate is slow, then the path will appear as a series of dots instead of a solid path. The best approach to add interpolation would be to directly interpolate between the received x and y co-odinates, then write this additional data to the 2D Picture.

Josh E
Applications Engineer
National Instruments UK & Ireland

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

Contributors