5 examples using labview, Examples using labview -17, Setting limit model, written in visual basic -17 – KEPCO KLR Series Developers Guide User Manual

Page 39

Advertising
background image

KLR-DEV 060713

3-17

FIGURE 3-5. SETTING LIMIT MODEL, WRITTEN IN VISUAL BASIC

3.5

EXAMPLES USING LABVIEW

These LabView examples show the use of the IVI-COM driver with LabView 8. The procedure
used to create the examples is found in the KepcoDcPwr help file that was installed in the IVI
portion of your Start menu. Step by step instructions are detailed in:

• Getting Started with the IVI-COM Driver - Development Environments - Using LabView

'/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This program demonstrates how to set the limit model
' using the IVI-COM driver.
'/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Option Explicit

Public driver As KepcoDCPwr

Private Sub cmdExit_Click()
Unload Me
End Sub

Private Sub cmdStart_Click()

Set driver = New KepcoDCPwr

On Error GoTo ErrorHandler


' initialize the driver - note ID device is true
driver.Initialize "GPIB0::6::INSTR", _
True, _
True, _
"Cache=true,InterchangeCheck=false,QueryInstrStatus=true,Simu-

late=false"


Dim result As Boolean
result = driver.Initialized

' This will now set the limit model to a 36-32 unit.

driver.KpDCPwr_SetAttributeViReal64 KPDCPWR_ATTR_POSITIVE_VOLTAGE_RATED_LIMIT, 36
driver.KpDCPwr_SetAttributeViReal64 KPDCPWR_ATTR_POSITIVE_CURRENT_RATED_LIMIT, 32


driver.Close

StatusTextBox.Text = StatusTextBox.Text & "Driver closed." & vbCrLf
StatusTextBox.Refresh
Exit Sub
ErrorHandler:
MsgBox Err.Description
driver.Close
Exit Sub

End Sub

' Wait the specified number of seconds
Private Sub Delay(DelayTime As Single)
Dim Finish As Single
Finish = Timer() + DelayTime
Do
Loop Until Finish <= Timer()
End Sub

Advertising