codemorphis.com Forum Index codemorphis.com
Software development: pure and simple.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Nesting

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    codemorphis.com Forum Index -> General Forum
View previous topic :: View next topic  
Author Message
CodeMorphis



Joined: 02 Dec 2003
Posts: 252

PostPosted: Thu May 19, 2005 4:39 pm    Post subject: Reply with quote

You can use the Nesting component in either way: either creating your visual code and then selecting it for nesting, or creating a Nesting component first and then adding visual code to it.

Here is how to first create the Nesting component and then add logic to it.

First open the Component Tray and select the Program tab. Then drag and drop the Nesting component onto the workspace area:



Now we can double click on the Nesting component to descend a nesting level and add logic to it.



Here we have added a “Console Print” component which can be found in the “I/O” tab of the Component Tray.

You can now connect components inside the Nesting component to its internal interface. The internal interface are those ports that appear inside the black rectangle that delimits the boundary of the Nesting component.

The error message that you noted: "Cannot connect a nested component to the external port interface of its nesting component” occurs when you try to connect nested components to the external ports. The external ports are used to connect components outside the Nesting component. See the article http://www.codemorphis.com/forums/viewtopic.php?t=14 for an explanation of the internal and external interfaces of Nesting components.

Double click on an area inside the black border of the Nesting component that is not occupied by a nested component. This takes us out of the Nesting component and ascends one Nesting level. We can also click on the “Dec” button in the Synopsis toolbar to decrement the nesting level. When we do this, we once again see the Nesting component that we have created:



Note that we do not see the nested component(s) at this level (i.e. Nesting level 0). This is because the nested components are contained by the Nesting component. We can connect the Start component’s output process port to the Nesting component to complete a very simple program that outputs the Nesting component’s argument to the console output area.

To specify an argument for output, double click on the Nesting component’s blue input data port (the blue port at the top of the Nesting component). This brings up the Input Argument Editor and allows us to specify something to be output. In our program, we have added some text like “hello!”. When we run the program, the text is output to the console output area.

You can download this program here:
http://www.codemorphis.com/articles/ans_051905/nesting_prog.vpd


Hope that this helps. Please feel free to ask more questions if you require help.


For further reading on the Nesting component, see http://www.codemorphis.com/forums/viewtopic.php?t=25
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    codemorphis.com Forum Index -> General Forum All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group