LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

draw a straight line

Design a system that can plot a straight line from the coordinates of two given points

using for loop and formula from block diagram

can someone help

0 Kudos
Message 1 of 6
(809 Views)

My guess that this is homework, why else would there be such specific requirements (FOR loop, formula, etc.). You don't really need any of that but it's a good learning experience.

 

  • Start with the training resources listed at the top of the forum.
  • Look at your class notes
  • talk to your classmates

 

How far did you get so far?

 

  • Did you figure out how to create a new VI? (it's not a "system!)
  • Did you find the front panel and block diagram?
  • Did you find the FOR loop?
  • Did you find a way to enter the coordinates on the front panel?
  • For arbitrary lines, use an xy graph. did you find that? Did you read the help for it?
  • Given two points, a plot of the xy graph can draw a line between them. No extra code needed.
  • Personally, I would use plain graphical code, no formula node
  • etc.
0 Kudos
Message 2 of 6
(791 Views)

The length component of the problem was solved a few millennia ago by a guy named Pythagoras. 

 

It sounds like you have a point A to start at  and a point B to end at already.  All you need then is to figure out which way to go and how far to go that way.

 

That sounds like a nice continuation of the Greek theme!  Maybe you could find some Math Functions that have parameters of Rho and Theta 😉

 

I cannot understand why you would need a loop and all the functions needed are easily available. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 6
(747 Views)

I did not see any "length" component in the problem description, but the term "plot" could of course mean many things. For simplicity, I assumed a virtual line on an xy graph, but it could easily also be about how to drive two stepper motors of an xy stage moving a real pen around. 😄

0 Kudos
Message 4 of 6
(743 Views)

@altenbach wrote:

I did not see any "length" component in the problem description, but the term "plot" could of course mean many things. For simplicity, I assumed a virtual line on an xy graph, but it could easily also be about how to drive two stepper motors of an xy stage moving a real pen around. 😄


Oh, in that case we only need M and B!  Double check me but, isn't get scale (linear) on the Math pallet still?  I thought that accepted an array of points as cluster <x,y>


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 6
(732 Views)

We still don't know what a "system" is (as in "... design a system ...").

 

All we probably need is a size=2 complex 1D array defining the two points, a wire, and a xy graph. 🙂

0 Kudos
Message 6 of 6
(726 Views)