LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

new & old position reporting

 
0 Kudos
Message 1 of 11
(3,288 Views)
I have made an LV in 6.0 that displays the movement of a motor. I have attached it. Can it be done more elegantly?
0 Kudos
Message 2 of 11
(3,279 Views)
Yes
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 11
(3,273 Views)
Yes.

Here is an example.

Lynn
0 Kudos
Message 4 of 11
(3,266 Views)

LV_Pro:  Good answer.  Smiley Very Happy  I've always wanted to do something like that, just never got the courage in this forum.

Lynn:  You should add a small time delay in your loop to avoid hogging the CPU.

- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 11
(3,263 Views)

Sorry, couldn't help it.

      Well there are a number of things. First, why do you have the second sequence structure, the add (of zero?) could be placed in the second frame and the whole sequence removed. Secondly, you aren't showing motor movement, just the modified count of pulses sent to one. I don't remember if LV 6.0 "thermometer" control/indicator had it, but in the current version (7.1) you can make the digital display visible, eliminating one of your indicators. The writes to the digital ports

P.M.
Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 6 of 11
(3,260 Views)

I'm not sure what features were available in LV 6.x, for instance, the digital I/O in the original doesn't have error clusters, so no dataflow (bad NI, bad! guess they had to learn how to use what they invented too!). Ditto the digital display on the thermometer, don't have 6 on these machines, couldn't check.

I wasn't planning on there being a long delay between my flipant answer and my more serious one, oops, me bad.

One comment to labview1958 (and all the others), neatness does count . It makes it so much easier to look at /troubleshoot, and takes very little time (particularly the more you do it). The newer versions of LV (7.x) even have a neat "Clean Wire" and "autorouting" which may be used (I don't always like LabVIEW's idea of neat though!) If you get around to taking the Certfied LabVIEW Developer exam, a major part of the grading is style/documentation, and with the exam being very time constrained it really is necessary to have it as a habit rather than trying to do it anew.

Down off of my soap box (I was getting dizzy!)

P.M.

Message Edited by LV_Pro on 08-04-2005 02:44 PM

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 7 of 11
(3,258 Views)
  • Sorry, I don't have the I/O functions, but you probably want to display some output from them instead of the loop count.
  • There is no reason for the second sequence. Could it be that you want to ensure that the display only updates once the IO has finished? In your example, there is no guarantee which sequence structure executes first because they don't have a data dependency.
  • If you have two identical VIs use only one instance in a FOR loop. Autoindexing is most convenient for this. If you wire the N across the loop, the display will only update once the loop has finished.
  • LabVIEW has a built-in function for "+0", it's called a wire 😉
  • Some ideas are shown in the attached image (sorry, I no longer have 6.0). The vertical slide indicator has the digital display visible. elminating the second indicator.
  • There has to be some sort of small wait statement, either in the big or in the small loop as needed.
 

Message Edited by altenbach on 08-04-2005 11:53 AM

0 Kudos
Message 8 of 11
(3,249 Views)
The DIO vi used is a high level vi that configures the port, then writes to it.  Inside that vi, there are error ins and outs.  I agree that NI should have made these available at the connector.  Since this vi is called multiple times (even if it is only two times), I would suggest using lower level vi's.  Use one DIO Config vi before the loop, then use the DIO Write vi inside the loop.  These lower level vi's have error ins and outs for data flow.  It is good to emphasize neatness to all newcomers.  A little extra time cleaning up goes a long way in ease of maintenance and future modifications.
- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 11
(3,243 Views)
Thanks. I understand the "zero" is not necessary. Thus I should connect "i" directly to multiply in place of the "zero". But why the need of the DBL between the "i" and the multiply?
0 Kudos
Message 10 of 11
(3,231 Views)