08-02-2011 11:32 AM
Hi all,
I have been desperately searching for an answer on this and can't seem to come up with a solution yet. I want to write a script of some sort that can run at startup of a PC and launch 2 seperate instances of VBAI 2010 running seperate inspections. I've tried going about this 2 ways: writing an application trying to utilize ActiveX calls in vb.net and through a batch file.
Batch file:
@ECHO OFF
start C:\"Program Files"\"National Instruments"\"Vision Builder AI 2010"\"Vision Builder.exe" \inspect \nowelcomeonexit
start C:\"Program Files"\"National Instruments"\"Vision Builder AI 2010"\"Vision Builder.exe" \inspect \nowelcomeonexit
exit
This will start 2 instances into inspection mode and not prompt me with the welcome screen on exit. Is there any way I can define which inspection to run? Is there documentation somewhere on what all tags are available besides the \inspect and \nowelcomeonexit
VB.NET is going to be something like this:
Dim NIVBAITarget1 As NIVBAITargetControl
NIVBAITarget1.Connect("")
NIVBAITarget1.OpenInspection("C:\a.vbai")
NIVBAITarget1.ActiveInspection.Inspect()
NIVBAITarget1.Disconnect()
I need to iniate NIVBAITarget1 but it is not as simple as using "new" because it's declared as "Friend".
I appreciate all the help i can get as I am need of a solution very soon.
Solved! Go to Solution.
08-03-2011 11:49 AM
Hi fergy2004,
I think you have your batch file mostly correct. Here is the correct call to have an instance of Vision Builder opened on start up.
start "" "C:\Program Files\National Instruments\Vision Builder AI 2010\Vision Builder.exe" /inspect "<path to .vbai file>"
I hope this helps!
Kim
08-05-2011 09:27 AM
This did it for me! Thanks so much, I've been pulling my hair out over this!
@ECHO OFF
start C:\"Program Files"\"National Instruments"\"Vision Builder AI 2010"\"Vision Builder.exe" \inspect "C:\\Program Files\\National Instruments\\Vision Builder AI 2010\\Examples\\Tutorial 6 - State Diagram Looping.vbai" \nowelcomeonexit
start C:\"Program Files"\"National Instruments"\"Vision Builder AI 2010"\"Vision Builder.exe" \inspect "C:\\Program Files\\National Instruments\\Vision Builder AI 2010\\Examples\\Tutorial 5 - State Diagram Branching.vbai" \nowelcomeonexit
exit
08-06-2011 06:03 AM
Weldone and thanks for sharing. It might sound funny, but is there a switch like: \nowelcomeonenter?
08-06-2011 08:39 AM
08-08-2011 10:30 AM
No official document yet, but you can find all the command line flags we currently support in this discussion forum thread:
http://forums.ni.com/t5/Machine-Vision/target-connection-at-launch/m-p/1656896#M32643
If you don't want the startup screen shown when exiting, you can use this flag.
\nowelcomeonexit
If you don't want the startup screen shown when launching the software, you can use the \config or \inspect flag to go to either mode.
Hope this helps.
Brad