Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

VBAI 2010 ActiveX Startup Question

Solved!
Go to solution

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.

 

 

 

Message 1 of 6
(2,394 Views)
Solution
Accepted by topic author fergy2004

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

Applications Engineer
National Instruments
Message 2 of 6
(2,385 Views)

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

0 Kudos
Message 3 of 6
(2,375 Views)

Weldone and thanks for sharing. It might sound funny, but is there a switch like: \nowelcomeonenter?

0 Kudos
Message 4 of 6
(2,368 Views)
I've been searching for a list of switches but haven't found one any where.
0 Kudos
Message 5 of 6
(2,364 Views)

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

Message 6 of 6
(2,354 Views)