ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

取消
显示结果 
搜索替代 
您的意思是: 

programmatically place structures in a VI

I am interested in building an application that can create a tool that builds a multi-loop case structure (one within another). I would like to keep the number of such loops as a parameter that the user can specify. I would like to know if it is possible to programmatically create a VI and place structures in that VI.

Thanks in advance.
0 项奖励
1 条消息(共 5 条)
2,639 次查看
> I am interested in building an application that can create a tool that
> builds a multi-loop case structure (one within another). I would like
> to keep the number of such loops as a parameter that the user can
> specify. I would like to know if it is possible to programmatically
> create a VI and place structures in that VI.
>

Generating LV code is not a completed feature. We have shown demos of
this at NIWeek in the past, so many people know it is in work, but
neither the feature, nor the documentation is ready for general use.

You should be able to do this without generating code. Putting loops
inside one another is very similar to running a single loop but with the
product of the other terms.

If you add more details about what you are tryi
ng to do, we can give
better suggestions.

Greg McKaskle
2 条消息(共 5 条)
2,639 次查看
Thanks for your response. I would like to create an application using which one can create a simulation tool that simulates the logical flow of a process comprising various boolean case structures one within the other wherein I want the number of such case structres to be a variable that the creater of the tool can choose. For example, one user might want to have 4 such case structures one within the other and have some specific messages to be displayed in the boolean cases for all the 4 structures. He should be able to replace the dummy message that comes with the application I build with his own custom message. Another user can have 5 such structures and different messages.
0 项奖励
3 条消息(共 5 条)
2,639 次查看
> Thanks for your response. I would like to create an application using
> which one can create a simulation tool that simulates the logical flow
> of a process comprising various boolean case structures one within the
> other wherein I want the number of such case structres to be a
> variable that the creater of the tool can choose. For example, one
> user might want to have 4 such case structures one within the other
> and have some specific messages to be displayed in the boolean cases
> for all the 4 structures. He should be able to replace the dummy
> message that comes with the application I build with his own custom
> message. Another user can have 5 such structures and different
> messages.

If you actually wanted to let the user see
the highlighting of the wires
to catch the interactions, then you really do want to generate diagrams.

If what you want is the correct answer for a given set of Boolean
inputs, then this is no problem. You were already going to have some
way for the user to input the system they were describing. A table or
series of tables could work, or if it is a simpler case, you could have
a series of dialogs that fills in the table for them.

Once you have the table, you can intrepret it. Look for 0 or 1 in the
first cell. Then move to a higher column if TRUE and to a higher row if
FALSE. If the logical progression is over, the cell will contain text
instead of 0 or 1. Anyway, the details are up to you. You can
definitely build a datastructure that encodes the truth table and
interpret it with a fixed and simple diagram.

Another approach to take? Let the user build the diagram using the case
statements themself. You can build a simple palette set with nothing
but what you wa
nt there. If RoboLab gives it to kids to build software
for their LEGOs, you might be able to give it to your users.

Greg McKaskle
0 项奖励
4 条消息(共 5 条)
2,639 次查看
Many thanks for the very quick response. My need is really the former ie., see the highlighting-of-wires-to catch-the-interactions thing. I think your second approach would be a better choice for me! Thanks again.

- Sheela
0 项奖励
5 条消息(共 5 条)
2,639 次查看