f



Is it possible, when i call a vi from within my code, to pass to it parameters as input and to return some values too?

Hi There!
 
I am currently calling a vi from within my code. However, what i would like to do, is to pass it 2 int values when i call it and for it to return 2 int values when it is done!
 
Any advice on how i can do this please.
 
Thanks.
Regards,
0
x9561 (148440)
12/6/2006 3:10:11 PM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

2 Replies
337 Views

Similar Articles

[PageSpeed] 21

If you have two controls and two indicators on the subVI, just wire them to the subVI's connector pane.
&nbsp;<a href="http://zone.ni.com/devzone/cda/tut/p/id/5199" target="_blank">LabVIEW fundamentals</a>
0
x9561 (148440)
12/6/2006 3:40:08 PM
Hi there!
&nbsp;
Thanks for your reply. I have had it the way you mentioned.
&nbsp;
This is the scenario, i have a main vi, lets call it Main.vi and from here i call another vi, lets call it X.vi. The X.vi can take parameters and return values. 
The problem is that when i use the Open vi reference and use its property node's methods to open and run the vi, i do not know how to pass parameters to the X.vi and how to get return values back from it when it closes.
&nbsp;
Please advise.
&nbsp;
Thanks again.
Regards,
&nbsp;
0
x9561 (148440)
12/7/2006 10:10:06 AM
Reply:

Similar Artilces:

Is it possible to call an executable of compiled c code from within LabVIEW?
I can compile 'genesis' (the name of the code we are planning to use) under unix: it produces an executable which can belinked to user-constructed c files which contain specific crossover and/ormutation strategies, so once a user has the executable, it is notneccesary to re-compile the main GA everytime a user mucks around with thecombination rules. I think that a question is, can you call the (or any)executable from within LabView? Thanks &nbsp; Alan Homer ...

How to call VBScripte funtion (with input parameter & returned value) in C++?
Detailed question: http://groups.google.com/group/microsoft.public.scripting.vbscript/browse_thread/thread/57fcf39e9a6696f1?hl=zh-CN Thanks tingjun.li@gmail.com wrote: > Detailed question: > http://groups.google.com/group/microsoft.public.scripting.vbscript/browse_thread/thread/57fcf39e9a6696f1?hl=zh-CN Your question is off-topic here since it is Microsoft-specific. Try one of their C++ groups (cf. the list at http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9). Cheers! --M ...

How can I calling LabView DLL within LabView and pass similar Data Types?
--5972977.1071582281832.JavaMail.quiq.tekken Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am trying to use an Instrument Driver, which is created in LabView6.1 as a DLL. At this point I have only LabView to test this DLL. I was wondering, is there easy way to find out what sort of Parameter or Data Type I should be using. How can I pass the following data with in LabView: LVRefnum as Type? LVBoolean as Type? TD1 (a structure) as Type? It is funny to see that I am able to create a DLL in labview but having trouble calling it within LabView. I th...

Pass input Array value to function to calc different input value
Please forgive, I have looked at so much info I can't figure out how to put it together even though I know it must be fairly simple. I have an array of input text boxes (txtDOBn) where n is created at load. On the onchange event I want to calc the age and show in adjacent input text boxes that are readonly and also arrays (an age calced for each DOB entered). I was going to use the datediff function in vbscript to do the calc. Can someone please help me pull the pieces together or point me to a similiar example? I didn't post HTML because of message about spam. *** Sent via Developersdex http://www.developersdex.com *** Easily doable, but you need to be much more specific on what you have and what you need. Calculations are simple depending on what your source might be, but the calculation are simple, just be concise and explainful. Danny On Mon, 04 Jul 2005 15:50:11 -0700, Susan Cranford <netsusan@comcast.net> wrote: -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ Susan Cranford wrote: > Please forgive, I have looked at so much info I can't figure out how to > put it together even though I know it must be fairly simple. > > I have an array of input text boxes (txtDOBn) where n is created at > load. On the onchange event I want to calc the age and show in adjacent > input text boxes that are readonly and also arrays (an age calced for > each DOB entered). I was going to...

Pass parameter to LabView-VI in batch mode
Hello, I am executing LabView-VIs in batch mode, that means my batch-file calls the VI and the VI immediately executes, since its VI-properties are set in this way. However, my requirement is that I pass a parameter value to the VIs (a string). How can I do this in batch mode? Regards, Gerald Hello, thanks for your help. The parameter passing works, I took the VI CommandLine and modified it. However, you have to close LabView each time you want to pass new parameters to the VI. I would like to run this VI in a sequence and each time pass new parameters. Thereby it is time-consuming to restart LabView each time. Is there a way around this? Regards, Gerald Hi, I am using LabView Full Development System, therefore I have no Application Builder. I cannot build an exe without Application Builder? I would prefer not to buy the Application Builder. Isn't there a way for passing parameters in a reasonable way without using executables? Regards, Gerald ...

How do I pass in a parameters to a LabVIEW EXE from C Codes
I am trying to pass(say a string) to one of the controls in my LabVIEW EXE and afterwards execute the VI and return a value from the indicator. The calling program is a C program. Sounds like you need to build your LV code into a DLL rather than an EXE file. ...

Simple parameter passing within a setInternal() call?
How can a simple string parameter be passed between two functions while inside a setInterval call? For example: function initialFunction(x){ alert(x); setInterval('repeatingStuff(x)',5000); } function repeatingStuff(x){ alert(x); } .... <a href="..." onclick="initialFunction('param_x');">stuff</a> But the error "x is not defined" results from ..Stuff(x) in setInterval('repeatingStuff(x)',5000). How can the parameter between the two functions be passed within the setInteval bit? Many thanks, Tuxedo Tuxedo wrote: [...] > setInterval('repeatingStuff(x)',5000). How can the parameter between the I thought I had tried this already but I must have simply got the quoting wrong. Of course, this works: setInterval('repeatingStuff("' + x + '")',5000); Tuxedo Tuxedo schrieb: > How can a simple string parameter be passed between two functions while > inside a setInterval call? For example: > > function initialFunction(x){ > alert(x); > setInterval('repeatingStuff(x)',5000); > } > > function repeatingStuff(x){ > alert(x); > } > ... > > <a href="..." onclick="initialFunction('param_x');">stuff</a> > > But the error "x is not defined" results from ..Stuff(x) in > setInterval('repeatingStuff(x)',5000). How can the parameter between the > two functions be pas...

Read input file and pass the value as parameter recursively
Hi All , I have an input file and i want to read the lines and pass the value of each line as parameter to a sql statement , but each time that i run my shell script the number of lines into input file change , sometime it could be one line , three lines or none. Also i need to create output file with the results of the sql statements using the values of input file. I was thinking in something like : sqlplus -s USER/PASSWD <<-EOF > output 2>&1 while read inputfile ; do select x from tab where y=$value from input file done quit; EOF Is it correct? I appreciate any help!! Thank you! > I have an input file and i want to read the lines and pass the value of > > each line as parameter to a sql statement , but each time that i run my > > shell script the number of lines into input file change , sometime it > could be one line , three lines or none. Also i need to create output > file with the results of the sql statements using the values of input > file. $ cat file 1 2 3 $ while read value; do printf "%s\n" "set pages 0" "select $value from dual;"; done < file | sqlplus -s / as sysdba 1 2 3 Regards Dimitre Thanks for help! I got an error because my input file have a header into the file like: Column_Name --------------------- 12345 The value above came from a command select Column_Name from tab1 So when i use the suggestion i got the error like: $ wh...

passing a parameter to a labview call library function node
Hi, I have a some labview code that I use to call a reference .dll.&nbsp; The .dll is written in winapi C++ and uses a library to open and perform tasks in a third party program.&nbsp; The third party software performs an analysis on some data and has several options that can be controlled with the library they provided, some of which require user input from labview. The C++ code I wrote had all the options hard coded in... I could change the options in the code, recompile, and everything worked fine. The next step was to pass one of the parameters through labview into my code.&...

matlab calling labview via activex, passing parameters
I've been using Matlab and LabVIEW for well over a decade.&nbsp; Never tried to get them to talk to each other before.&nbsp; As far as I can tell, it ought to be simple.From the LV end, just turn on the VI server.Seems simple enough from the Matlab end:e=actxserver('LabVIEW.Application');vipath='c:\Documents and Settings\mwolfson\Desktop\testx.vi';vi=invoke(e,'GetVIReference',vipath);I can run the VI with:vi.Run or vi.Call or vi.Call2The trouble is I have no idea how to pass parameters to the VI and how to read back the output. I've munged together that I can set the input arguments what seems like the hard way:vi.SetControlValue('input variable1',4);But if I try to use the NI suggested method "Call" or "Call2", Matlab chokes on any input parameter I specify.&nbsp; Matlab lists the "syntax" as:object.Call2([paramNames], [paramVals], [openFP], [closeFPAfterCall], [suspendOnCall]), but when I try to use this, it chokes.&gt;&gt; vi.Call2('input variable1',5)??? Invoke Error, Dispatch Exception: The parameter is incorrect.Any ideas?&nbsp; And why is such a thing so painfully non-obvious (or described somewhere)?TIA,&nbsp; -- MW ...

%include with return code to calling program --> is this possible?
I am new to SAS. I am using version 6.12 I would like to have one "batch-like" file called MyMain.SAS that has as pseduo-code: My Main.SAS rc = %include 'code1.sas'; /* rc = return code; 0 = success */ if rc=0 then %include 'code2.sas; else put "program aborted due to error in file code1.sas"; ------------------------------ Code1.SAS (a number of SAS statements, including PROC SQL) then a return statement ------------------------------- Is this possible to do? Thanks. ...

Passing by reference better than returning a value when calling a function?
Hello: When I need a function to generate a string, I have two methods: 1. pass by reference: mystring = ""; myfunction( mystring ); // prototype of myfunction( &anystring ); OR 2. mystring = myfunction(); //which return a string According to experience of C/C++, the former one is better as of the efficient, how about PHP? Thanks. On Sun, 28 Oct 2007 19:25:38 +0100, duzhidian@gmail.com = <duzhidian@gmail.com> wrote: > Hello: > > When I need a function to generate a string, I have two methods: > > 1. > pass by reference: > > mystring =3D ""; > myfunction( mystring ); // prototype of myfunction( &anystring ); > > OR 2. > mystring =3D myfunction(); //which return a string > > According to experience of C/C++, the former one is better as of the > efficient, how about PHP? The PHP engine is usually smarter then you think, so efficiency wise the= re = will be very little difference (you can test this offcourse examining ti= me = & memory usage). From a logical standpoint though, it makes very little = = sense to create a _new_ string in an existing variable by reference. I'd= = say functions taking arguments by reference only make sense when they = either alter data directly related to their 'previous' value, or store t= he = values in come other scope. -- = Rik Wasmus ..oO(duzhidian@gmail.com) >When I need a function to generate a string, I have two m...

Called ByRef parameter not returning values from DLL32 Functions
Hi All, The following code working Ok in VB. Public Declare Function GetDeviceTime Lib "DeviceLib" (ByVal nHandleIndex As Long, ByRef nTotalCount As Long, ByRef pnDateTime As Date) As Long To call the same function in xHarbour, I wrote the code as under: Code: Select all Expand view DLL32 Function GetDeviceTime(nHandleIndex AS LONG, nTotalCount AS LONG, pnDateTime AS STRING) AS LONG PASCAL LIB hLib and When I called as under: #include "fivewin.ch" FUNCTION main() LOCAL nTotalCount := 0 LOCAL pnDateTime := SPACE(19) // 9999-99-99 99:99:99 GetDeviceTime(nHandleIndex, @nTotalCount @pnDateTime) ?nTotalCount, pnDateTime RETURN nil I am not getting the Referenced date type variable populated with correct value and getting some junk characters. Not only Date type, even (LONG) type of referenced parameters are not returning correct values but returning only the Initial values originally assigned to them at the the time of their declaration. Can anybody help me please. Thanks, - Ramesh Babu P "RAMESH" <aksharasoft@gmail.com> ha scritto nel messaggio news:127eeaae-c4ce-4259-acf5-c6fdefe7bb00@b25g2000prb.googlegroups.com... I already answered you in Fivetechsoft forum: you have to replace this > DLL32 Function GetDeviceTime(nHandleIndex AS LONG, nTotalCount AS > LONG, pnDateTime AS STRING) AS LONG PASCAL LIB hLib with this DLL32 Function GetDeviceTime(nHandleIndex AS LONG, @nTotalCount AS PTR, pnDateTime AS STRING...

Two questions:Is possible to call the application builder from an vi in labview?
Hi!<br>We want to build the application automatically. <br>I don=B4t know i= f it is possible acting on the menu of labview, using labview code. We want= to build an vi that selects Tools>>Build Application or shared libraries(D= LL), and not to do it manually.<br>I know that it sounds strange, but anyon= e knows if it is possible? and how can I do it? ...

Calling a LabView DLL from a Labview VI
Hi, I have a vi that is calling a Labview DLL and they both have a same subVI. If I drop that SubVI into the block diagram first then drop in the Call Library Function Node, when I run the VI, the DLL would not work and it did not give me any error. Does anyone know how fix this problem with Labview? or is there some configuration that I can force the all of that SubVI points into the DLL. Thanks for your help, Dan ...

Is there a possibility to call a stored procedure on the MSSQL DB without java to wait for a return value?
Hello Im working with jdbc on a MSSQL Database. In my java client im executing a stored procedure called myProc on the database. Im doing this with the following code: ...... Statement stmt = con.createStatement(); String sql1 ="execute myProc"; stmt.execute(sql1); My problem is, that this stored procedure takes at least one hour to finish. So i cant close the java client during this time, otherwise the stored procedure will be canceled. I can call it in a seperate thread, but that doesnt help. Nevertheless the client cant be closed. Is there a possibility to call a stored procedure on the MSSQL DB without java to wait for a return value? Thanks in advance G. Agu Did you consider maybe running a SQL Server job? You could fire your procedure from the job, and I guess SQL Server jobs can be run asynchronously with a SQL statement. If you arrange your application that way, your Java client can just start the job and quit. Regards, Bartosz Klimek Couldn't find a solid answer right away, but here goes : perhaps MSSQL has a connection property 'blocking' that you can set ? If it doesn't a solution could be to start a different process altogether, through Runtime's exec. Let you know if I think of something else.. Paul Hamaker http://javalessons.com Thanks Bartosz for the immediate answer! The hint to use a sql server job helped a lot. Here is how I solved the problem: thats the java code: Statement stmt =3D con.createStatement()...

waiting for input of widget and return input value
Hi, maybe that's a very easy question but i'm really confused by it and cannot find an answer. I wrote below tcl/tk script and hope to implement function like this: run proc1, then proc1 will invoke proc2 and popup some checkbutton for variables, then customer check some checkbutton, then click "Confirm" to invoke proc3, proc3 will check which button was checked and return a checked variable list, then proc2 return the list to proc1, and proc1 print it out. proc proc1 {} { set dev_list [proc2] puts $dev_list } proc proc2 {} { set w .add_new_env catch {destroy $w_dev} toplevel $w set array1(1,1) "variable1" set array1(2,1) "variable2" set array1(3,1) "variable3" for {set i 1} {$i<3} {incr i +1} { checkbutton $w.$i -text $array1($i,1) -variable array1($i,2) -anchor w } frame $w.command button $w.command.confirm -text Confirm -command "catch {destroy $w}; return [proc3 [array get array1]] " button $w.command.cancel -text Cancel -command " catch {destroy $w} ; return 0 " pack $w.command -side bottom -fill x -pady 2m pack $w.command.confirm $w.command.cancel -side left -expand 1 } proc proc3 {array_name} { array set array1 $array_name set list_value "" for {set i 1} {$i <= 3} {incr i +1} { if {$array1($i,2)==1} { append list_value $array1($i,1) append list_value ";" } ...

Can I run a select query from within code that is ALSO a parameter query and then count the records returned?
I have a parameter query that I can launch manually from the database window. It has two parameters: a customer ID input and company ID input. When I run it and enter the 2 parms, I get a dynaset. I'd like to automate this from within code, running the select query and then doing a DCount of the records returned. I'm only interested in the NUMBER of records returned - not the records themselves. Ideas??? MLH <CRCI@NorthState.net> wrote in message news:<vpikkvoua4f6tg2knmq106vqce47emunbd@4ax.com>... > I have a parameter query that I can launch manually from the database > window. It has two parameters: a customer ID input and company ID > input. When I run it and enter the 2 parms, I get a dynaset. > > I'd like to automate this from within code, running the select query > and then doing a DCount of the records returned. I'm only interested > in the NUMBER of records returned - not the records themselves. > > Ideas??? turn it into a totals query and pass the parameters in code? I'd probably write the whole thing as a function that returned a long integer. Function GetCount(lngCustomerID As Long, lngCompanyID as Long) As Long 'here just declare your variables, point to the parameter query in your code dim db as dao.database dim qdf as dao.querydef dim rs as dao.recordset set db=currentdb set qdf=db.querydefs("qprmMyParamQuery") qdf.Parameters("CustomerID")=lngCustomerID qdf.Parameters(&qu...

Is it possible to embed C++ codes within MATLAB codes?
Hi, I would like to learn if it is possible to run C++ functions on MATLAB. I have written a code on MATLAB however some parts are working too slow. I would like to run those parts using C++ functions and call them in the MATLAB code. I would be very glad if you help me with this problem. Best Regards, -Baran Baran Aydogan wrote: > Hi, > > I would like to learn if it is possible to run C++ functions on > MATLAB. > > I have written a code on MATLAB however some parts are working too > slow. I would like to run those parts using C++ functions and call > them in the...

Variable Input on procedure
I have the following in my code: type img_2d_ptr is access image_grey_2D_t; type image_array_t is array(natural range <>) of img_2d_ptr; shared variable PIP_IMAGES : image_array_t(PIP_REGISTERS'range) := read_PIP_images; procedure destroy_images( variable x : in image_array_t ) is begin for i in x'range loop DEALLOCATE( x(i) ); end loop; end procedure destroy_images; The pass by reference/value is quite important here, because I need to actually make sure the images are actually deallocated, and it doesnt deallocate just a copy of them. Would it just be safer to igno...

Changing front-panel boolean indicators from a sub-vi: global variables vs passing reference vs passing single values vs passing arrays
Hi, I've got a few of these different methods working in practice, however, I would appreciate the viewpoints of some experienced labview users to decide which is best for my application - I'd be thankful for any help you can offer me. &nbsp; The application I'm building at the moment is a simple state-machine based tester. It carries out&nbsp;six tests, then at the end decides whether the DUT passes or fails. I'd like to have "pass" and "fail" LEDs on the front panel for each test. ie. 12 LEDs. However, since six devices will be being tested in parallel, there'll be 72 LEDs total on the front panel. &nbsp; So, the basic hierarchy structure of my program is as follows: &nbsp; UserInterface.vi (with the front panel LEDs) &nbsp; &nbsp;&nbsp;&nbsp; - FullTest.vi (carries out&nbsp;test on DUT#1, then passes "Pass" or "Fail" LED info to UserInterface.vi) &nbsp;&nbsp;&nbsp; &nbsp; - FullTest.vi (carries out&nbsp;test on DUT#2, then passes "Pass" or "Fail" LED info to UserInterface.vi) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - FullTest.vi (carries out&nbsp;test on DUT#3, then passes "Pass" or "Fail" LED info to UserInterface.vi) &nbsp; &nbsp;&nbsp;&nbsp; - FullTest.vi (carries out&nbsp;test on DUT#4, then passes "Pass" or "Fail" LED info to UserInterface.vi) &nbsp;&n...

calling vi continues execution before the call library function returns
In my app one of the VI makes a function call using a "Call library function" node. Then the VI goes on to execute the next frame in my sequence diagram even before the "library function" returned. &nbsp; The Call library function is configured as "Reentrant" with "C" calling convention. The VI executes in "Standard" priority. &nbsp; The library function controls a GPIB instrument and returns when the control process reaches "stability". I can visually see the control process working fine but my return value from the function is a NULL. whereas the library function returns always values greater than NULL if it succeeds in sending at least one command to the instrument. &nbsp; I help any help/pointers on how to make the library function execute in the context of the calling thread (basically block the VI to wait for the function return). Hi Murty, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If the&nbsp;CLF node&nbsp;returned a value, then the function terminated.&nbsp; If it didn't return the value expected then look for errors!&nbsp; Are you checking for errors? :smileywink:&nbsp; It's easy to forget to wire/supply a sufficient timeout for GPIB reads... It sounds - from your post - as though the CLF is in one frame of a sequence-structure or state-machine, and must&nbsp;be terminating&nbsp;before&nbsp;"the next frame" executes.&nbsp; If, inste...

An exception occured within the external code called by a Call Library Node.... was stopped at node &quot;&quot; at a call to &quot;IMAQ RejectBorder&quot;
Hi, I get occasionnaly this message when running an executable which has been installed from the same machine: &nbsp; LabVIEW: An exception occurred within the external code called by a Call Library Node. This might have corrupted LabVIEW's memory. Save any work to a new location and restart LabVIEW. VI "1629-00_200-Main.vi" was stopped at node&nbsp;"" of subVI "IMAQ RejectBorder" &nbsp; It is really anoying because the executable can run without any poblems for many hours and then the message comes and can crash the application &nbsp; Any advice? &nbsp; Version: LV 8.2 IMAQ Vision 8.2 &nbsp; Rodolphe Naoux ...

calling matlab code in labview 5 using call library function
hai i have a problem........... i want to call matlab code through call library function or cal interface node and execute it in my labview 5.but as i configer the dll. file in my CLF, it shows error saying function not found in library. i want brief explanation of how to create dll.in matlab and how to call it in labview5 CLF.can anybody help me? divya shetty. :?: ...

Web resources about - Is it possible, when i call a vi from within my code, to pass to it parameters as input and to return some values too? - comp.lang.labview

Parameter - Wikipedia, the free encyclopedia
A parameter (from the Ancient Greek παρά , "para", meaning "beside, subsidiary" and μέτρον , "metron", meaning "measure"), in its common meaning, ...

fb_source Parameter - Facebook-Entwickler
This document lists the complete list of values for the fb_source parameter that is returned with th...

Google / Firefox Parameter - Flickr - Photo Sharing!
HS what? www.seroundtable.com/archives/017105.html

Cat 8: TIA performance standards committee chairman previews parameters of forthcoming twisted-pair cable ...
Category 8, the next-generation twisted-pair cabling specification, is still in development, but the outlook looks quite positive that it will ...

Philippine president asks for 'parameters' of Mayon Volcano tours
Philippine president asks for 'parameters' of Mayon Volcano tours People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, Apr, May, ...

Alternatives to boolean parameters
... ) { PrintLine ( item . Name ); if ( printDetails ) { PrintLine ( item . Description ); } } } Aha! Now can see that the boolean parameter ...

Exporting Error (Error in Parameter...: Apple Support Communities
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability ...

Apple tech monitors device aging, adjusts operating parameters to ensure optimal performance
... describing a method of monitoring the aging of a device's electronics, comparing the data with a global average and modifying operating parameters ...

Is it poor programming practice to pass parameters as objects?
... a free, community-powered network of 100+ Q&A sites . Risser asked: So, we've got a guy who likes to write methods that take Objects as parameters, ...

Parameter Short Film Competition sponsored by Grolsch
Grolsch presents Parameter The A.V. Club Short Film Competition Please Enter Your Date of Birth Ineligible entry Enter For people over the age ...

Resources last updated: 3/28/2016 8:39:37 PM