SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
Static Public Member Functions | Properties | Static Private Member Functions | Static Private Attributes | List of all members
Seci.LabView.LabViewApp Class Reference

This class contains the DCOM connection to the LabVIEW application and stores a reference to all the loaded VIs (not just those of the current configuration) in a dictionary. There are methods for starting and stopping LabVIEW application, loading and running VIs, and for controlling their status. More...

Collaboration diagram for Seci.LabView.LabViewApp:
Collaboration graph

Static Public Member Functions

static Boolean AreYouThere ()
 
static Boolean CloseVI (String fileName)
 Method for closing a VI. The VI cannot be closed if it is still running, so it has to be aborted first. Note: the VI will still be in memory until LabVIEW is closed, so if it is reopened the "closed" version will be brought back with the same settings as before. This is why it is important that the LabVIEW process is terminated when a configuration is closed. More...
 
static int[] GetBounds (String fileName)
 Method to get the bounds of a VI's front panel. It is messy bcause the application returns the values as an array of objects. More...
 
static Object[] GetCluster (String fileName, String clusterName)
 Method for retrieving the values of a cluster/array as one lump. A cluster is an untyped array, that may contain a range of types. it is not listed as a control in LabVIEWPanel, so the name must be known. There are no checks to see if the control exists. More...
 
static Boolean GetControls (String fileName, Boolean includeClusters)
 Method for getting a list of the controls on a VI's front panel. The list of controls are stored in the corresponding LabVIEWPanel class. More...
 
static String GetControlTime (String fileName, String control)
 
static String GetFrontPanelTitle (String fileName)
 Gets the current window title of the VI's front panel More...
 
static List< String > GetListOfControls (String fileName)
 Method for retrieving a list of a front panel's controls. More...
 
static List< String > GetLLBInfo (String fileName)
 Method for getting a list of VIs in a LabVIEW Library file (.llb). The is done via a National Instrument VI that loads the .llb and lists the contents on the front panel. Not an ideal method, but it appears to be the only way. More...
 
static Object GetRawValue (String fileName, String controlName)
 Method for retrieving a raw value of a front panel's control. This method returns the control value exactly as it comes off the VI, no tidying up or casting is performed. There is no checking to see if the control exists - if there is any problems it will throw an error. More...
 
static String[] GetValue (String fileName, String controlName)
 Standard Method for retrieving a value of a front panel's control. The control has to exist in the corresponding LabVIEWPanel class. Returns an array because the control may be an array or cluster. More...
 
static Boolean HideAllVIs ()
 Method to hide all the VIs' front panels. Done via the LabVIEW application not Win32 API. More...
 
static Boolean HideVI (String fileName)
 Method to hide a VI's front panel. Done via the LabVIEW application not Win32 API. More...
 
static Boolean IsVIHidden (String fileName)
 Method to check whether a VI is hidden or not More...
 
static Boolean IsVIPresent (String fileName)
 Method for checking whether a VI is present in the dictionary. More...
 
static Boolean IsVIRunning (String fileName)
 Method for checking whether a VI is a running state. More...
 
static Boolean LoadVI (String fileName, Boolean includeClusters)
 Method for loading a VI. More...
 
static Boolean LoadVI (LabViewPanelInfo panelInfo, Boolean includeClusters)
 Method for loading a VI. More...
 
static void MinimiseVI (String fileName)
 Method to minimise the front panel More...
 
static Boolean MoveFrontPanel (String fileName, int[] bounds)
 Method to set the position of a VI's front panel. This does not change the width or height of the panel. First old bounds are found and the width and height are calculated. Then the new bottom-right position is set as the new top-left co-ordinates plus the old width and height. More...
 
static void RestoreVI (String fileName)
 Method to restore the front panel (i.e. no longer minimised) More...
 
static Boolean SetCluster (String fileName, String clusterName, Object[] values)
 Method for setting a cluster or array's value. A cluster is an untyped array, that may contain a range of types. it is not listed as a control in LabVIEWPanel, so the name must be known. There are no checks to see if the control exists. More...
 
static Boolean SetRawValue (String fileName, String controlName, Object value)
 Method for setting a raw value on a front panel's control. This method sends the value straight to the VI no checks are performed. There is no checking to see if the control exists - if there is any problems it will throw an error. More...
 
static void SetTitleBarVisibility (String fileName, Boolean visible)
 Method to set the appearance of a VI's front panel. If set to false then the VI will be shown without the titlebar, borders etc. More...
 
static Boolean SetValue (String fileName, String controlName, Object value)
 Standard method for setting a control's value on the front panel. More...
 
static Boolean ShowVI (String fileName)
 Method for displaying a VI and bringing it to the front. The front panel can be made visible through the LabVIEW application; however, the Win32 API is required to bring it to the front of the screen. More...
 
static Boolean StartLabView (String executionDir)
 Create an instance of LabVIEW, if one has not been started. Also starts the controls exporter VI. If LabVIEW fails to start then this is a serious problem. More...
 
static Boolean StartVI (String fileName)
 Start the specified VI running. More...
 
static Boolean StopLabView ()
 Method for stopping LabVIEW. The safest way to kill LabVIEW is to kill the process as this guarantees that it has closed completely. More...
 
static Boolean StopVI (String fileName)
 Stop the specified VI from running. More...
 
static void UpdateFrontPanelTitle (String fileName)
 Update the stored window title for the front panel of the VI More...
 

Properties

static Boolean IsNull [get]
 
static List< String > VIsNotLoaded [get]
 

Static Private Member Functions

static void configureLabVIEW ()
 Method for editing the LabVIEW.ini file. This is set to do the following: More...
 
static void getFrontPanelTitle (String fileName)
 Update the stored window title for a specific front panel More...
 
static bool loadVI (String filepath, LabViewPanelInfo panelInfo, Boolean includeClusters)
 Main method for loading a VI. Uses the LabVIEW application command GetVIReference to load the VI The VI object is then stored in the dictionary. Finally, a list of the front panel controls is acquired. More...
 

Static Private Attributes

static
strongnameLabview.VirtualInstrument 
_controlsExporter
 A VI that is used to export the controls list of other VIs. More...
 
static
strongnameLabview.Application 
_LV
 The LabVIEW application. More...
 
static SerialisableList
< LabViewPanelInfo
_panelsSettings
 List containing the settings for the panels. This is the information that is saved in the configuration. More...
 
static
strongnameLabview.VirtualInstrument 
_titleExporter
 A VI that is used to get the title of the front panel. More...
 
static Dictionary< String,
LabViewPanel
_VIs
 Dictionary for storing the VIs as they are loaded - stored using their filepath as a key. More...
 
static List< String > _VIsNotLoaded = new List<String>()
 Contains a list of the VIs that could not be loaded as the VI could not be found. More...
 

Detailed Description

This class contains the DCOM connection to the LabVIEW application and stores a reference to all the loaded VIs (not just those of the current configuration) in a dictionary. There are methods for starting and stopping LabVIEW application, loading and running VIs, and for controlling their status.

Definition at line 20 of file LabViewApp.cs.

Member Function Documentation

static Boolean Seci.LabView.LabViewApp.AreYouThere ( )
inlinestatic

Definition at line 203 of file LabViewApp.cs.

Referenced by Seci.LabView.LvmqUpdater.backgroundUpdater_DoWork().

static Boolean Seci.LabView.LabViewApp.CloseVI ( String  fileName)
inlinestatic

Method for closing a VI. The VI cannot be closed if it is still running, so it has to be aborted first. Note: the VI will still be in memory until LabVIEW is closed, so if it is reopened the "closed" version will be brought back with the same settings as before. This is why it is important that the LabVIEW process is terminated when a configuration is closed.

Parameters
fileNameThe full filepath for the required VI
Returns
Result

Definition at line 336 of file LabViewApp.cs.

References Seci.LabView.LabViewPanelInfo.FilePath.

static void Seci.LabView.LabViewApp.configureLabVIEW ( )
inlinestaticprivate

Method for editing the LabVIEW.ini file. This is set to do the following:

  • Hide LabVIEW so it does not show in the task bar.
  • Hide the tools palette if it is visible.
  • Use the defualt LabVIEW menus.

Definition at line 137 of file LabViewApp.cs.

References Seci.Definitions.Status.LabViewIniFilePath.

static int [] Seci.LabView.LabViewApp.GetBounds ( String  fileName)
inlinestatic

Method to get the bounds of a VI's front panel. It is messy bcause the application returns the values as an array of objects.

Parameters
fileNameThe full filepath of the VI
Returns
Integer array containing the positions of the top-left and the bottom-right corners

Definition at line 635 of file LabViewApp.cs.

static Object [] Seci.LabView.LabViewApp.GetCluster ( String  fileName,
String  clusterName 
)
inlinestatic

Method for retrieving the values of a cluster/array as one lump. A cluster is an untyped array, that may contain a range of types. it is not listed as a control in LabVIEWPanel, so the name must be known. There are no checks to see if the control exists.

Parameters
fileNameThe full filepath of the VI
clusterNameThe name of the cluster
Returns
Object array containing the cluster values

Definition at line 888 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.GetControls ( String  fileName,
Boolean  includeClusters 
)
inlinestatic

Method for getting a list of the controls on a VI's front panel. The list of controls are stored in the corresponding LabVIEWPanel class.

Parameters
fileNameThe full filepath of the VI
includeClustersWhether to include clusters
Returns
Result

Definition at line 774 of file LabViewApp.cs.

static String Seci.LabView.LabViewApp.GetControlTime ( String  fileName,
String  control 
)
inlinestatic

Definition at line 810 of file LabViewApp.cs.

static void Seci.LabView.LabViewApp.getFrontPanelTitle ( String  fileName)
inlinestaticprivate

Update the stored window title for a specific front panel

Parameters
fileNameThe full filepath for the required VI.

Definition at line 294 of file LabViewApp.cs.

static String Seci.LabView.LabViewApp.GetFrontPanelTitle ( String  fileName)
inlinestatic

Gets the current window title of the VI's front panel

Parameters
fileNameThe full filepath for the required VI.
Returns
The title as a String

Definition at line 312 of file LabViewApp.cs.

static List<String> Seci.LabView.LabViewApp.GetListOfControls ( String  fileName)
inlinestatic

Method for retrieving a list of a front panel's controls.

Parameters
fileNameThe full filepath of the VI
Returns
String List containing the names of the controls

Definition at line 796 of file LabViewApp.cs.

static List<String> Seci.LabView.LabViewApp.GetLLBInfo ( String  fileName)
inlinestatic

Method for getting a list of VIs in a LabVIEW Library file (.llb). The is done via a National Instrument VI that loads the .llb and lists the contents on the front panel. Not an ideal method, but it appears to be the only way.

Parameters
fileNameThe full filepath of the library
Returns
List of Strings containg the names of the VIs and other information

Definition at line 479 of file LabViewApp.cs.

References Seci.Definitions.Status.ExecutionDir.

static Object Seci.LabView.LabViewApp.GetRawValue ( String  fileName,
String  controlName 
)
inlinestatic

Method for retrieving a raw value of a front panel's control. This method returns the control value exactly as it comes off the VI, no tidying up or casting is performed. There is no checking to see if the control exists - if there is any problems it will throw an error.

Parameters
fileNameThe full filepath of the VI
controlNameThe name of the control
Returns
Object containing the value

Definition at line 858 of file LabViewApp.cs.

static String [] Seci.LabView.LabViewApp.GetValue ( String  fileName,
String  controlName 
)
inlinestatic

Standard Method for retrieving a value of a front panel's control. The control has to exist in the corresponding LabVIEWPanel class. Returns an array because the control may be an array or cluster.

Parameters
fileNameThe full filepath of the VI
controlNameThe name of the control
Returns
String array containing the control value

Definition at line 827 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.HideAllVIs ( )
inlinestatic

Method to hide all the VIs' front panels. Done via the LabVIEW application not Win32 API.

Returns
Result

Definition at line 607 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.HideVI ( String  fileName)
inlinestatic

Method to hide a VI's front panel. Done via the LabVIEW application not Win32 API.

Parameters
fileNameThe full filepath of the VI
Returns
Result

Definition at line 582 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.IsVIHidden ( String  fileName)
inlinestatic

Method to check whether a VI is hidden or not

Parameters
fileNameThe full filepath of the VI
Returns
Result

Definition at line 733 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.IsVIPresent ( String  fileName)
inlinestatic

Method for checking whether a VI is present in the dictionary.

Parameters
fileNameThe full filepath of the VI
Returns
Result

Definition at line 382 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.IsVIRunning ( String  fileName)
inlinestatic

Method for checking whether a VI is a running state.

Parameters
fileNameThe full filepath of the VI
Returns
Result

Definition at line 392 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.LoadVI ( String  fileName,
Boolean  includeClusters 
)
inlinestatic

Method for loading a VI.

Parameters
fileNameThe full filepath for the required VI
includeClustersWhether to include clusters
Returns
Result

Definition at line 226 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.LoadVI ( LabViewPanelInfo  panelInfo,
Boolean  includeClusters 
)
inlinestatic

Method for loading a VI.

Parameters
panelInfoThe panel information for the required VI
includeClustersWhether to include clusters
Returns
Result

Definition at line 237 of file LabViewApp.cs.

References Seci.LabView.LabViewPanelInfo.FilePath.

static bool Seci.LabView.LabViewApp.loadVI ( String  filepath,
LabViewPanelInfo  panelInfo,
Boolean  includeClusters 
)
inlinestaticprivate

Main method for loading a VI. Uses the LabVIEW application command GetVIReference to load the VI The VI object is then stored in the dictionary. Finally, a list of the front panel controls is acquired.

Parameters
filepathThe full filepath for the required VI.
panelInfoThe panel information for the required VI (is null for default VIs)
includeClustersWhether to include clusters
Returns
Result

Definition at line 252 of file LabViewApp.cs.

static void Seci.LabView.LabViewApp.MinimiseVI ( String  fileName)
inlinestatic

Method to minimise the front panel

Parameters
fileNameThe full filepath of the VI

Definition at line 705 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.MoveFrontPanel ( String  fileName,
int[]  bounds 
)
inlinestatic

Method to set the position of a VI's front panel. This does not change the width or height of the panel. First old bounds are found and the width and height are calculated. Then the new bottom-right position is set as the new top-left co-ordinates plus the old width and height.

Parameters
fileNameThe full filepath of the VI
boundsThe new position of the top-left corner
Returns
Result

Definition at line 672 of file LabViewApp.cs.

static void Seci.LabView.LabViewApp.RestoreVI ( String  fileName)
inlinestatic

Method to restore the front panel (i.e. no longer minimised)

Parameters
fileNameThe full filepath of the VI

Definition at line 718 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.SetCluster ( String  fileName,
String  clusterName,
Object[]  values 
)
inlinestatic

Method for setting a cluster or array's value. A cluster is an untyped array, that may contain a range of types. it is not listed as a control in LabVIEWPanel, so the name must be known. There are no checks to see if the control exists.

Parameters
fileNameThe full filepath of the VI
clusterNameThe name of the cluster
valuesThe new values for the cluster
Returns
Result

Definition at line 979 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.SetRawValue ( String  fileName,
String  controlName,
Object  value 
)
inlinestatic

Method for setting a raw value on a front panel's control. This method sends the value straight to the VI no checks are performed. There is no checking to see if the control exists - if there is any problems it will throw an error.

Parameters
fileNameThe full filepath of the VI
controlNameThe name of the control
valueThe new value
Returns
Result

Definition at line 946 of file LabViewApp.cs.

static void Seci.LabView.LabViewApp.SetTitleBarVisibility ( String  fileName,
Boolean  visible 
)
inlinestatic

Method to set the appearance of a VI's front panel. If set to false then the VI will be shown without the titlebar, borders etc.

Parameters
fileNameThe full filepath of the VI
visibleWhether to show the title bar etc

Definition at line 754 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.SetValue ( String  fileName,
String  controlName,
Object  value 
)
inlinestatic

Standard method for setting a control's value on the front panel.

Parameters
fileNameThe full filepath of the VI
controlNameThe name of the control
valueThe new value
Returns
Result

Definition at line 913 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.ShowVI ( String  fileName)
inlinestatic

Method for displaying a VI and bringing it to the front. The front panel can be made visible through the LabVIEW application; however, the Win32 API is required to bring it to the front of the screen.

Parameters
fileNameThe full filepath of the VI
Returns
Result

Definition at line 528 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.StartLabView ( String  executionDir)
inlinestatic

Create an instance of LabVIEW, if one has not been started. Also starts the controls exporter VI. If LabVIEW fails to start then this is a serious problem.

Parameters
executionDirThe directory from which the program is being run
Returns
Result

Definition at line 66 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.StartVI ( String  fileName)
inlinestatic

Start the specified VI running.

Parameters
fileNameThe full filepath of the VI.
Returns
Result

Definition at line 420 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.StopLabView ( )
inlinestatic

Method for stopping LabVIEW. The safest way to kill LabVIEW is to kill the process as this guarantees that it has closed completely.

Returns
<Boolean result/returns>

Definition at line 98 of file LabViewApp.cs.

static Boolean Seci.LabView.LabViewApp.StopVI ( String  fileName)
inlinestatic

Stop the specified VI from running.

Parameters
fileNameThe full filepath of the VI
Returns
Result

Definition at line 446 of file LabViewApp.cs.

static void Seci.LabView.LabViewApp.UpdateFrontPanelTitle ( String  fileName)
inlinestatic

Update the stored window title for the front panel of the VI

Parameters
fileNameThe full filepath for the required VI.

Definition at line 321 of file LabViewApp.cs.

Member Data Documentation

strongnameLabview.VirtualInstrument Seci.LabView.LabViewApp._controlsExporter
staticprivate

A VI that is used to export the controls list of other VIs.

Definition at line 40 of file LabViewApp.cs.

strongnameLabview.Application Seci.LabView.LabViewApp._LV
staticprivate

The LabVIEW application.

Definition at line 25 of file LabViewApp.cs.

SerialisableList<LabViewPanelInfo> Seci.LabView.LabViewApp._panelsSettings
staticprivate

List containing the settings for the panels. This is the information that is saved in the configuration.

Definition at line 35 of file LabViewApp.cs.

strongnameLabview.VirtualInstrument Seci.LabView.LabViewApp._titleExporter
staticprivate

A VI that is used to get the title of the front panel.

Definition at line 45 of file LabViewApp.cs.

Dictionary<String, LabViewPanel> Seci.LabView.LabViewApp._VIs
staticprivate

Dictionary for storing the VIs as they are loaded - stored using their filepath as a key.

Definition at line 30 of file LabViewApp.cs.

List<String> Seci.LabView.LabViewApp._VIsNotLoaded = new List<String>()
staticprivate

Contains a list of the VIs that could not be loaded as the VI could not be found.

Definition at line 50 of file LabViewApp.cs.

Property Documentation

Boolean Seci.LabView.LabViewApp.IsNull
staticget

Definition at line 55 of file LabViewApp.cs.

List<String> Seci.LabView.LabViewApp.VIsNotLoaded
staticget

Definition at line 53 of file LabViewApp.cs.


The documentation for this class was generated from the following file: