12-15-2009 03:04 PM
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.
Solved! Go to Solution.
12-15-2009 04:34 PM
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
12-16-2009 07:32 AM
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.
12-16-2009 08:11 AM
12-16-2009 09:11 AM
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
12-16-2009 09:25 AM
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
12-16-2009 09:53 AM