03-17-2009 09:12 AM
Hi
Can anyone help me in creating a function in Labview. This function also contains while loop.
int function(int a, intb)
{
while(1)
{
int c ;
c=a+b;
cout<< a+b;
}
}
I need to know the method and how to call this funcion in Labview.
03-17-2009 09:25 AM - edited 03-17-2009 09:26 AM
I think you are looking to make a sub-vi with two inputs (inta and intb)
That said, there is nothing telling that function to ever stop. Why do you even have variable C? You don't print or return it.
What are you trying to do?
03-17-2009 09:28 AM - edited 03-17-2009 09:32 AM
Looks like a homework problem to me.
And if it's not, have you gone through the LabVIEW tutorials?
To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
03-17-2009 09:49 AM
I ran across a couple good LabVIEW articles and examples that cover what you need to learn.
One is at: http://zone.ni.com/devzone/cda/tut/p/id/4161
The other can be found by going to the Code Interface Node help in LabVIEW and opening the provided example.
Those two resources should help you out.
03-17-2009 10:04 AM
03-17-2009 11:04 AM
03-17-2009 11:43 AM
Haoyue.China wrote:
I'm not professional on this. Can touch me by (hyncucn@gmail.com)
I'm sorry, but it's not clear what you're asking. Can you elaborate?
03-17-2009 01:29 PM - edited 03-17-2009 01:30 PM
I believe this is what you want:
An infinite/process hogging loop, so be careful with it
03-17-2009 11:58 PM
You are good at that? I have some intrest in that.
03-18-2009 02:44 AM
Hi
I know how to make a sub-VI but I cant make sub-VI including while loop. Infact I am making an application which involves alot of code and I am trying to make the application small by using functions or subvi. So can anyone guide me how to make a function containing loops (for loop or while).