Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Update tolerances in VBAI in real time via ActiveX?

I ran the example you gave me and it definitely helped me see how to set up the Modbus Slave step, and I feel it will help me in my application, although I'll have to spend some more time looking at all that is goin on.  I hope if I have any questions on this I can still contact you on it. 
 
As far as the VBAI 2.6 to 3.0, I had spoken with someone over there on your end and they didn't seem to understand what I was asking, nor what I was trying to do.  I would greatly love to resolve this issue so that I can have VBAI 3.0 running on all 5 of our CVS1456's here.  But for now I need to ensure it works flawlessly on one before the others.  If it is ok, I would like to gather up my memory on what I did a few months ago on this and actually recreate it myself as well.  I will try to get back to you by mid next week.  Is this an issue?  To give you a basic synapsis of what I did:
I installed VBAI 3.0 on a laptop (host) computer that previously had 2.6.1 on it (but was uninstalled prior to installing VBAI 3).  We had been running 2.6.1 for quite a while.  I have 4 machines that have many existing programs on them.  When I updated one of the CVS',  I saved the products that were on the CVS in addition to the file containg the camera data.  When I imported it to 3.0 the product selection no longer seemed to work properly.  The fact that 3.0 looks considerably different with the state diagrams, cleanup, select product, etc. wasn't helping me to debug the issues, however, I do like the way it is layed out after understanding what is on the screen.  So yeah, basically I was using the product select lines linked to an external controller that the operators would use to select the part they want to run through the vision system.  Problem was it didn't work anymore.  I wasn't sure what steps needed to be adjusted, and, unfortunately it took me a while to find where this option was moved to in 3.0.  THe other thing that occured was the cameras were lagging.  The inspectino involved 4 cameras to be taken at the same time as one another.  After the first run, an image from the previous run would be evaluated in the next.  This making sense?  If you had run an inspection that used cameras a,b,c and d, of which respectively took the images 1,2,3 and 4....the next run would be evaluating 5,6,7, and 1.  Or something like that.  for some reason all four were not updated.  I don't know.  Let me try and reinstall vbai3 and do it again so I can send you the problems.  I can tell you the majority of all my inspections only use 2 cameras at a time.  I will also tell you that when I simulated these things it differed from when the actual cameras were used to.  WHatever, sorry.  I'll go ahead and recreate what occured and get back to you by mid next week I hope.  Thanks again for your time/
0 Kudos
Message 11 of 44
(1,924 Views)
Unfortunately It's not going to happen for a little while.  Hopefully you will be around still when I can get to it.  Thanks again for your help.
0 Kudos
Message 12 of 44
(1,907 Views)

Not sure if you're still out there, but I wanted to thank you for your help on this.  I am finally able to take some time to look into this (a year later) and I have made it work for me.  It takes an aweful long time to do though (using the modbus Slave step in VBAI that is).  It is unfortunate that you guys do not include it as a feature in VBAI.  That is: to just click on the features you wish to monitor and change on the fly without having the user write their own code.  Keyence includes it with there software for a couple hundred bucks...all you do is click on the measurements you wish to monitor and update the tolerances as needed while Vision systems are running.  Again, not your fault, so thanks for the method.  Now I need to work on doing it quicker and making it more efficient.  If I could only build a program to automatically do what Keyence does.

Also, is it the same process with 3.0.1?  Or is there a better way?  I should look at it first and see for myself, but thought I'd ask while I was here. 

Also, I have installed 3.0.1 on one of the CVS, of course, now there is 3.5 available.  The issues I had last time I replied have been taken care of, however, I wonder if there is anyway to get the inspection selection to occur prior to inspecting rather than after?  I tried doing a simple read of ISO 0-4 and transitioning to different states based on that value, however, it overwhelms the processor when I put three of my exiting inspections into one to achieve the desired result.  In other word, each inspection would now be a single state within a state diagram that would ideally handle all 10-20 inspections.  Probably not being clear, but thought I'd check with you if you're still out there.  Thanks again

0 Kudos
Message 13 of 44
(1,755 Views)

> Not sure if you're still out there, but I wanted to thank you for your help on this. I am finally able to take some time to look into this (a year later) and I have made it work for me. It takes an aweful long time to do though (using the modbus Slave step in VBAI that is).

Reading and writing Modbus registers from VBAI is fast (it is basically writing to memory) and the step returns right away because the communication with the Modbus client (your application that sets the limits) is asynchronous. When using the Modbus slave, you would have to configure a Modbus server in VBAI, which is basically a task running in the background, that waits for Modbus messages from your client. Typically, Modbus is not used for fast communication, and we set the period of the Modbus Server in VBAI to 200ms. This means that the server will handle 5 Modbus queries per second. I am not sure how many queries your client is doing, but that might be the reason why it takes a while to set all the limits you have to set. You can set a key in the Vision Builder.ini file to specify a different period for the Modbus Server. If you're working with a CVS, you need to update the ini file in the C:\VBAI folder on the CVS as well.

In the [Modbus] section, specify a different value for the "LoopRate" key. Relaunch VBAI for the changes to take effect.

If the server is running on a PC, you can reduce the period to 30ms or so.

In your case, since you're using a CVS, we do not recommend you lower it more than 110ms or so. If you go lower, your host might not be able to connect to the CVS anymore or you're going to slow down your inspection significantly because VBAI will spend more time in the Modbus background task.

In VBAI 3.5, there is another way of doing that instead of using Modbus. We introduced a new feature that allows you to create your own inspection interface.

You define it with a LabVIEW VI, by placing controls and indicators (including image display controls) on the front panel of your VI. The controls can be used by all the steps that can use previous measurements, while the indicators on your UI are set by a specific VBAI step. When you switch to inspection mode, you have your custom UI instead of the VBAI predefined one. You can also use the web server feature and use a browser to control the custom UI, instead of VBAI.

Using this model, you would place numeric controls on the UI for the limits, and you would still need to use either the calculator step or Logic Calculator step to verify that results are within tolerances.

Feel free to download the eval version of VBAI 3.5 from our website and try out that feature. We have examples that illustrate that feature as well as some app notes on our web site.

We get numerous feedback about being able to modify the step limits at runtime, and will look into what we can do to make it more easy to do in the future.

> I wonder if there is anyway to get the inspection selection to occur prior to inspecting rather than after?

No. What you can do is specify an empty inspection for the startup one, instead of an inspection that inspects your first product.

Hope that helps.

Feel free to let us know if you have other questions.

Best regards,

Christophe

0 Kudos
Message 14 of 44
(1,742 Views)
Thanks for getting back to me on that.  Yeah, the deal was I added multiple Modbus queries on to your example to about 16 in all and ran it only to see it take a few runs before everything updating.  Now, I just added as many stacked sequences as needed to the LV7.1 code you provided a while back (see above), so instead of 5 cases, it now has 16 stacked sequences within the read/write structure.  Perhaps I should re-write it to do parallel sequences?  I need to hone in my LV skills that are still very very limited.  Also, if I have just one Modbus Slave step in VBAI 2.6.1 that reads and writes all the desired info to the Registers rather than scattering them out throughout the program, this may help? 
 
Well, that aside, if I updated to VBAI 3.5, are you telling me I could make a front panel for every inspection that could have these tolerance adjustments on it without the need for any additional toolkits?  So when I run an inspection the Front Panel pops up on my host pc?  Is this all stored within the CVS' memory so any PC can just link to it and control this?  Or even a touchscreen to each unit?  But I have to have LV 8.5 don't I?  I have 8.2...no good?  Thanks so much
0 Kudos
Message 15 of 44
(1,737 Views)
I would recommend to make only one call to MB Ethernet Master Query with the function code Write Multiple Registers, so you update all the registers you need to update on the VBAI side with only one query.
Similarly, if you need to reag multiple VBAI registers and if they are consecutive make only one call to read them all.
 
> Well, that aside, if I updated to VBAI 3.5, are you telling me I could make a front panel for every inspection that could have these tolerance adjustments on it without the need for any additional toolkits?
 
Correct. VBAI on the host computer would display your custom user interface instead of the build-in one when you connect to the CVS. If you switch inspection, the UI will also switch to the one you specified for the second inspection. As I mentioned above, you can even control the inspection running on the CVS from another computer if you enable the web server on the CVS (you can do that from VBAI) and get control of the Custom inspection interfaces with just a web browser.
That's a pretty powerful feature.
The Interface VIs are store with the inspection on the CVS.
 
 
> so any PC can just link to it and control this?
 
Correct.
 
 
> Or even a touchscreen to each unit?
 
If the touchscreen unit runs Windows and has a web browser, you will be able to take control of the VI with it as well. When you first try to connect to the VI using the web browser, you will be asked to install the LabVIEW and Vision run-time engines.
 
> But I have to have LV 8.5 don't I?  I have 8.2...no good?
 
Unfortunately with VBAI 3.5, you need LabVIEW 8.5 to create new custom inspection interfaces, or run a VI with the Run LabVIEW step.
VBAI ships with a several predefined ones that you can use without LabVIEW, but it's mainly to show how the feature work and what you can do with it.
 
-Christophe
0 Kudos
Message 16 of 44
(1,734 Views)
Hi again.  I hate to ask this, but I have chosen to try and run the route of multiple Run VI steps to accomplish this.  Just to see if it would be more versatile for me.  My problem, however, is that when I utilize something like the run vi step I attached (in LV 7.1) which is an extension of the run vi for the chocolates inspection that comes with VBAI, but tweaked for my own use, I can not find a way to keep the most current limits as default for the next time it is run.  Is there any way I can do this besides right clicking on the numeric control in LV and selecting the make this default which is completely impractical if just running VBAI?  Of course, when I right click on these controls when they are called up in VBAI, I can not set current values to default, rather only reinitialize to default values from before it was ran and adjusted.  How can I store the most recent value in my upper and lower limits so that this step has it the next time the inspection is run?  Do I have to incorporate the modbus slave into it to do so, which makes it even more time intensive with programming--and as a result I would go back to the previous method you thankfully showed me how to do to the finest detail?  I am not having success with reading and writing from a file likely cause i can't place the right stuff in the right directory.  I need this to work on remote targets (CVS 1456's).  I don't know, I tried reading forums on creating a configuration iti first, but it prompts for the file path, which stops the inspections until values entered, which I do not want.  There has to be something simple I am not figuring out.  Any help would be so appreciated.  Again, I attached a VI (in LV 7.1) that I just need to manipulate to save the current Upper and Lower limit values for the next time around...they only resort back to my original values, but when using this in VBAI, I may not have LV on the host to update these.  Hope this makes sense.  And thanks again for atleast looking at it.
 
The entire problem is that I am hoping it can be done while just running it as a vi in VBAI 2.6.1 or 3.0.1, not openig it in LV.


Message Edited by scott_7723 on 03-18-2008 01:05 PM
0 Kudos
Message 17 of 44
(1,699 Views)
Hi,
 
Using an ini file is the only way I see of doing that, since the VI will be removed from memory when you switch inspections.
I am suggesting reading initialization values from an ini file in the Setup State, and writing the last values used in the cleanup state.
To do that, add a function code to your VI, where for example 0 (default) corresponds to the normal use of the VI, 1 initialize values, 2 write values.
See modified attached VI. I hope that helps and that I understood your question well.
 
Best regards,
 
Christophe
 
0 Kudos
Message 18 of 44
(1,692 Views)
My god how do you do that so fast?  So to make it work I would I simply put a run vi step in Setup State with the function value set to a constant 1, then set it as a constant 0 in the run vi inspection step, then the same in clean up state but with 2 as the function value?   Additionally, I would just need to create a folder on the CVS itself to have that same path, correct?  That sounds very simple, but how can I do this with 2.6 where there aren't the states?  Do i have to have each run vi step placed three times within the inspection to accomplish this?  Or am I best off getting all my CVS' set to 3.0.1 to do this?  Also, the idea was to use that particular one as a template for every window I want to adjust, so I'll have to actually save individual vi's for each and every step I wish to have this used for , won't I?  See, I planned on having the ability to adjust atleast 4-6 (preferrably even more) different inspection steps for atleast 15 inspections per CVS.  I'm concerned that this will consume an aweful lot of memory on the CVS' limitted 256MB drive.  Would you think this is a bad way for me to go, or quite feasible?   I suppose I wil just try and see how much memory it takes to have all the limit.ini files I'll want and run vi steps.  Thanks again so much, you have been amazingly generous with your time and help.

Message Edited by scott_7723 on 03-18-2008 02:29 PM
0 Kudos
Message 19 of 44
(1,690 Views)
It appears I have to have it run three times in 2.6.1, once for each function value.  You are a genious!  Thanks so very much! 
0 Kudos
Message 20 of 44
(1,684 Views)