[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-list
Subject:    problem wih vi.run
From:       Ananda Regmi <aregmi () gmail ! com>
Date:       2005-08-31 23:38:09
Message-ID: a0d9f4a0050831163815abbb6 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello Everybody,
 I am running into a strange problem while running a vi through python. 
Below is my sample code.

lv = win32com.client.Dispatch("LabVIEW.Application.7.1") 
file_path = 'C:\\Documents and Settings\\administrator\\My Documents\\Python 
Files\\testvi.vi' 
vi=lv.GetVIReference(file_path) 
vi.Run # it stays in this line until the vi finishes running. 

When the execution reached the above line, it gets stuck there. It proceeds 
to the next line of code only after the vi finishes running. But, I need to 
change some control value in the Run-Time of the vi. I was wondering if 
there is any option to select before running the VI which can distinguish 
between completely running the vi and just starting the vi to run and going 
to the next line of script.

I tried using vi.Run(1), vi.Run(), and vi.Run(0). In all of the above cases, 
python execution gets stuck at very same place, the VI gets executed, and 
when it finishes running, I get an error in Python IDLE saying "'NoneType' 
object is not callable labview" and does not go any further. 

I was also wondering, if vi.Run(1) is the right way to do it and if I need 
some extra code to avoid that error and run it the way I want to run it.

I really appreciate your help.

Thanks,

Ananda

[Attachment #5 (text/html)]

<div class="MsoNormal"><font face="Verdana" color="black" size="1"><span \
style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">Hello \
Everybody,</span></font></div> <div class="MsoNormal"><font face="Verdana" \
color="black" size="1"><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: \
Verdana"></span></font>&nbsp;</div> <div class="MsoNormal"><font face="Verdana" \
color="black" size="1"><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: \
Verdana">I</span></font><font face="Verdana" color="black" size="1"><span \
style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">  am running into a \
strange problem while running a vi through python. &nbsp;Below is my sample \
code.</span></font></div> <p class="MsoNormal"><font face="Verdana" color="black" \
size="1"><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">lv = \
win32com.client.Dispatch(&quot;LabVIEW.Application.7.1&quot;) <br>file_path = \
'C:\\Documents and Settings\\administrator\\My Documents\\Python Files\\testvi.vi'  \
<br>vi=lv.GetVIReference(file_path) <br>vi.Run # it stays in this line until the vi \
finishes running. </span></font></p> <p class="MsoNormal"><font face="Verdana" \
color="black" size="1"><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: \
Verdana"></span></font></p> <p class="MsoNormal"><font face="Verdana" color="black" \
size="1"><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">When the \
execution reached the above line, it gets stuck there. It proceeds to the next line \
of code only after the vi finishes running. But, I need to change some control value \
in the Run-Time of the vi. I was wondering if there is any option to select before \
running the VI which can distinguish between completely running the vi and just \
starting the vi to run and going to the next line of script. </span></font></p>
<p class="MsoNormal"><font face="Verdana" color="black" size="1"><span \
style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">I tried using vi.Run(1), \
vi.Run(), and vi.Run(0). In all of the above cases, python execution gets stuck at \
very same place, the VI gets executed, and when it finishes running, I get an error \
in Python IDLE saying "'NoneType' object is not callable labview" and does not go any \
further. &nbsp; </span></font></p>
<p class="MsoNormal"><font face="Verdana" color="black" size="1"><span \
style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: Verdana">I was also wondering, if \
vi.Run(1) is the right way to do it and if I need some extra code to avoid that error \
and run it the way I want to run it. <br><br>I really appreciate your \
help.</span></font></p> <p class="MsoNormal"><font face="Verdana" color="black" \
size="1"><span style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: \
Verdana">Thanks,<br><br>Ananda</span></font></p> <p class="MsoNormal"><font \
face="Verdana" color="black" size="1"><span style="FONT-SIZE: 9pt; COLOR: black; \
FONT-FAMILY: Verdana">&nbsp;</span></font></p>



-- 
http://mail.python.org/mailman/listinfo/python-list

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic