Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

table creation in custom user interface

Solved!
Go to solution

Hello,

 

      I'm trying to create a recipe table as a part of my custom user interface in VBAI. I attached a sample code of the with few variables. I'm wondering if there is a way do the same without VBAI throwing an exception that it cannot have dependencies. Please throw your inputs.

 

thanks.

0 Kudos
Message 1 of 7
(4,377 Views)

You can accomplish this in two different ways (that I can think of):

1 - with a Run LabVIEW step, flatten the 2D array read from file to a string and use this string in the custom UI, and unflatten and display in a table.

2 - use the custom UI and dynamically call a VI that reads the file and returns the data you need (the VI Server subVIs are primitives so they aren't counted as subVI dependencies). This is very similar to the first approach except it will be faster since you don't need the overhead of a Run LabVIEW step, don't need to flatten/unflatten data and pass this data around between steps. The difficult part is that you would need to use the Is First Call? primitive to open the VI ref, and keep it alive in a shift register of a while loop that only runs once, and then in the cleanup state of your inspection pass a flag to the custom UI code that will close the VI ref..or you could open/close the ref each time the VI is run.

 

Are the arrays going to change sizes? With Vision Builder AI SP1 (planned to release within the next month or so) we will have a new step that will allow you to read/write data from INI files and update variables, Ethernet/IP assemblies, and Modbus Tables. This might be another solution if your recipe has a fixed number of parameters where you can associate individual variables with recipe paramters and then use these variables to update the custom UI.

 

Hope this helps and let me know if you have questions.

Brad

0 Kudos
Message 2 of 7
(4,375 Views)

Brad,

 

 thank you for your input. I was wondering if you got any sample code for the second method you recommended for calling a VI ?. I agree with you that there will an overhead if I'm using in a run labview step. May be in future we may change the array size in the light of new variables or parameters. Read and write ini files into variables looks like a better option, this would be something we will be checking into upon the release of the new SP.

 

 

thanks.

0 Kudos
Message 3 of 7
(4,360 Views)
Solution
Accepted by gsajja
I attached a slightly modified Untitled 2.vi (updated the connector pane) and the Custom UI VI and a simple inspection (make sure to check out the cleanup state to see how the VI ref is closed). Hope this helps.
Message 4 of 7
(4,358 Views)

Brad,

 

      what am I doing wrong to get this error?

 

 

 Call By Reference Node in VBAI Interface.vi->IVB Custom UI Exec.vi->IVB Call Process Module Execution.vi->IVB Script Engine.vi->IVB State Machine - State Machine Engine (Configuration).vi->IVB State Machine - Run State Machine (Configuration).vi

0 Kudos
Message 5 of 7
(4,355 Views)

I hard coded the path to the Untitled VI in the block diagram of the Custom UI. Modify the path to point to where the Untitled VI is on your machine and then reimport the custom UI. Keep in mind that if you need to deploy this inspection, the VI will need to be in the same path on the deployd system (unless you add a way for the path to the untitled VI to be dynamically specified in the Custom UI VI).

 

Hope this helps,

Brad 

0 Kudos
Message 6 of 7
(4,353 Views)
Thanks Brad... its working.
0 Kudos
Message 7 of 7
(4,351 Views)