02-19-2007 11:06 AM - edited 02-19-2007 11:06 AM
Steffen Hoog recommended the following:
1.) VBAI 2.6 has an ActiveX interface. You could install a development enviroment like LabVIEW, CVI, VB, etc on your host PC and call the VBAI-Sequence running at the target via ActiveX to transfer step results or images to the host for example.
2.) ActiveX could be also an interface to change tolerances during runtime.
3.) you can use the serial IO step to set tolerances dynamicly. After that typecast the string into a numeric value, and compare this value with a constant (min, max) in a decision making step. Do not set the limits in the analyse step. Because you use the decision making step therefore.
http://forums.ni.com/ni/board/message?board.id=200&message.id=7265&query.id=191238#M7265
Message Edited by scott_7723 on 02-19-2007 11:12 AM
Message Edited by scott_7723 on 02-19-2007 11:13 AM
02-20-2007 12:39 PM
scott_7723,
Steffen’s suggestion is probably the best route to follow in achieving that functionality. Here are some helpful resources on ActiveX:
ActiveX
and LabVIEW
Technology Brief -
ActiveX/COM
ActiveX for Beginners
Regards,
Luke H
02-21-2007 10:01 AM
02-22-2007 05:40 PM
02-23-2007 08:32 AM
02-23-2007 08:52 AM - edited 02-23-2007 08:52 AM
Message Edited by scott_7723 on 02-23-2007 08:53 AM
02-23-2007 09:54 AM
Scott,
I am going to write an example for you. Stephen's answer was a little misleading. It is not yet possible to use ActiveX methods/properties to dynamically set the tolerances. That is a good suggestion. We'll look into that. What Stephen said is that you can communicate between your application and Vision Builder AI (using for example serial, TCP or Modbus) to send the tolerances that you can then use in Vision Builder to make the Pass/Fail decisions. The best way to do it right now, is to use the Modbus protocol. Vision Builder AI can be configured to be a Modbus server. Vision Builder contains a set of registers that you can use to communicate with external devices / applications. Your application uses the Modbus protocol to write to these registers. In your case, you'll write the tolerances. To make the pass/fail decisions in the inspection, you're going to have to use for example the decision making step, to compare the result of a step to the Modbus registers where you stored the tolerances for that step. You actually don't need ActiveX to do that, but instead a set of Modbus VIs that you can download from our website. You can use the same principle to transfer data (for example results) from Vision Builder to your application. You use the Modbus step in Vision Builder AI to store results in some Modbus registers, and your application just queries these results, although it is probably better to use ActiveX to retrieve results, because you don't have to add any additional steps to your inspection to store the results in the Modbus registers.
To write you the example, please reply with the version of Vision Builder AI and the version of LabVIEW you are using. Once I have that, please give me a couple hours to write the example and update the post.
Thanks,
Christophe
NI Vision R&D
02-23-2007 10:57 AM
02-23-2007 11:09 AM
02-23-2007 02:19 PM
Scott,
Here is an example on how to dynamically set the limits of your inspection from LabVIEW 7.1. I am attaching the Vision Builder AI 2.6.1 inspection and the LabVIEW 7.1 example. Here's how to get it to work:
1) Unzip the inspection and import it in Vision Builder AI. (File>>Open, then select Tools>>Import Inspection).
The inspection is the Tutorial 1 that I slightly modified to read the limits from the modbus holding registers 0 and 1, use a decision making step to make sure the number of matches is in the range between register 0 and 1 that I've just read. And I added a final step to write to a couple other registers the number of matches found and the inspection status. If you've never used Modbus, Modbus is just a Master/Slave communication protocol that sits on top of the Ethernet or Serial physical layers. In this case, we're using Modbus TCP. The slave or server (Vision Builder) contains a set of registers (4 tables): holding registers (16 bit registers that the master can also write to), input registers (16 bit registers that are read only by the master), coils (binary registers writable by the master), and discrete inputs (binary register that are read only by the master). Vision Builder has access to all of them. The master (your LabVIEW application) can write to the holding registers of the coils and can only read the input registers and discrete inputs.
2) In configuration mode, you need to declare a Modbus device (this is going to be the LabVIEW program communicating with Vision Builder). To do that, select Tools>>Communication Device Manager. Click on New Device. Give it a name (for example LabVIEW Application). The device type is master (LabVIEW is going to initiate the communication with VBAI). Select Modbus TCP as the protocol. Click OK. Then Click Start Server to launch the background task that is going to listen to the Modbus frames.
3) Run the inspection.
4) Open LabVIEW 7.1 and the VI NI Modbus.llb\MB Set VBAI Tolerances.vi.
The VI opens a connection with VBAI, then sends Modbus queries to either set the limits when you modify value of the controls on the front panel, and continuously read the # of matches and inspection status. This works on both Windows and the CVS. Make sure you declare the Modbus device when you're connected to the CVS, and specify the CVS' IP address in the VI.
I hope this will help you with your application.
Also, I'd like to know what went wrong with the import of the 2.6 inspection in 3.0. If you don't mind, please send me the inspection so we can try to reproduce and fix the problem.
Hope this helps,
Best regards,
Christophe
NI Vision R&D