loading
 
Tabs
Bob Simmons from United States  [17 posts]
8 year
Hi STeve - How can I change the active tab from VB.net?
Steven Gentner from United States  [1446 posts] 8 year
Bob,

You can't since it doesn't make much sense to do so from the API (assuming faceless non GUI mode). What you do is to use the Call module in the first Main tab and specify a variable (like [My_tab]) in that module. From VB.net you then set My_tab = "some existing tab name" which would then 'execute' that tab once the Call module is run (sort of like a function in traditional programming).

So while it will run it will not actually change the GUI tab selected since that's really just a visual convenience of the GUI display.

Does that work for you?

STeven.
Bob Simmons from United States  [17 posts] 8 year
Thanks for the quick reply -

It may – I have to play around to find the best solution.

I’m trying to integrate it into a PCB visual inspection machine, so each type of chip, resistor,capacitor etc. needs it’s own script.  Initially I thought I should just load robo files when I need to change my inspections – but your docs don’t recommend that…..?

Steven Gentner from United States  [1446 posts] 8 year
Bob,

We don't recommend loading robofiles per inspection item due to the time it takes to load new robofiles. RoboRealm is very optimized for speed but loading (and saving) robofiles is not optimized for rapid (i.e. 30 times a second) usage. Those functions use text/xml loading and saving which involves a lot of parsing and memory allocation/freeing in order to run. While these function very quickly from a human perspective (a second or so) one shouldn't expect that to work at 30+ times a second like most of the other modules do.

Instead, using either a Call module with a [variable] as a parameter so that you can control which 'tab' gets executed when or using a single tab and successive IF_STATEMENT modules to only run sections of code is the recommended route. Changing a variable to change the execution of a function/tab can happen at 30+ times a second.

Does that help?

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index