Automating a time-constant measurement with the in-out

advertisement
Automating a time-constant measurement with the in-out.vi
LabVIEW 6i makes it still easier to automate measurements, compared with earlier
versions. First, make sure you understand how the time constant is calculated on pp.
M2-12 and M2-13 of the workbook. Then, after you have read Lab Skill Exercise M2-2
of the workbook, follow the directions below to construct your automated measurement
of an RC time constant.
Start with the in-out vi as it is on the machines in the lab. Right-click on the
graph, go to Visible Items and select Cursor Legend. Pull the cursor legend down and
create three cursors. Left-click on the little padlock symbol and do a Lock to Plot for
each cursor which locks the cursor to the plot that shows your exponential waveform.
After you’ve done the first cursor, your front panel would look like this after a fresh
measurement:
Make the three cursors have three different colors, so you can tell them apart. Right click
on the numbers on the cursor legend, choose Format and Precision, and change them to
scientific notation, as shown above.
After you’ve created three cursors, drag them into position on one rising or falling
segment of the exponential, and space them equally in time, as shown below:
A. Bruce Buckman – Fall 2002
1
There is sufficient numerical information on this front panel for you to calculate
manually the time constant according to the formula on p. M2-13 of the Workbook. You
are not going to calculate it manually, but instead use LabVIEW to calculate and display
the time constant.
1. Go to the diagram of the in-out.vi, and complete the following steps”
2. Create a While Loop in the lower right corner of your diagram.
3. Right click on the recirculating arrow in the lower right corner of the While Loop
and select Create Control. Name this control adjusting.
4. Put the acquired data graph inside this Loop and reconnect it.
5. Right click on the acquired data graph and Create -> Property Node ( In older
versions of LabVIEW, this was called an “Attribute Node”, and that’s how it is
named in the Workbook.
6. Add Items to the property node until you have four items.
7. Repeat steps 5 and 6 two more times.
8. Right click on one of the property nodes and go to Properties. You will see a
great many available properties. These properties can be either read properties,
(arrow leaving box) or write properties (arrow entering box).
9. Create an integer control named point spread. This control will position two of
your cursors.
Set up your three property nodes to look like those shown in the diagram below:
A. Bruce Buckman – Fall 2002
2
Wire your VI so its diagram looks like the one above. If you run your VI (be sure to turn
the control called adjusting on) it will continue running, and allow you to drag the
middle cursor (1) around, and the other two cursors will follow. You can also adjust the
spacing of the two end cursors using the point spread control. In effect, you have
created a VI that can read the cursor positions you control by dragging the middle cursor
and adjusting the point spread control: The horizontal and vertical coordinates of each
cursor are available to the program inside the while loop.
Now, write the program for calculating the time constant (by means of the formula in the
Workbook) in the remaining space inside the while loop. When finished, your diagram
should look like the one below:
A. Bruce Buckman – Fall 2002
3
When your VI is running properly, it should do the following:
1. Acquire a fresh set of waveform data,
2. Let you adjust the position of the center cursor (by dragging it) and the spacing
between cursors (by adjusting the point spread control,
3. Show calculated results for the time constant every time you change any setting.
Use this VI, instead of the one in the Workbook, to complete the measurements asked
for in Lab Skill Exercise M2-2.
A. Bruce Buckman – Fall 2002
4
Download