Select Function:. Agilent Technologies VEE Pro


Add to my manuals
602 Pages

advertisement

Select Function:. Agilent Technologies VEE Pro | Manualzz

Appendix

Select Function:

Notice that this selection will configure the proper input and output pins for the function you select.

Editing UserFunctions:

If you import a library of UserFunctions programmatically, you will not be able to edit them. You can view them and set breakpoints to debug. If you want to edit the

UserFunctions you import, use the Merge Library command.

Set Variable Caution:

Notice that when you use a global variable in a function, you have to remember to create that global when using the function in other programs. One of the advantages of explicitly creating inputs and outputs is that they are easier to track.

VEE User’s Guide 527

Appendix

Creating Operator Panels and Pop-ups

Creating Operator Panels and Pop- ups, Step 1

Create a panel to ask an operator to enter numbers. Create a

UserObject to interact with an operator. Ask the operator for 2 inputs, A and B. Send both inputs to a display. Use a UserObject with Show On Execute checked to display the panel.

Solution—Creating Operator Panels and Pop- ups, Step 1

Figure 298 shows a solution in detail view. Figure 299 shows

the panel that appears when the program runs.

528

Figure 298 UserObject to Ask Operator to Input A and B

VEE User’s Guide

Appendix

VEE User’s Guide

Figure 299 Panel for Operator to Enter A and B

Key Points

UserObject Properties:

In the UserObject Properties dialog box, select Pop- Up Panel and click to turn on Show Panel On

Execute. Change the Pop-Up Panel

Panel Title name to “Enter

A or B .”

Creating Operator Panels and Pop- ups, Step 2

Instead of displaying both A and B, ask the operator whether to display A or B if the two numbers are different. After asking for the two values, if the values A and B are equal, display the value.

If the two values A and B are different, ask the operator to pick a value to display. Display A or B depending on the operator’s choice.

Hint: Add another UserObject with a pop- up panel that is set to Show Panel on Execute, and ask the operator for the value there.

Solution—Creating Operator Panels and Pop- ups, Step 2

Figure 300 shows the UserObject that asks the operator to

make a choice when

A and B are different numbers. Figure

301 shows the second pop- up panel that appears to ask the

operator whether to display A or B.

529

Appendix

Figure 300 UserObject to Ask Operator Whether to Display A or B

530

Figure 301 Panel for Operator to Choose Whether to Display A or B

Key Points

VEE User’s Guide

VEE User’s Guide

Appendix

Gate:

The Gate object only sends a value if the two numbers are equal.

Junction:

The JCT object allows multiple inputs to the object

Alphanumeric. The JCT object is a “wired OR” object.

List Object as a Menu:

Note the use of the Data

Selection

Controls

List object edited for two choices and formatted for a list. This configuration will output a text A or B. If you need the ordinal value ( 0 or 1), then use the List object's ordinal data output instead.

Creating Operator Panels and Pop- ups, Step 3

If the operator does not enter numbers, generate an error message. On the second UserObject, which asks the operator to choose whether A or B is displayed when the two numbers are different, add an error. If the operator does not choose A or B within 10 seconds, generate the error.

Solution—Creating Operator Panels and Pop- ups, Step 3

Figure 302 shows the UserObject modified to generate an

error if the operator does not choose A or B in 10 seconds.

531

Appendix

532

Figure 302 Generate an Error if Operator Does Not Enter a Choice

Key Points

Exit UserObject:

If the user responds in under 10 seconds, this object will exit the UserObject, even though the Delay object may not have finished executing.

Delay and Raise Error:

After 10 seconds the Delay object pings the Raise Error object, which will pause execution of the program and display the Error Message you have typed in. A red outline will also appear around the object that caused the error, which goes away when you click on the Stop or Run buttons on the main menu bar.

OK and Delay:

Notice the two threads in AnotB are separate, so that the OK and Delay are both running concurrently.

VEE User’s Guide

Appendix

Working with Files

Moving Data To and From Files

Create a VEE program to write the time of day to a file.

Generate 100 random points and write them to the file.

Calculate the mean and standard deviation of the numbers and append them to the file in the following format:

Mean: xxxxxx

Std Dev: yyyyyy

Next, read only the mean and standard deviation from the

file. Figure 303 shows moving data to and from files.

Solution—Moving Data To and From Files

.

Figure 303 shows a solution for moving data to and from

files.

VEE User’s Guide

Figure 303 Moving Data To and From Files

Key Points

533

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

Download PDF

advertisement

Table of contents