20
Get Started- TestStand RS and IVI v02 Page 1 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power Supply 1. Introduction This is a step-by-step guide to writing a program to remotely control the Genesys power supply using NI TestStand, the RS-232/485 serial bus and the Lambda IVI-C drivers. This tutorial begins with instructions for installing the IVI drivers and configuring them in the NI MAX program. 2. Table of Contents 1. INTRODUCTION ................................................................. 1 2. TABLE OF CONTENTS.......................................................... 1 3. ABSTRACT......................................................................... 2 4. REQUIREMENTS ................................................................. 3 5. ADDITIONAL HELP.............................................................. 4 6. VERIFY THE RS-232 HARDWARE .......................................... 5 7. CONFIGURE THE IVI DRIVER ............................................... 6 8. YOUR FIRST TESTSTAND RS-232 PROGRAM ........................ 14

Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

  • Upload
    dokhanh

  • View
    243

  • Download
    2

Embed Size (px)

Citation preview

Page 1: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 1 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

1. Introduction

This is a step-by-step guide to writing a program to remotely control theGenesys power supply using NI TestStand, the RS-232/485 serial bus andthe Lambda IVI-C drivers. This tutorial begins with instructions forinstalling the IVI drivers and configuring them in the NI MAX program.

2. Table of Contents

1. INTRODUCTION .................................................................1

2. TABLE OF CONTENTS..........................................................1

3. ABSTRACT.........................................................................2

4. REQUIREMENTS .................................................................3

5. ADDITIONAL HELP..............................................................4

6. VERIFY THE RS-232 HARDWARE ..........................................5

7. CONFIGURE THE IVI DRIVER ...............................................6

8. YOUR FIRST TESTSTAND RS-232 PROGRAM ........................ 14

Page 2: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 2 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

3. AbstractIf you have experience using TestStand, RS-232/485 serial and the IVI-Csteps, then here are the highlight issues for using the LaGen IVI drivers.

These issues are more fully described in bold red text in the sections below.

A. This document was written using TestStand 4.0, NI MAX 4.4, andLambdaGenPS IVI drivers 3.0.0. Results for earlier versions cannot beguaranteed.

B. TestStand 4.2 and earlier does not recognize the IVI logical name. TSonly uses the IVI session name as the instrument identifier.

C. The power supply’s RS-232/485 address and Baud rate are configuredin the Driver Sessions Driver Setup textbox.An example of the setup is “SerialAddress=6, BaudRate=9600”.

D. The default IVI Power Supply channel name is “CHANNEL1”. This mustmanually be changed to “Output1”.

E. The TestStand channel name supports the Physical Name (“Output1”).An error is returned if you use the repeated capability name(“Output”).

F. On the Output tab, change the Output Range Mode to “Use VoltageRange”. The default value, “Automatic”, will return an error.

G. On the Limits tab, you must check the OVP Enabled box. The nearestway to disable the OVP in a Genesys supply is to enter the maximumOVP setting into the OVP Limit text box (the max OVP is typically110% of the supply’s voltage rating).

H. Trigger capability, hardware or software, is not supported by theGenesys supply.

Page 3: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 3 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

4. RequirementsFor more specific software requirements, see the “Readme.txt” file that is onthe Start menu under “Programs Lambda LambdaGenPS”.

A. Windows XP or VISTA: This tutorial is written using Windows XPwith .NET version 2.0. Prior to Microsoft Vista, .NET is freely availableas a download. Dot NET version 1.x is not sufficient.

64-bit versions of the operating systems are not supported.

B. TestStand 4.0: The examples use the National InstrumentsTestStand 4.0 development environment. Results are not guaranteedfor earlier versions of TestStand.

C. Prior Experience with TestStand: This tutorial assumes priorexperience with TestStand. You should know how to create steps, runand debug your application.

D. IVI Drivers rev 3.0.0: After TestStand and related driver software isinstalled, download and install the Lambda Genesys IVI driverpackage. It is available from:

http://www.lambda-hp.com/product_html/genesys1u.htm

Click on the “Documentation Download Drivers” link to register.

Install the file “LambdaGenPS.3.0.1.msi” on your computer.

E. VISA Drivers rev 4.3: The IVI technology is built upon a layer ofhardware drivers called VISA (for “Virtual Instrument SoftwareArchitecture”). These drivers are installed with TestStand. Otherversions are untested.

F. IVI Shared Components 2.0.0.0: The LambdaGenPS IVI installermay report:

Download thesedrivers from:

http://www.ivifoundation.org/shared_components/Default.aspx

G. Electrical Interface: most computers and laptops have an RS-232port with a DB-9 connector. The Genesys power supply comesstandard with an RS-232 using an RJ-45 (Ethernet) connecter.

This tutorial also applies to RS-485 connections. However, an RS-485driver card and configuration settings ( 4-Wire RS-485) are required.

Page 4: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 4 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

5. Additional HelpIn addition to this document, a “Getting Started” and language reference isinstalled with the Lambda Genesys IVI driver package. This help file maybe opened through the Start menu as shown below:

Below is a sample of the Help file’s contents:

Additional help and tutorials may be found at the IVI Foundation website:

http://www.ivifoundation.org/

Page 5: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 5 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

6. Verify the RS-232 HardwareBefore configuring the IVI drivers, it is recommended to verify the RS-232connection is working properly. Do this by opening an RS-232communication program and sending some Genesys RS-232 commands.

In Windows XP, the HyperTerminal program is installed.

In Windows Vista, do a web search for “vista hyperterminal” to getHyperTerminal or some other RS-232 communication program.

See the Technical Manual for Genesys Power Supply to find how to set theaddress and Baud rate from the front panel. The manual also lists whatserial commands are available.

A sample HyperTerminal session may look like:

Close the communication window.Proceede to the next section to install the IVI drivers.

Page 6: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 6 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

7. Configure the IVI DriverAs part of the TestStand installation, the “IVI Driver Toolset” disk will add theIVI configuration feature to the MAX utility.

When the LambdaGenPS IVI drivers are installed, the MAX program willregister the “LaGen” drivers.

A. Open the NI MAX program. It is installed withTestStand. It has utilities to communicate toinstruments and to configure the IVI drivers.MAX version 4.4 is shown.

B. Expand the Instrument Driver Software Module branch and verify thethe “LaGen” IVI drivers are registered.

Page 7: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 7 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

C. Create a driver session for the Genesys power supply which wasdetected in section 6.

Right-click on “Driver Sessions” and click “Create New…”

D. See the NewDriverSession panel appear.Select “LaGen” for the Software Module.

Page 8: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 8 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

E. See the “NewDriverSession” appears.

Type in a name. In this example, we used “GEN_RS6_DS” to describethe Genesys on the RS-232 bus at address 6 Driver Session.

F. See the configuration panel for the “GEN_RS6_DS” driver sessionappears.

Previous registered instruments will be listed.

Page 9: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 9 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

G. Because RS-232 instruments cannot be automatically detected, theyhave to be manually added.

Click the “Add” button in the bottom-right of the “Hardware” panel.

H. See a prompt box for a new hardware asset name. In this example, wetype in “GEN_RS6_HA”

Page 10: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 10 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

I. Double-click under “Resource Descriptor”. See a list box of knownresources including all the RS-232 and RS-485 port aliases. In thisexample, the power supply is connected to “COM1”.

You can also type the RS-232/485 VISA port name directly. Forexample, “ASRL1::INST” is the VISA descriptor for alias “COM1”.

You may also double-click under the Descrition column and add adescription for this hardware asset (see following picture).

J. For the selected driver session (“GEN_RS6_DS”), select the checkboxto assign the hardware asset (“GEN_RS6_HA”).

Page 11: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 11 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

K. On the driver session “Software” tab, link this session to the “LaGen”drivers:

Page 12: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 12 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

L. On the driver session “General” tab, enter the power supply’sRS-232/485 address and Baud rate. The address and Baud may be setor viewed on the power supply’s front panel by holding down the“REM/LOC” button.

An example of the setup is:

SerialAddress=6, BaudRate=9600

These are the default address and Baud rate,change them to match your power supply settings.

Page 13: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 13 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

M. At this point, save your IVI settings. Click “Save IVI Configuration”.

N. The IVI configuration is complete. You may close the NI MAX program.

There are a number of Driver Session featureswhich may be set on other tabbed panels.For this example, all of these settings are kept atthe default settings.

If you are using TestStand 4.2 or earlier, TestStand does notsupport the use of logical names.

This means that creating logical names is not shown here. It alsomeans the IVI “Interchangeablility” feature, which allows swappinginstruments without changing your TestStand program, is notsupported.

Page 14: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 14 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

8. Your First TestStand RS-232 Program

A. Launch TestStand

For this example TS version 4.0 is used.

B. Add IVI Power Supply Step

From the Insertion Pallet, drag an “IVI-C Power Supply” step into yourprogram.

For this example, the step was renamed to “IVI GEN Configure”

Page 15: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 15 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

C. Configure the Step

Right-click on the IVI step. See a menu open.

Left click on “Edit IVI Power Supply…”

See the “Edit IVI Power Supply Step” window appear.

Select the Driver Session name which was created in section 7.

Although the TS panel shows the heading “Logical Name”,TS 4.2 and earlier only supports the driver session name.

Page 16: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 16 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

On the “Channels” tab, click the “Add” button. See “CHANNEL1” is added.

For the Channel Name, you must manually type in “Output1”.

The double quotes are required. For a single-channel instrument likethe Genesys, the channel name may be left blank.

For Output Range Mode, you may not use “Automatic”.

You must select “Use Voltage Range” or “Use Current Range”. Sincethe Genesys supply does not support ranges, either setting is acceptedand the Range text boxes may be kept at “0”.

Page 17: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 17 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

On the “Limits” tab, verify the “OVP Enabled” box is checked.An error will be returned if it is not checked.

The OVP value must also be entered for the ratings of thepower supply.

For the Genesys, the OVP cannot be disabled but it can be set to itshighest value, which typically is 110% of the supply voltage rating.

To find the maximum OVP setting, see the Technical Manual for your powersupply, in the SPECIFICATIONS table, PROTECTIVE FUNCTIONS.In this example using a GEN30-25, the maximum OVP value is 35 volts.

Click the “OK” button to close the “Edit IVI Power Supply Step” window.

Page 18: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 18 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

D. Run the Program

You are now ready to run the TestStand program (Ctrl-F5).

Using this example, when the program completes, the power supply will beset to 1.00 volts, 0.50 amps, and output ON. Also, the foldback is disabledand the under-voltage setting is unchanged.

E. Add Measurement Capability

Here is how to measure the power supply output voltage or current.

Add another “IVI Powers Supply” step under the configure step you justcreated. Rename the step to “IVI GEN Measure”

Right-click on the measure step to open the “Edit IVI Power Supply Step”window.

Open the Extensions tab and click the checkbox to enable the power supplymeasuring capability.

On the “Extensions” tab, do not select “Trigger”.This feature is not supported and an error will be returned ifTrigger is checked.

Page 19: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 19 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

Click on the “Operation” listbox. Change the operation to “Measure”.

The final measurement step will be:

The measured voltage destination will be a string “Step.Result.Reading”.

Page 20: Starting TestStand, IVI and RS-232 for the Genesys Power ... Start… · Get Started- TestStand RS and IVI v02 Page 3 of 20 Starting TestStand, IVI and RS-232 for the Genesys Power

Get Started- TestStand RS and IVI v02 Page 20 of 20

Starting TestStand, IVI and RS-232for the Genesys Power Supply

The sequence file we have created has two steps: configure and measure.The measurement taken in the second step may be incorrect because thepower supply takes a moment to apply a new output setting.

Therefore, it is necessary to add a Wait step between the configure andmeasure.

Now, the measurement step’s “Step.Result.Reading” will match the settingmade in the configuration step.