tum Posted August 22, 2007 Report Share Posted August 22, 2007 I use LabView7.1 and 6.1,I want to run LabView from command prompt but I don't know how to do? I found this webpage from ni http://digital.ni.com/public.nsf/websearch...64?OpenDocument I know it for LabView 8 but this page say about older version,too but when I try with this page procedure,I can't send agrument to Labview Could you tell me how to send agrument and recieve answer from Labview with command prompt? and/or how to know sequence of agrument? and/or what is API that webpage say and how to use it? or LabView7.1 can not call by command prompt by send agrument to it anyway? Thank you very much for your help Quote Link to comment
Ton Plomp Posted August 22, 2007 Report Share Posted August 22, 2007 Cross post Quote Link to comment
tum Posted August 22, 2007 Author Report Share Posted August 22, 2007 QUOTE(tcplomp @ Aug 21 2007, 02:04 PM) http://forums.lavag.org/index.php?showtopic=8887&st=0&p=34458entry34458' target="_blank">Cross post sorry,but I'm afraid knowledge member not see my topic and I post only topic that link with my want Quote Link to comment
Tomi Maila Posted August 22, 2007 Report Share Posted August 22, 2007 Actually both of the categories you posted didn't match the question. The correct category would have been LabVIEW general or LabVIEW development environment (but not both). I don't know the answer. However in the help of LabVIEW 8.x LabVIEW command line options are explained. Did you search LabVIEW help for 'command line' before posting? Quote Link to comment
Karissap Posted August 22, 2007 Report Share Posted August 22, 2007 You can use this method in earlier versions such as LabVIEW 7.1 as well, it is just an application property node in the vi. Here is a vi that gets the command line arguments in LabVIEW version 7.1 http://forums.lavag.org/index.php?act=attach&type=post&id=6698 http://forums.lavag.org/index.php?act=attach&type=post&id=6697 Quote Link to comment
tum Posted August 22, 2007 Author Report Share Posted August 22, 2007 QUOTE(Karissap @ Aug 21 2007, 02:43 PM) You can use this method in earlier versions such as LabVIEW 7.1 as well, it is just an application property node in the vi.Here is a vi that gets the command line arguments in LabVIEW version 7.1 http://forums.lavag.org/index.php?act=attach&type=post&id=6698 http://forums.lavag.org/index.php?act=attach&type=post&id=6697 Thank you very much,You have a thorough knowledge for Labview. I will try to test with your comment if another problem will ask you again, but you are first people that know how to do. now I know only LabView call perl,Labview call VB but can not use VB call LabView and Perl Call LabView because I don't know how to send agrument to LabView. I think many member and some of profession member are not know this topic very mech. if it possible we can use all of program call Labview and use Labview call another program. Quote Link to comment
Tom Limerkens Posted August 23, 2007 Report Share Posted August 23, 2007 When building an application, remember to enable 'Pass all commandline arguments to application' in the 'Application Settings' Tab of the application builder. Otherwise no arguments will be accessible in the EXE. Tom Quote Link to comment
orko Posted August 23, 2007 Report Share Posted August 23, 2007 <pre_coffee> QUOTE(tum @ Aug 21 2007, 02:19 AM) I think many member and some of profession member are not know this topic very mech. I have no idea why you would think that... receiving command line arguments from within LabVIEW has been common knowledge in the LabVIEW community for a long time, since the help (and the first link in the "related" section on the web site you provided) is pretty clear on how to do this. It may benefit you to take a little time to get more familiar with the help inside of LabVIEW, it's very good. Sorry, but if not many people respond to your post it doesn't necessarily mean that no one knows the answer. They may just not understand the question (or don't have the time at the moment to answer). </pre_coffee> Quote Link to comment
tum Posted August 24, 2007 Author Report Share Posted August 24, 2007 QUOTE(orko @ Aug 21 2007, 02:43 PM) I have no idea why you would think that... receiving command line arguments from within LabVIEW has been common knowledge in the LabVIEW community for a long time, since the help (and the first link in the "related" section on the web site you provided) is pretty clear on how to do this. It may benefit you to take a little time to get more familiar with the help inside of LabVIEW, it's very good. Sorry, but if not many people respond to your post it doesn't necessarily mean that no one knows the answer. They may just not understand the question (or don't have the time at the moment to answer). I know what you mean but I found I do same as website but it not work. I tell on webboard and share exp if someone read it and do it and it work I need exp but if not not work same me I think I will response to ni. my point is when you compile program to dll or exe you will found "Pass all commandline arguments to application" but if my program name work.vi and it has 3 inputs <IP> <PORT> <PAGE> What is true command line?anybody know? LabView {PATH of LabView FILE}/work.vi -- <IP> <PORT> <PAGE> or LabView {PATH of LabView FILE}/work.vi -- <PAGE> <IP> <PORT> or anything? someone could you tell me what is true?and how to do? but I found when I test with myself anyanswer is wrong,any agrument can not pass to my .vi if I call by command line, even if I compile and check "pass all agrument" but my work.exe still not recieve agruments that I send to it. if anybody want to call LabView by another program etc. .BAT VB VC or Perl,I think this topic will help you if someone answer or member share exp(only share exp) because if it not work also by command line we just think to solve by another way. QUOTE(Tom Limerkens @ Aug 22 2007, 06:47 PM) When building an application, remember to enable 'Pass all commandline arguments to application' in the 'Application Settings' Tab of the application builder. Otherwise no arguments will be accessible in the EXE. Tom Thank you very much for your response but I still not work coz before I post this topic I found and check it before this my first thinking, LabView 7.1 is not support command line. but I think I'm wrong and then I try many time it still not work too. my program can not recieve any agrument. before try it I think it easy and common sense same as orko and any member that complain me but no answer for help,too but for anybody try to help me,I really thank you anyway you answer can help me or not but now it still not work. Quote Link to comment
orko Posted August 24, 2007 Report Share Posted August 24, 2007 QUOTE(tum @ Aug 22 2007, 07:08 PM) I know what you mean but I found I do same as website but it not work. Please post an example VI to this board as an attachment so we can see what you are trying to do. Without the code to look at I really can't see where your problem lies. Thanks! I'm sure we can get this solved if we are all on the same page. Quote Link to comment
Karissap Posted August 24, 2007 Report Share Posted August 24, 2007 QUOTE(tum @ Aug 23 2007, 12:08 PM) if my program name work.vi and it has 3 inputs <IP> <PORT> <PAGE> What is true command line?anybody know? LabView {PATH of LabView FILE}/work.vi -- <IP> <PORT> <PAGE> or LabView {PATH of LabView FILE}/work.vi -- <PAGE> <IP> <PORT> or anything? someone could you tell me what is true?and how to do? It is much simpler than that. Just use your vi as the top level source file in the application builder and make sure you tick the box "Pass all command line arguments to application" then build your exe. Then to call the program from the command line just use in <path to exe> <arg1> <arg2> etc.. Here is a screenshot after I built the vi I posted before into an executable C:\application.exe. http://forums.lavag.org/index.php?act=attach&type=post&id=6724''>http://forums.lavag.org/index.php?act=attach&type=post&id=6724'>http://forums.lavag.org/index.php?act=attach&type=post&id=6724 Quote Link to comment
tum Posted August 24, 2007 Author Report Share Posted August 24, 2007 QUOTE(Karissap @ Aug 23 2007, 11:08 AM) It is much simpler than that. Just use your vi as the top level source file in the application builder and make sure you tick the box "Pass all command line arguments to application" then build your exe. Then to call the program from the command line just use in <path to exe> <arg1> <arg2> etc..Here is a screenshot after I built the vi I posted before into an executable C:\application.exe. http://forums.lavag.org/index.php?act=attach&type=post&id=6724''>http://forums.lavag.org/index.php?act=attach&type=post&id=6724'>http://forums.lavag.org/index.php?act=attach&type=post&id=6724 Thank you very much,You are a perfect LabView man for me. but now I see problem again. How to return value to DOS again? I want to use it as function it mean we can insert agrument and recieve answer from program. but however I want to really thank you Karissap,Tom Limerkens,Tomi Maila very much. Quote Link to comment
Justin Goeres Posted August 24, 2007 Report Share Posted August 24, 2007 QUOTE(tum @ Aug 22 2007, 09:46 PM) How to return value to DOS again?I want to use it as function it mean we can insert agrument and recieve answer from program. Do you mean that you're trying to write a console app in LabVIEW? (I.e. a program you run from the command line (with arguments) that returns its output to stdout.) That's an issue I've been meaning to look into for a while, but have never found the time to do so. Quote Link to comment
Karissap Posted August 25, 2007 Report Share Posted August 25, 2007 I'm not aware of a straight forward way to write to stdout from a labview exe. I got some information from this thread though on the ni forums. You could use windows system dll calls to write to stdout: QUOTE For the output...Use GetStdHandle, kernel32 to get a handle, (handle GetStdHandle(long param), use -11 for parameter); Use WriteFile, kernel32 to write a string (long WriteFile(long handle, CStr message, long length, long *written, long overlapped)); This is pretty advanced to do this though if you haven't had much experience calling dlls from LabVIEW. If you are able to create files somewhere I suggest the method described at the beginning of the thread: QUOTE Have the VI save its output to a file and then use the DOS command type to put the data on the command line. The command to call the VI and retreive the results could be put in a *.bat file. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.