Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the same camera

Solved!
Go to solution

Hey guys

 

I have migrated my VBAI to labview and it works once i run it. I use a Basler Camera etc, however once i run the application again labview uses the laptop camera how can i set it to constantly select the basler camera. In VBAI it will always select the basler unless i double click the "acquire image" vi please advise.

 

Damien

0 Kudos
Message 1 of 42
(5,090 Views)

I don't see any reason this would happen. What if you step into the IVB IMAQdx - Resource Manager (for RT).vi in your LV code to see what happens during the Enumerate and Allocate mode. This should help explain why it is happening and then we can figure out what to do about it. I would imagine if you close LabVIEW and restart your example, it would also fix the problem, but I'd be interested in hearing what happens the second time when the wrong camera is selected.

 

Hope this helps,

Brad

0 Kudos
Message 2 of 42
(5,076 Views)

Hey Brad,

 

Thanks for the reply, when i select the IVB IMAQdx vi from my folder it provides 11 options

 

IVB IMAQdx-checkout Timeout.vi

IVB IMAQdx-get extra info.vi

IVB IMAQdx-parameters.ctl

IVB IMAQdx-runtime strings.vi

IVB IMAQdx-setup mode.ctl

IVB IMAQdx-setup subset(for RT)

IVB IMAQdx-Update Num Buffers global

IVB IMAQdx-Cleanup (for RT)vi

IVB IMAQdx Code.vi

IVB IMAQdx-Exec (for RT)vi

IVB IMAQdx-Setup (for RT)vi

 

In my code I cannot locate the enumerate or allocate mode. I have provided the main vi, if u require sub vis i can forward them on also. Because I say my files in a temporary folder when i restart it attempts to load the vi's i tend to ignore all and simply migrate over from VBAI as i am trying to develope the inspection block correctly before i attach it to my over all application.

 

Thanks Damien

 

 

0 Kudos
Message 3 of 42
(5,061 Views)

Put a breakpoint in the Setup on the first frame and highlight execute through this VI. You should see if go into a Resource Manager to Enumerate and then again to Allocate. Pay close attention to what happens in this Resource Manager in the Setup VI. Especially with the values in the shift registers.

 

Hope this helps,

Brad

0 Kudos
Message 4 of 42
(5,053 Views)

Hey brad,

 

I have put a breakpoint in the initialization sequence and have done as you asked, however i am confused as to which vi has the resource manager there is coordinate system manager, results manager, transition manager roi manager and state machine data manager in the sequence structure. Is the resource manager in the setup clean.vi? i have an option setup/clean vi i have attached that vi.  Thanks again

 

0 Kudos
Message 5 of 42
(5,047 Views)

Sorry about that. I should have been more specific. I meant put a breakpoint in the IVB IMAQdx Setup (for RT).vi. If you walk through this VI there will be a green subVI called IVB IMAQdx - Resource Manager (for RT).vi that has an Enumerate and Allocate frame. This is where the problem is that I can't reproduce and hopefully by walking through this part of the code it will become clear what is going wrong...thanks for you patience and persistence.

 

I also wanted to mention that you can control the VBAI engine with a new LV API that uses the inspection as is, but allows you to launch a local VBAI engine (silently if you want), load inspections, run them, and get results and images from the VBAI Engine into your LV app. The advantage here is that you don't have to migrate your inspection to LV so you can still easily modify it in the VBAI environment and then the LV code can use the updates in the inspection without any changes...just something to think about. Here's a tutorial on using it:

 

https://www.ni.com/en/shop/electronic-test-instrumentation/application-software-for-electronic-test-...

 

Hope this helps,

Brad

Message 6 of 42
(5,045 Views)

Hey Brad,

 

Thanks for the numerous replies, what i want to achieve with the VBAI is as follows:

 

1. Check number of LEDs on from my DUT so i used a detect objects vi in VBAI

2. Recognise the character on my DUT LCD display so i used read/text vi in VBAI

3. Match a certain pattern depending on the image i aquire. If image =A i look for one pattern, if acquired image = B i look for a different pattern.

 

So what i have done is i have migrated this to labview because once it is in labview I want to use the results from the 3 steps, Step 1 should detect 2 LEDs on but if it detects 1 i fail it.

 

Step 2 the character on the LCD which is a number i.e 10 for that test step should be within a range 9.5 to 10.5 i pass/fail if in range.etc same for step 3.

 

Is this all achievable through VBAI? Can i use the information and perfrom logic in VBAI i tried previously and couldnt hence i migrated to labview.

 

Any suggestions helpful

 

I have found the vi you have mentioned IVB IMAQdx-Resource Manager (for RT).  An input into the frame that contains this vi is called Camera ID out. Also an output from this vi called session out goes to an equal function?The numeric constant is set to Get IMAQ session can use the allocate resource numeric either. I have attempted to run it and i get an error saying camera has been removed. Perhas my breakpoint is in the wrong vi will i put it in the IVB IMAQdc code.vi?

 

Thanks somuch for your advice.

0 Kudos
Message 7 of 42
(5,041 Views)

You can definitely do logic in VBAI. There are several options for this:

- Calculator step (has a LabVIEW block diagram like experience (with numeric/string/boolean operators) where you can add previous results as controls and have the step produce results as indicators).

- Logic Calculator (uses pull downs to select previous results and you can AND/OR logic comparisons to get a result)

- Run LabVIEW VI Step (allows you to call a LabVIEW VI from within VBAI.

 

All of these steps are on the last tab in the VBAI palette. If you don't need to migrate to LV, I would strongly recommend staying VBAI. Do the vision steps do what you want and you're just missing the logic to make decisions? If so, the above steps should solve your problem. If the vision steps (i.e. Detect Object/OCR) don't do what you want, could you post a picture with a description of what you are trying to do in the image with a particular VBAI vision step.

 

Thanks,

Brad

Message 8 of 42
(5,039 Views)

Thanks Brad,

 

It would be better to do it all in VBAI but as i stated my experience is limited and i had problems with the decision making. Also it is a loop so for certain test steps i would need to find different patterns etc.

 

I have attached an image of what my camera will pick up at a test step.

 

This step i apply 230V to my DUT/Image at 230V i must see 5 LEDs on and pass/fail, on the display is 231 i must decide if it is within a range of 228-232 if it is pass/fail. Also the pattern in the top right corner should appear if not fail.

 

A new test step i apply 120V....image should show 4 LEDs, the display in range between 118-122 and a different pattern. Any help would be great in achieving this in VBAI.

0 Kudos
Message 9 of 42
(5,036 Views)

What version of VBAI are you using? If you're using VBAI 2012, we can use arrays, which will make this easier. Are you wanting to apply different voltages and make sure the meter has expected lights turned on and OCR text value displayed within range? How many different voltage levels do you apply? Once I have this info (important to include VBAI version you're using), I can make a simple inspection to illustrate how you would do something like this.

 

Thanks,

Brad

Message 10 of 42
(5,033 Views)