SECI  1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
LabViewApp.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections.Generic;
3 using System.Collections;
4 using System.Text;
5 using System.IO;
6 using System.Diagnostics;
7 using System.Runtime.InteropServices;
8 using Seci.Definitions;
9 
10 //This is the main LabVIEW class and all code should go through here
11 
12 namespace Seci.LabView
13 {
20  static class LabViewApp
21  {
25  private static strongnameLabview.Application _LV;
26 
30  private static Dictionary<String, LabViewPanel> _VIs;
31 
35  private static SerialisableList<LabViewPanelInfo> _panelsSettings;
36 
40  private static strongnameLabview.VirtualInstrument _controlsExporter;
41 
45  private static strongnameLabview.VirtualInstrument _titleExporter;
46 
50  private static List<String> _VIsNotLoaded = new List<String>();
51 
52  //Properties
53  public static List<String> VIsNotLoaded { get { return _VIsNotLoaded; } }
54 
55  public static Boolean IsNull { get { return _LV == null; } }
56 
57  #region Start/Stop LabVIEW
58 
66  public static Boolean StartLabView(String executionDir)
67  {
68  _VIs = new Dictionary<string, LabViewPanel>();
69  _panelsSettings = new SerialisableList<LabViewPanelInfo>();
70 
71  //Change the LabVIEW settings
72  configureLabVIEW();
73 
74  //Start LabVIEW
75  try
76  {
77  _LV = new strongnameLabview.Application();
78 
79  //Load the ControlsExporter and titleExporter
80  _controlsExporter = _LV.GetVIReference(executionDir + "\\Required VIs\\Controls_Exporter.vi", "", false, 0);
81  _titleExporter = _LV.GetVIReference(executionDir + "\\Required VIs\\GetPanelName.vi", "", false, 0);
82 
83  }
84  catch (Exception e)
85  {
86  //throw error up to next level
87  throw new LabViewException("startLabView - " + e.Message);
88  }
89 
90  return true;
91  }
92 
98  public static Boolean StopLabView()
99  {
100  //Check LabVIEW is running and if so kill the process
101  try
102  {
103  if (_LV != null)
104  {
105  //Stop LabVIEW by killing the process, this avoids save sub-vi etc.
106  System.Diagnostics.Process[] procList;
107 
108  procList = System.Diagnostics.Process.GetProcessesByName("LabView");
109 
110  if (procList.GetLength(0) > 0)
111  {
112  procList[0].Kill();
113  }
114 
115  //Give it a second to close down
116  System.Threading.Thread.Sleep(1000);
117  _VIs.Clear();
118  }
119 
120  }
121  catch (Exception err)
122  {
123  Helpers.ErrorLogger.SeciError("stopLabView", err);
124  return false;
125  }
126 
127  return true;
128  }
129 
137  private static void configureLabVIEW()
138  {
139  String text = "";
140  String line = "";
141  Boolean hidden = false;
142 
143  FileInfo fi = new FileInfo(Status.LabViewIniFilePath);
144 
145  if (fi.Exists)
146  {
147  //Open the existing file and read in
148  fi.IsReadOnly = false;
149 
150  StreamReader SR = new StreamReader(fi.FullName);
151 
152  try
153  {
154  while ((line = SR.ReadLine()) != null)
155  {
156  if (line.StartsWith("hideRootWindow", StringComparison.Ordinal) && !hidden)
157  {
158  text += "hideRootWindow=True" + Environment.NewLine;
159  hidden = true;
160  }
161  else if (!line.StartsWith("toolPaletteLoc", StringComparison.Ordinal) && !line.StartsWith("menu.", StringComparison.Ordinal))
162  {
163  text += line + Environment.NewLine;
164  }
165  }
166 
167  if (hidden == false)
168  {
169  text += "hideRootWindow=True" + Environment.NewLine;
170  }
171  }
172  catch (Exception err)
173  {
174  text = "";
175  Seci.Helpers.ErrorLogger.SeciError("ConfigureLabVIEW", err);
176  }
177  finally
178  {
179  SR.Close();
180  }
181 
182  //Write out the new file
183  if (!String.IsNullOrEmpty(text))
184  {
185  StreamWriter SW = new StreamWriter(fi.FullName);
186 
187  try
188  {
189  SW.Write(text);
190  }
191  catch (Exception err)
192  {
193  Seci.Helpers.ErrorLogger.SeciError("ConfigureLabVIEW", err);
194  }
195  finally
196  {
197  SW.Close();
198  }
199  }
200  }
201  }
202 
203  public static Boolean AreYouThere()
204  {
205  try
206  {
207  String version = _LV.Version;
208  return true;
209  }
210  catch
211  {
212  return false;
213  }
214  }
215 
216  #endregion
217 
218  #region Load\Close and Start\Stop VI
219 
226  public static Boolean LoadVI(String fileName, Boolean includeClusters)
227  {
228  return loadVI(fileName, null, includeClusters);
229  }
230 
237  public static Boolean LoadVI(LabViewPanelInfo panelInfo, Boolean includeClusters)
238  {
239  return loadVI(panelInfo.FilePath, panelInfo, includeClusters);
240  }
241 
252  private static bool loadVI(String filepath, LabViewPanelInfo panelInfo, Boolean includeClusters)
253  {
254  //Try to load the VI
255  try
256  {
257  //Check VI has not already been loaded (this may happen if we are merging configs)
258  if (!_VIs.ContainsKey(filepath.ToLower()))
259  {
260  strongnameLabview.VirtualInstrument myVI;
261  myVI = _LV.GetVIReference(filepath, "", false, 0);
262 
263  LabViewPanel newPanel = new LabViewPanel(myVI);
264  if (panelInfo != null)
265  {
266  _panelsSettings.Add(panelInfo);
267  }
268 
269  _VIs.Add(filepath.ToLower(), newPanel);
270 
271  GetControls(filepath, includeClusters);
272 
273  getFrontPanelTitle(filepath);
274  }
275  else
276  {
277  return false;
278  }
279 
280  }
281  catch (Exception e)
282  {
283  //throw error up to next level
284  throw new LabViewException("loadVI - " + e.Message);
285  }
286 
287  return true;
288  }
289 
294  private static void getFrontPanelTitle(String fileName)
295  {
296  try
297  {
298  _VIs[fileName.ToLower()].GetFrontPanelTitle(_titleExporter, fileName);
299  }
300  catch (Exception e)
301  {
302  //throw error up to next level
303  throw new LabViewException("getFrontPanelTitle - " + e.Message);
304  }
305  }
306 
312  public static String GetFrontPanelTitle(String fileName)
313  {
314  return _VIs[fileName.ToLower()].FrontPanelTitle;
315  }
316 
321  public static void UpdateFrontPanelTitle(String fileName)
322  {
323  getFrontPanelTitle(fileName);
324  }
325 
336  public static Boolean CloseVI(String fileName)
337  {
338  //Try to close the VI
339  try
340  {
341  strongnameLabview.VirtualInstrument myVI;
342  myVI = _VIs[fileName.ToLower()].VI;
343 
344  //Check it is not running first, if running then stop it
345  if (myVI.ExecState != strongnameLabview.ExecStateEnum.eIdle)
346  {
347  myVI.Abort();
348  }
349 
350  //Panel must be visible before it can be closed
351  myVI.FPWinOpen = true;
352 
353  myVI.CloseFrontPanel(); //This only closes the Frontpanel the vi is still in memory!
354 
355  _VIs.Remove(fileName.ToLower()); //Remove from dictionary
356 
357  //Now remove the panel settings
358  foreach (LabViewPanelInfo panel in _panelsSettings)
359  {
360  if (panel.FilePath.ToLower() == fileName.ToLower())
361  {
362  _panelsSettings.Remove(panel);
363  break;
364  }
365  }
366 
367  }
368  catch (Exception e)
369  {
370  //throw error up to next level
371  throw new LabViewException("killVI - " + e.Message);
372  }
373 
374  return true;
375  }
376 
382  public static Boolean IsVIPresent(String fileName)
383  {
384  return _VIs.ContainsKey(fileName.ToLower());
385  }
386 
392  public static Boolean IsVIRunning(String fileName)
393  {
394  //See if the VI is running
395  try
396  {
397  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
398 
399  if (VI.ExecState == strongnameLabview.ExecStateEnum.eRunning || VI.ExecState == strongnameLabview.ExecStateEnum.eRunTopLevel)
400  {
401  return true;
402  }
403  else
404  {
405  return false;
406  }
407  }
408  catch (Exception e)
409  {
410  //throw error up to next level
411  throw new LabViewException("isVIRunning - " + e.Message);
412  }
413  }
414 
420  public static Boolean StartVI(String fileName)
421  {
422  //If the VI is not running then try and start it
423  try
424  {
425  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
426 
427  if (VI.ExecState == strongnameLabview.ExecStateEnum.eIdle)
428  {
429  VI.Run(true);
430  }
431  }
432  catch (Exception e)
433  {
434  //throw error up to next level
435  throw new LabViewException("startVI - " + e.Message);
436  }
437 
438  return true;
439  }
440 
446  public static Boolean StopVI(String fileName)
447  {
448  //If the VI is running stop it
449  try
450  {
451  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
452 
453  if (VI.ExecState == strongnameLabview.ExecStateEnum.eIdle || VI.ExecState == strongnameLabview.ExecStateEnum.eRunTopLevel)
454  {
455  VI.Abort();
456  }
457 
458  }
459  catch (Exception e)
460  {
461  //throw error up to next level
462  throw new LabViewException("stopVI - " + e.Message);
463  }
464 
465  return true;
466  }
467 
468  #endregion
469 
470  #region Get LLB info
471 
479  public static List<String> GetLLBInfo(String fileName)
480  {
481  //A LLB file contains a library of VIs. We need to get a list of the VIs in it.
482  //The only way i have found to do this (and i don't like it) is to use a NI VI
483  //to extract the data.
484 
485  //See if vi used to search llb files exists
486  FileInfo fi = new FileInfo(Status.ExecutionDir + "\\Required VIs\\getlibraryinfo.vi");
487 
488  if (!fi.Exists)
489  {
490  throw new FileNotFoundException("Could not find getlibraryinfo.vi!");
491  }
492 
493  try
494  {
495  //First load the LLB to find what it contains via the getlibraryinfo.vi
496  strongnameLabview.VirtualInstrument readerVI = _LV.GetVIReference(Status.ExecutionDir + "\\Required VIs\\getlibraryinfo.vi", "", false, 0);
497  readerVI.SetControlValue("Library Name", fileName);
498 
499  //Run the VI
500  readerVI.Run(false);
501 
502  //Collect the VIs in llb
503  String temp = readerVI.GetControlValue("VI Names").ToString();
504 
505  List<String> viDetails = new List<string>();
506  viDetails.AddRange(temp.Split('\n'));
507 
508  return viDetails;
509  }
510  catch (Exception e)
511  {
512  //throw error up to next level
513  throw new LabViewException("getLLBInfo - " + e.Message);
514  }
515  }
516 
517  #endregion
518 
519  #region Displaying VIs
520 
528  public static Boolean ShowVI(String fileName)
529  {
530  //Display the VI
531  try
532  {
533  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
534  VI.FPWinIsFrontMost = true;
535  VI.FPWinOpen = true;
536 
537  try
538  {
539  //Use win32 api to bring VI to front
540  String name = VI.FPWinTitle;
541  int handle = Helpers.NativeMethods.FindWindow(null, name);
542 
543  if (handle == 0)
544  {
545  //If VI is not running then the window name may be different
546  handle = Helpers.NativeMethods.FindWindow(null, name + " Front Panel");
547 
548  if (handle == 0)
549  {
550  //If VI has changed and not been saved the name may have a * on it
551  handle = Helpers.NativeMethods.FindWindow(null, name + " Front Panel *");
552  }
553  }
554 
555  if (handle != 0)
556  {
557  Helpers.NativeMethods.SetForegroundWindow(handle);
558  }
559  }
560  catch (Exception err)
561  {
562  //Don't worry if this does not work - it just means the VI is not
563  //brought to the front.
564  Helpers.ErrorLogger.SeciError("DisplayVI", err);
565  }
566  }
567  catch (Exception e)
568  {
569  //throw error up to next level
570  throw new LabViewException("displayVI - " + e.Message);
571  }
572 
573  return true;
574  }
575 
582  public static Boolean HideVI(String fileName)
583  {
584  //Hide the VI
585  try
586  {
587  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
588  if (VI.FPWinOpen)
589  {
590  VI.FPWinOpen = false;
591  }
592  }
593  catch (Exception err)
594  {
595  //Not a fatal error, just log it
596  Helpers.ErrorLogger.LabViewError("hideVI", err.Message);
597  }
598 
599  return true;
600  }
601 
607  public static Boolean HideAllVIs()
608  {
609  //Hide the VIs
610  try
611  {
612  Dictionary<string, LabViewPanel>.KeyCollection keys = _VIs.Keys;
613 
614  foreach (String fileName in keys)
615  {
616  HideVI(fileName);
617  }
618  }
619  catch (Exception e)
620  {
621  //throw error up to next level
622  throw new LabViewException("hideAllVIs - " + e.Message);
623  }
624 
625  return true;
626  }
627 
635  public static int[] GetBounds(String fileName)
636  {
637  //Return the bounds of the front panel as int[]
638  try
639  {
640  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
641  object[] obj = (Object[])VI.FPWinBounds;
642 
643  //Would like to convert obj to ints and tidy, but haven't done so yet!
644  int[] bounds = new int[obj.GetLength(0)];
645 
646  for (int i = 0; i < obj.GetLength(0); ++i)
647  {
648  bounds[i] = Convert.ToInt32(obj[i]);
649  }
650 
651  return bounds;
652  }
653  catch (Exception err)
654  {
655  //Log error and return null array - this means the VI will appear at
656  //its default position next time
657  Helpers.ErrorLogger.SeciError("getBounds", err);
658  return null;
659  }
660  }
661 
672  public static Boolean MoveFrontPanel(String fileName, int[] bounds)
673  {
674  //Set the bounds of the front panel
675  try
676  {
677  if (bounds != null)
678  {
679  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
680 
681  Object[] oldBounds = (Object[])VI.FPWinBounds;
682 
683  oldBounds[2] = Convert.ToInt16(oldBounds[2]) - Convert.ToInt16(oldBounds[0]) + bounds[0];
684  oldBounds[3] = Convert.ToInt16(oldBounds[3]) - Convert.ToInt16(oldBounds[1]) + bounds[1];
685  oldBounds[0] = bounds[0];
686  oldBounds[1] = bounds[1];
687 
688  VI.FPWinBounds = oldBounds;
689  }
690 
691  }
692  catch (Exception e)
693  {
694  //throw error up to next level
695  throw new LabViewException("setBounds - " + e.Message);
696  }
697 
698  return true;
699  }
700 
705  public static void MinimiseVI(String fileName)
706  {
707  if (fileName != null)
708  {
709  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
710  VI.FPState = strongnameLabview.FPStateEnum.eFPMinimized;
711  }
712  }
713 
718  public static void RestoreVI(String fileName)
719  {
720  if (fileName != null)
721  {
722  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
723  VI.FPWinOpen = true;
724  VI.FPState = strongnameLabview.FPStateEnum.eFPStandard;
725  }
726  }
727 
733  public static Boolean IsVIHidden(String fileName)
734  {
735  if (fileName != null)
736  {
737  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
738 
739  if (VI.FPState == strongnameLabview.FPStateEnum.eFPClosed || VI.FPState == strongnameLabview.FPStateEnum.eFPHidden)
740  {
741  return true;
742  }
743  }
744 
745  return false;
746  }
747 
754  public static void SetTitleBarVisibility(String fileName, Boolean visible)
755  {
756  if (fileName != null)
757  {
758  strongnameLabview.VirtualInstrument VI = _VIs[fileName.ToLower()].VI;
759  VI.FPTitleBarVisible = visible;
760  }
761  }
762 
763  #endregion
764 
765  #region Get Front panel controls
766 
774  public static Boolean GetControls(String fileName, Boolean includeClusters)
775  {
776  //Populate the control dictionary for this VI
777  try
778  {
779  _VIs[fileName.ToLower()].getVIControls(_controlsExporter, fileName, includeClusters);
780  }
781  catch (Exception e)
782  {
783  //throw error up to next level
784  throw new LabViewException("getControls - " + e.Message);
785  }
786 
787  return true;
788 
789  }
790 
796  public static List<String> GetListOfControls(String fileName)
797  {
798  try
799  {
800  //Get the name of the controls
801  return _VIs[fileName.ToLower()].getListOfControls();
802  }
803  catch (Exception e)
804  {
805  //throw error up to next level
806  throw new LabViewException("getListOfControls - " + e.Message);
807  }
808  }
809 
810  public static String GetControlTime(String fileName, String control)
811  {
812  return _VIs[fileName.ToLower()].GetControlType(control);
813  }
814 
815  #endregion
816 
817  #region Get control value
818 
827  public static String[] GetValue(String fileName, String controlName)
828  {
829  //Get value from a control, return as a string as we don't know what the control may be
830  try
831  {
832  //Need to strip off (type) from end of name ie. num1 (Numeric)
833  if (controlName.LastIndexOf(" (", StringComparison.Ordinal) != -1)
834  {
835  controlName = controlName.Substring(0, controlName.LastIndexOf(" ("));
836  }
837 
838  return _VIs[fileName.ToLower()].getControlValue(controlName);
839 
840  }
841  catch (Exception e)
842  {
843  //throw error up to next level
844  throw new LabViewException("getValue - " + e.Message);
845  }
846  }
847 
858  public static Object GetRawValue(String fileName, String controlName)
859  {
860  //Get the value from LV, don't check that the control exists or tidy the result up
861  try
862  {
863  //Need to strip off (type) from end of name ie. num1 (Numeric)
864  if (controlName.LastIndexOf(" (", StringComparison.Ordinal) != -1)
865  {
866  controlName = controlName.Substring(0, controlName.LastIndexOf(" (", StringComparison.Ordinal));
867  }
868 
869  return _VIs[fileName.ToLower()].getRawControlValue(controlName);
870 
871  }
872  catch (Exception e)
873  {
874  //throw error up to next level
875  throw new LabViewException("getRawValue - " + e.Message);
876  }
877  }
878 
888  public static Object[] GetCluster(String fileName, String clusterName)
889  {
890  //Get a cluster or an array as one big clump
891  try
892  {
893  return _VIs[fileName.ToLower()].getWholeCluster(clusterName);
894  }
895  catch (Exception e)
896  {
897  //throw error up to next level
898  throw new LabViewException("getCluster - " + e.Message);
899  }
900  }
901 
902  #endregion
903 
904  #region Set control value
905 
913  public static Boolean SetValue(String fileName, String controlName, Object value)
914  {
915  //Set value of control on panel
916  try
917  {
918  //Need to strip off (type) from end of name ie. num1 (Numeric)
919  if (controlName.LastIndexOf(" (") != -1)
920  {
921  controlName = controlName.Substring(0, controlName.LastIndexOf(" ("));
922  }
923 
924  _VIs[fileName.ToLower()].setControlValue(controlName, value);
925 
926  return true;
927 
928  }
929  catch (Exception e)
930  {
931  //throw error up to next level
932  throw new LabViewException("SetValue - " + e.Message);
933  }
934  }
935 
946  public static Boolean SetRawValue(String fileName, String controlName, Object value)
947  {
948  //Set value of control on panel
949  try
950  {
951  //Need to strip off (type) from end of name ie. num1 (Numeric)
952  if (controlName.LastIndexOf(" (", StringComparison.Ordinal) != -1)
953  {
954  controlName = controlName.Substring(0, controlName.LastIndexOf(" (", StringComparison.Ordinal));
955  }
956 
957  _VIs[fileName.ToLower()].setRawControlValue(controlName, value);
958 
959  return true;
960 
961  }
962  catch (Exception e)
963  {
964  //throw error up to next level
965  throw new LabViewException("SetRawValue - " + e.Message);
966  }
967  }
968 
979  public static Boolean SetCluster(String fileName, String clusterName, Object[] values)
980  {
981  //Set a cluster or an array as one big clump
982  try
983  {
984  _VIs[fileName.ToLower()].setWholeCluster(clusterName, values);
985 
986  return true;
987  }
988  catch (Exception e)
989  {
990  //throw error up to next level
991  throw new LabViewException("setCluster - " + e.Message);
992  }
993  }
994 
995  #endregion
996 
1001  internal static SerialisableList<LabViewPanelInfo> GetAllPanelsInfo()
1002  {
1003  SerialisableList<LabViewPanelInfo> list = _panelsSettings.Clone() as SerialisableList<LabViewPanelInfo>;
1004  return list;
1005  }
1006 
1012  internal static void SetPanelsInfo(SerialisableList<LabViewPanelInfo> panels)
1013  {
1014  _panelsSettings = panels;
1015  }
1016 
1022  internal static BlockInfo GetCorrectBlockDetails(BlockInfo block)
1023  {
1024  //Find key manually as the case of panel may be wrong
1025  List<String> keys = new List<string>();
1026  keys.AddRange(_VIs.Keys);
1027 
1028  foreach (String key in keys)
1029  {
1030  if (key.ToLower() == block.ParentVI.ToLower())
1031  {
1032  //block.ParentVI = _VIs[key];
1033  block.ReadControl = _VIs[key].FindControlNameAndType(block.ReadControl);
1034 
1035  if (block.WriteControl != null)
1036  {
1037  block.WriteControl = _VIs[key].FindControlNameAndType(block.WriteControl);
1038  }
1039 
1040  if (block.GoButton != null)
1041  {
1042  block.GoButton = _VIs[key].FindControlNameAndType(block.GoButton);
1043  }
1044  break;
1045  }
1046  }
1047 
1048  return block;
1049  }
1050 
1051 
1057  internal static List<String> GetListOfAllVIs(Boolean includeDefault)
1058  {
1059  List<String> paths = new List<string>();
1060 
1061  if (includeDefault)
1062  {
1063  paths.AddRange(_VIs.Keys);
1064  }
1065  else
1066  {
1067  foreach (LabViewPanelInfo panel in _panelsSettings)
1068  {
1069  paths.Add(panel.FilePath.ToLower());
1070  }
1071  }
1072 
1073  return paths;
1074  }
1075 
1080  internal static void SetVisibilityToDefault(String fileName)
1081  {
1082  if (_VIs.ContainsKey(fileName.ToLower()))
1083  {
1084  foreach (LabViewPanelInfo panel in _panelsSettings)
1085  {
1086  if (panel.FilePath == fileName)
1087  {
1088  if (panel.ShowPanel)
1089  {
1090  ShowVI(fileName);
1091  }
1092  else
1093  {
1094  HideVI(fileName);
1095  }
1096 
1097  return;
1098  }
1099  }
1100  }
1101  }
1102  }
1103 }
static Boolean StopVI(String fileName)
Stop the specified VI from running.
Definition: LabViewApp.cs:446
static SerialisableList< LabViewPanelInfo > _panelsSettings
List containing the settings for the panels. This is the information that is saved in the configurati...
Definition: LabViewApp.cs:35
This class contains the DCOM connection to the LabVIEW application and stores a reference to all the ...
Definition: LabViewApp.cs:20
static String LabViewIniFilePath
Definition: Status.cs:84
static Boolean SetValue(String fileName, String controlName, Object value)
Standard method for setting a control&#39;s value on the front panel.
Definition: LabViewApp.cs:913
This class is used for storing the information for any blocks that are created and provides methods f...
Definition: BlockInfo.cs:18
static int[] GetBounds(String fileName)
Method to get the bounds of a VI&#39;s front panel. It is messy bcause the application returns the values...
Definition: LabViewApp.cs:635
A simple custom exception used for LabVIEW exceptions
static strongnameLabview.VirtualInstrument _controlsExporter
A VI that is used to export the controls list of other VIs.
Definition: LabViewApp.cs:40
static Boolean HideAllVIs()
Method to hide all the VIs&#39; front panels. Done via the LabVIEW application not Win32 API...
Definition: LabViewApp.cs:607
static Boolean SetCluster(String fileName, String clusterName, Object[] values)
Method for setting a cluster or array&#39;s value. A cluster is an untyped array, that may contain a rang...
Definition: LabViewApp.cs:979
static Boolean LoadVI(String fileName, Boolean includeClusters)
Method for loading a VI.
Definition: LabViewApp.cs:226
Class for holding the standard run-time settings for SECI. A large percentage of the information held...
Definition: Status.cs:12
static Boolean MoveFrontPanel(String fileName, int[] bounds)
Method to set the position of a VI&#39;s front panel. This does not change the width or height of the pan...
Definition: LabViewApp.cs:672
static Boolean ShowVI(String fileName)
Method for displaying a VI and bringing it to the front. The front panel can be made visible through ...
Definition: LabViewApp.cs:528
static Boolean GetControls(String fileName, Boolean includeClusters)
Method for getting a list of the controls on a VI&#39;s front panel. The list of controls are stored in t...
Definition: LabViewApp.cs:774
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 firs...
Definition: LabViewApp.cs:336
static Boolean AreYouThere()
Definition: LabViewApp.cs:203
static Boolean SetRawValue(String fileName, String controlName, Object value)
Method for setting a raw value on a front panel&#39;s control. This method sends the value straight to th...
Definition: LabViewApp.cs:946
static void MinimiseVI(String fileName)
Method to minimise the front panel
Definition: LabViewApp.cs:705
static Boolean HideVI(String fileName)
Method to hide a VI&#39;s front panel. Done via the LabVIEW application not Win32 API.
Definition: LabViewApp.cs:582
static String ExecutionDir
Definition: Status.cs:87
static Dictionary< String, LabViewPanel > _VIs
Dictionary for storing the VIs as they are loaded - stored using their filepath as a key...
Definition: LabViewApp.cs:30
static Boolean StopLabView()
Method for stopping LabVIEW. The safest way to kill LabVIEW is to kill the process as this guarantees...
Definition: LabViewApp.cs:98
static void RestoreVI(String fileName)
Method to restore the front panel (i.e. no longer minimised)
Definition: LabViewApp.cs:718
static void UpdateFrontPanelTitle(String fileName)
Update the stored window title for the front panel of the VI
Definition: LabViewApp.cs:321
static String[] GetValue(String fileName, String controlName)
Standard Method for retrieving a value of a front panel&#39;s control. The control has to exist in the co...
Definition: LabViewApp.cs:827
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...
Definition: LabViewApp.cs:888
static String GetControlTime(String fileName, String control)
Definition: LabViewApp.cs:810
This class contains the reference to the LabVIEW VI and keeps a list of all the front panel controls...
Definition: LabViewPanel.cs:13
static Object GetRawValue(String fileName, String controlName)
Method for retrieving a raw value of a front panel&#39;s control. This method returns the control value e...
Definition: LabViewApp.cs:858
static Boolean IsVIHidden(String fileName)
Method to check whether a VI is hidden or not
Definition: LabViewApp.cs:733
static Boolean StartLabView(String executionDir)
Create an instance of LabVIEW, if one has not been started. Also starts the controls exporter VI...
Definition: LabViewApp.cs:66
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 Instrum...
Definition: LabViewApp.cs:479
static void getFrontPanelTitle(String fileName)
Update the stored window title for a specific front panel
Definition: LabViewApp.cs:294
This class contains all the information about a LabVIEW VI that needs to be saved in the configuratio...
static void configureLabVIEW()
Method for editing the LabVIEW.ini file. This is set to do the following:
Definition: LabViewApp.cs:137
static strongnameLabview.VirtualInstrument _titleExporter
A VI that is used to get the title of the front panel.
Definition: LabViewApp.cs:45
static Boolean IsVIPresent(String fileName)
Method for checking whether a VI is present in the dictionary.
Definition: LabViewApp.cs:382
static Boolean StartVI(String fileName)
Start the specified VI running.
Definition: LabViewApp.cs:420
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 ...
Definition: LabViewApp.cs:252
static Boolean LoadVI(LabViewPanelInfo panelInfo, Boolean includeClusters)
Method for loading a VI.
Definition: LabViewApp.cs:237
static strongnameLabview.Application _LV
The LabVIEW application.
Definition: LabViewApp.cs:25
static List< String > GetListOfControls(String fileName)
Method for retrieving a list of a front panel&#39;s controls.
Definition: LabViewApp.cs:796
static void SetTitleBarVisibility(String fileName, Boolean visible)
Method to set the appearance of a VI&#39;s front panel. If set to false then the VI will be shown without...
Definition: LabViewApp.cs:754
static String GetFrontPanelTitle(String fileName)
Gets the current window title of the VI&#39;s front panel
Definition: LabViewApp.cs:312
static Boolean IsVIRunning(String fileName)
Method for checking whether a VI is a running state.
Definition: LabViewApp.cs:392