Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

VBAI 2015 .Net accessing user define variables

I am developing a vision application using VBAI 2015 in .Net.

In my VBAI vision profile I created some user define variables and set them based on some vision results.

I cannot seem to find a method using the NationaInstruments.VBAI.2008.dll that will give me the values of these variables.

 

Is there a way to get these values? I see a getvariable and setvariable method but none of these actually return me the value of MyUserDefineVariable.

0 Kudos
Message 1 of 3
(2,718 Views)

You could send a string value via TCP into VBAI and then use it to select what value to set your variables in your inspection. You would first need to create a TCP I/O step. In the step configuration, add a "Wait for String" command. Edit the Wait for String command to either read a set number of bytes or wait for a termination character. After configuring the TCP I/O step, you have two options:

a. Create a Set Variable step. In the step configuration, choose Operation: Set to Measurement and then choose the string from the TCP I/O step in the drop-down menu.
b. Create state transitions based off of the string received in the TCP I/O step.

 

 

Josh

Applications Engineer

National Instruments

0 Kudos
Message 2 of 3
(2,664 Views)

You need to enable measurement results and then read the measurements. The variable values will be included in the array of measurement results along with all the step results. I believe you can also pass an array of step GUIDs to the GetInspectionMeasurements function to only get the results you want and there is a helper function that will return the step guid for variables if you pass in the variable name for the step name and “Variable” for the state name.

 

Hope this helps

Brad

0 Kudos
Message 3 of 3
(2,662 Views)