Halt script with labview
let's say I execute a script using the "diadem run script.vi" due to user request. Later, the user wants to cancel because it was taking longer than expected.
How do i halt the script using labview tools?
jim
Solved!
Go to Solution.
Hi Jim,
This is possible, but not in the way I believe you are hoping. I know of no way to halt a VBScript running in DIAdem from the "outside". If you were staring at DIAdem you could hit the <ESC> key, but any subsequent request from LabVIEW will go onto DIAdem's "Script Stack" and will not be executed until the first VBScript is done naturally.
Of course you have to run all your LabVIEW calls to DAdem asynchronously, or nothing helps.
So what you can do is set up each VBScript that you think you might want to abort to periodically poll a DIAdem global variable, say "B9", and terminate from inside the VBScript if B9=TRUE. The command interface from LabVIEW to DIAdem (ToCommand) goes onto the DIAdem Script Stack, but the variable interface from LabVIEW to DIAdem (ToDataSheet) does not. So you can "poke" variable B9 from LabVIEW while the first VBScript is running and affect it's behavior, but only if and when that VBScript uses that (B9) variable you poked.
Of course none of this helps if your VBScript is busy waiting for a single VBScript command to execute, and it only helps if your VBScript is running multiple activities, between which it can poll the (B9) variable.
Hope that helps,
Brad Turpin
DIAdem Product Support Engineer
Similar Messages
-
Help with tcl script with labview
I am trying to run a program using tcl script via labview.
Currently I am using wish80 tcl to run it. And it works fine.
I tried using example I found on NI website called Run Tcl Script.vi
I will attach the vi and the tcl file. Hope someone will have a idea what I am doing wrong.
Thanks
please change the testpairs2.txt to testpairs2.tcl as it is not letting me attach as tcl.
Attachments:
Run Tcl Script1.vi 27 KB
testpairs2.txt 1 KBHi randyram,
try the referenced labview example with your parameters. I guess there are some changes on the OS. (actual OS with LV6.1 to XP) :-)
LabView Online Help:
"Refer to the Calling System Exec VI in the labview\examples\comm directory for an example of using the System Exec VI."
Mike -
Hi,
I want to call python script from labview and labview vis from python script.
Can anybody send me any sample code for this using LabPython??
Regards
MeenatchiHi Meenatchi,
see this link http://forums.ni.com/ni/board/message?board.id=170&message.id=308245&requireLogin=False
[edit] if you download labPython from there, then you get some examples with it. [/edit]
Hope it helps
Mike
Message Edited by MikeS81 on 05-21-2008 04:05 PM -
hi
i want to exicute a small java script code in to labview, so please help me for thisYou can do this through .NET interface, it is very complicated.
Google : .NET DLR javascript
You can call .NET methods from labview and there is an existing DLR implementation of javascript. The least to vapour is IronJS.
Download the libraries, force labview use the .NET 4.0 or higher and try to use it.
Since you mentioned "small javascript", much less painfull would be to rewrite it in labview. If you are trying to mimic some javascript code online you didnt develop, you can use tools to breakpoint and probe it by tools in browsers. Firefox has firebug. I used it when I was converting a very difficult mathematic conversion between C and javascript. -
Way to communicat​e with labview with my own scripting language
Hi guys
My objective is to design my own scripting language that can communicate(sending inputs and receiving outputs) with labView for my project. I do have little knowledge about labView . But I dont have any idea how to design scripting language or where to start learning about it since i dont have any computer science background. Can some one guide me about this??
Thanks in advanceWhy do you want to design your own scripting language? That wheel has already been invented. There's a free Python toolkit and a Lua toolkit that you can buy to do scripting in LabVIEW.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice -
Loading and running consecutive scripts in LabVIEW
Hello,
I'd like to start this by saying that I'm very new to LabVIEW so I apologize for any questions that should seem obvious. Also, when replying please remember I'm not as familiar as I would like to be with LabVIEW in general. I have recently had a problem put on my desk to add some functionality to a preexiting, fairly complex VI. The solution seems to be in scripting. However, loading a script longer than 55 lines gives an error (Is this normal? Is there a way around it?). The problem is pretty easy to break up into small parts, so the script has been broken up into multiple smaller parts that provide the same function when ran consecutively. After executing each script, the system will take some time to process (up to 300ms, IIRC) and will assert a ready bit when complete. Using that ready signal as a trigger, I would like to execute the next script.
The scripts are being read correctly into the program using "niHSDIO Write Script.vi", and can be selected by hard-coding the 'script name' into "niHSDIO Configure Script To Generate.vi". It will successfully execute any of the scripts when hard-coded, but when trying to call the next script (script names stored in an array, and incremented with a while loop) an error is given:
Error - 1074118651 occurred at niHSDIO Write
Script.vi
Possible reason(s):
Driver Status: (Hex 0xBFFA4005) You cannot perform this
action while the session is in the running state.
At this point, I've read quite a bit online and in the documentation about trying to find a way to suspend, pause, etc. the state to allow another script to load, but I haven't been able to figure it out.
On the other hand, if there is a way to load a script of arbitary length, I believe that will resolve my problem as well. Please let me know what additional information may be needed to help solve this, as I'm sure I've left out all the good bits.
Thank you in advance,
Landon
Edited for clarity.Good morning Jonathan,
Thank you for your reply. I apologize for the delay in my response. Allow me to back up a little and give you some more information on the script.
The error is as follows:
Error - 1074116601 occurred at niHSDIO Write
Script.vi
Possible reason(s):
Driver Status: (Hex 0xBFFA4807) Too many compiled
instructions in loop. "Generate" and "Wait"
instructions each result in at least one compiled
instruction. Each marker adds an additional compiled
instruction. Clear instruction does not result in a
compiled instruction.
If possible, reduce the number of generate instructions
by concatenating the waveforms on two or more
consecutive generate instructions.
Line Number: 2
Position in Line: 1
Number of Instructions: 2048
Maximum Number of Instructions: 55
Status Code: -201016
I have a waveform that is 524292 cycles long and I want to run 384 cycles, wait for an external trigger, run another 384 cycles beginning at a new position, wait for the same external trigger, and loop that 1024 times. I thought scripting would work, but if there’s a better way please suggest it! I’m using a PXI-6551 with 64Mb/chan RAM in a PXIe 1062Q chassis with a PXIe-8370 controller cabled to a desktop Windows 7 box.
As previously mentioned, the smaller scripts function correctly when split into sections of less than 55 lines. See below for an example functioning script.
Clear scriptTrigger0
Generate mywfm subset(0,384)
Wait until scriptTrigger0
Clear scriptTrigger0
Generate mywfm subset(512,384)
Wait until scriptTrigger0
Clear scriptTrigger0
Generate mywfm subset(1024,384)
Wait until scriptTrigger0
Clear scriptTrigger0
Generate mywfm subset(1536,384)
Wait until scriptTrigger0
Clear scriptTrigger0
Generate mywfm subset(2048,384)
Wait until scriptTrigger0
Clear scriptTrigger0
Generate mywfm subset(519168,384)
Wait until scriptTrigger0
Clear scriptTrigger0
Generate mywfm subset(519680,384)
However, when the full script (attached in text file) is entered, the error is generated.
Thank you again for your time. Please let me know any additional information you may need.
Landon -
Hi, could you please let me know what is the easiest scripting method that can be used in LabVIEW, we have engineers that know nothing about LabVIEW, they want an scripting language to do simple things like assignments , for loop, while loop and basic math functions such Mean . Is math script ( Matlab) the best choice?
The problem I have with Math Script is , I think it is good for complicated mathematics but it can't be used as a command script for LabVIEW ?
For example if I have this line in that scripting window
vpp= 10
then I would like to pass that value to a VI, if I don't have this line then there is no need to have that VI
Is there any LabVIEW scripting language that can be good for this purpose?Thanks jcarmody and Yamaeda for your suggestions
Before working on your idea about using Paython I would like to show you one example and if you think the toolbox can handle that I will continue
This is one of the m files ( matlab ) provided by them:
As you can see below they can call functions , use basic math functions and use basic commands such as if , for , while?
They would like to have an environment like this but when for example they call a function I don't want to run a Matlab or Paython code. I want to run a SubVI which is specified for that command and then we goto to the second line and continue. SO everything should be implemented in LabVIEW but I want to give them this capability to write scripts (since they don't know LabVIEW) but everything should be execute in LabVIEW. Can the Paython toolbox give me this capability?
If not do you have any suggestion
vTest = 0.8; %default voltage value for current measurements is 0.8V
end
atpMode = 2;
atpAddress = 3;
tpCfg = 'ATP';
tpAnaBuff = 'OFF';
configATP(dutNum,ATPmode,ATPaddress,tpCfg,tpAnaBuff);
%This function sets up the DUT test mode and test point
vdd = [];
vpp = [];
configTIBVolt(vdd,vpp,vTest);
% This funciton configures the analog voltages on the test interface board
% Variables that are empty would retain their previous values
bufferOn = 0;
configDUTRelay(bufferOn);
% This function configures the relay that selects the analog buffer on the
% DUT board. For current measurements, the buffer should be bypassed
k = 1;
trimCode = 0;
while(trimCode(k) < 8 && trimCode(k) > -9) %iBias Trim is 2's complement 4-bit
numBits = 4;
trimCode_twosComp = dec2twosComp(trimCode(k),numBits);
% this function converts the decimal trimCode into its 4-bit two's
% complement form since the iBias trim codes are in two's complement
regData = ['xxxx',trimCode_twosComp];
regAddr = 13;
regReadModifyWrite(dutNum,regAddr,regData)
% This function reads the register value, modifies only the selected bits,
% (i.e. those that aren't 'x'), then writes back to that register.
% This is to avoid overwriting unrelated bits in the same byte
dutOut = 'CURR_MEAS';
pxiAnaIn = 'CURR_MEAS';
dutVpp = [];
dutVdd = [];
configTIBMux(dutNum, dutVpp, dutVdd, dutOut, pxiAnaIn);
% This function configures the test interface board analog switches for
% VDD, VPP, DUTout, and PXIanaIn
% Variables that are empty would retain their previous values
pauseTime = 1e-3;
pause(pauseTime);
% Wait for everything to settle.
if( k>2 && direction(k)~=direction(k-1) )
% If the sign of the error changed, then the best trim code is
% either this one or the one just before it
[Y, minIndx] = min(abs(iBias-targetIBias));
% Finds the index with the min error
iBiasTrimCode = trimCode(minIndx);
iBiasMeas = iBias(minIndx);
% assigns values to output variables
trimCode_twosComp = dec2twosComp(iBiasTrimCode,numBits);
regData = ['xxxx',trimCode_twosComp];
regReadModifyWrite(dutNum,regAddr,regData)
% write the best trim code t0 the DUT
return
% Exit the function
end
trimCode(k+1) = trimCode(k) + direction;
k=k+1;
end
% If we've reached this portion of the code, then we failed to find an optimal
% trim code. We should just return the last values, since these are as close
% as we can get to the target (i.e. we're at the edge of the range)
iBiasTrimCode = trimCode(end-1);
iBiasMeas = iBias(end); -
Interacting with labview with my own developed scritpting language.
Hi all,
I am Divya.
My aim :
I need to develop a programing language to interact with Labview such that the script should call labview front panel, execute the given task and front panel shold give back the result to the script.
I want to achieve this by using my own developed programing language (Valid reasons are there why not to use already exixting scripts which I dont want to discuss here as it is not relevant).
My idea :
As developing a new scripting language is a big task I am planning to start with Python scripting. I am trying to interact with labview using python script for now.
My problem :
As I am fresher to this field I dont know the possible ways to interact with Labview using python scripting. (Except using Labpython). If there is any way to achieve this please guide me on this.
Thanks in advanceHi Dennis_Knutson
I am doing the same as the original question I have asked. As I have mentioned in my question I am starting off with a small addition (or any basic mathematical operation) function using Python script.
And yes the basic idea is to call Labview from script not the vice versa. To achieve this I need to pass the parameters from the python script to Labview and output from Labview to Python. For this purpose I am developing a small VI which vil take Python commands and carry on furthur operations.
I can explain with an example.
I have a command in python as sum=x+y. I want to take this command and send 'x' to a numeric control, 'y' to another numeric control and 'sum' to a numeric indicator and at the same time back to script. In between numeric controls 'x' and 'y' I need to carry out '+' operation. Say if the command is sum=x-y I need to carry out '-' operation(Where identifying '+' or '-' or any other operation is the job of labview).
I have developed a VI which can take the command from python and give it to Labview as a string. I need to know how to bifurcate that string to numeric controls, operands etc. -
Hi there,
I want to integrate my Matlab script in Labview,
the input variable should be a Matrix like
the following A = [ 0 256 ; 1 256 ;1.5 100 ; 1.55 110; 1.59 55; 1.6 56 ; 9 256; 14 256 ;15 100 ]
How do I do this in Labview, I tried an array but
no succes...
Bye for nowhi chris .. thanks for the reply ...
here's the results from 'ver
MATLAB Version 7.0.1.24704 (R14) Service Pack 1
MATLAB License Number: 227039
Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 2)
Java VM Version: Java 1.4.2_04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM
MATLAB
Version 7.0.1 (R14SP1)
Simulink
Version 6.1 (R14SP1)
Aerospace
Blockset
Version 1.6.1 (R14SP1)
Bioinformatics
Toolbox
Version 1.1.1 (R14SP1)
CDMA Reference
Blockset
Version 1.1 (R14SP1)
Communications
Blockset
Version 3.0.1 (R14SP1)
Communications
Toolbox
Version 3.0.1 (R14SP1)
Control System
Toolbox
Version 6.1 (R14SP1)
Curve Fitting
Toolbox
Version 1.1.2 (R14SP1)
Data Acquisition
Toolbox
Version 2.5.1 (R14SP1)
Database
Toolbox
Version 3.0.1 (R14SP1)
Datafeed
Toolbox
Version 1.6 (R14SP1)
Embedded Target for Infineon C166 Microcontrollers Version 1.1.1 (R14SP1)
Embedded Target for Motorola
HC12
Version 1.1.1 (R14SP1)
Embedded Target for Motorola
MPC555
Version 2.0.1 (R14SP1)
Embedded Target for OSEK
VDX
Version 1.1.1 (R14SP1)
Embedded Target for TI C2000
DSP(tm)
Version 1.1.1 (R14SP1)
Embedded Target for TI C6000
DSP(tm)
Version 2.2.1 (R14SP1)
Excel
Link
Version 2.2.1 (R14SP1)
Extended Symbolic
Math
Version 3.1.1 (R14SP1)
Filter Design HDL
Coder
Version 1.1 (R14SP1)
Filter Design
Toolbox
Version 3.1 (R14SP1)
Financial Derivatives
Toolbox
Version 3.0.1 (R14SP1)
Financial Time Series
Toolbox
Version 2.1.1 (R14SP1)
Financial
Toolbox
Version 2.4.2 (R14SP1)
Fixed-Income
Toolbox
Version 1.1 (R14SP1)
Fixed-Point
Toolbox
Version 1.1 (R14SP1)
Fuzzy Logic
Toolbox
Version 2.2 (R14SP1) -
Calling Python Script from LabVIEW
Hello Everyone,
I want to call the Python script from LabVIEW.
I tried with using at the command line but i am unable to run that script file..
i have gone through LabPython but i am unable to call the scripts from there also..
If someone has an example of a VI which invokes a python script, it will be very helpful...
Thanks a lot in advance
Regards
Avniavni wrote:
I have to invoke the Script file at command prompt.
Can you descriobe your restriction(s) concerning "invoke the script at the command prompt"? There may be ways around that. -
Can i use Python Matplotlib with labview?
I have a python code that i want to develop a User Interface for, i found Labview, but can i still use all the add-ons and modules when i run the script in labview? basically, i just want to develop a GUI for my code and I want to use all the modules and add-ons that I had in my code. Addons and modules such as pylab, matplotlib, numpy, scipy, and so on. Thanks!
Solved!
Go to Solution.The only integration LabVIEW has with Python is that it can call scripts and use the output from those scripts. Here is an example of how to do that.
https://decibel.ni.com/content/docs/DOC-8995
I would use a Python GUI Framework to control your Python application. Here is a link to the Python Wiki on GUI Frameworks.
http://wiki.python.org/moin/GuiProgramming
Regards,
Matt M.
Applications Engineer
National Instruments -
Where can I find implamantations from Kalman-Bucy-Filters with LabView?
I want to develop a kalman filter with labview! So I am looking for some examples of implementations from Kalman-Bucy-Filters with labview
Maddi73,
I don't think there are any examples out there.However, if you have MatLaB, you could always call matlab scripts from LabVIEW, because MatLAB has the kalman filtering implemented.
Cyril
Cyril Bouton
Active LabVIEW Developper -
Using Agilent 82357a with Labview
Is it possible to use Agilent 82357a USB-GPIB interface board with Labview
Linux version 7 ?Hi
I just installed Labview 7.1 for linux on my machine after throwing away (not literally !) the Agilent card and borrowing an NI PCI-GPIB card. This works with kernels 2.4.x (tested with /usr/local/vxipnp/linux/NIvisa/NIvisaic). However, for proper operation of my machine (have bad display and mouse problems with the old kernel) I need kernels 2.6.x. The driver in /usr/local/nigpib complains that it cannot work with those. I tried hacking the INSTALL script but it keeps running up against differences (like the modversions.h file) between the two kernel series.
Can I use a newer version of the gpib libraries for linux with an older version of Labview like I am using ? I guess I will also need to get newer versions of the visa drivers for that. Though, the labview installation went smoothly with kernel 2.4.27-3 on my Debian system, I know that the newer versions of nigpib (is that the same as ni48825L.iso ?) and NIVISA are not supported on Debian. I cannot reinstall with a different distro, so please do not suggest that.
Any other suggestions ?
Thanks. -
Calling perl script from labview
Hi,
I have a perl script and I would like to call the perl script from Labview
anyone can help me with that?
I used system exec but I'm getting an error.
Anyone have a working example like calling a simple perl script from Labview.
Thanks
SL OngHi,
Thanks for the reply from everyone.
The attached is my code to call Perl script and after calling this, I need to query the Perl Script by sending command like @help. Do they have a way to query the Perl script by sending command like @help and get the return result.
I think Joseph you are right, but how do I get the return result if I invoke it in a separate dos session.
SL Ong -
How do I write a halt script vs an onComplete script?
I am having an issue with a swf playing over another swf. The stop audio portion of my ActionScript is occurring onComplete rather then a halt script action. This was not a problen when I tested locally since the files would download in 1 or 2 seconds instead of 8 to 12 seconds. Can someone tell me how to change the onComplete to a halt action? My script is below.
//run at once
var sRequest:URLRequest = new URLRequest("track01.swf");
var externalMovie:MovieClip;
var swfLoader:Loader = new Loader();
swfLoader.load(sRequest);
this.addChild(swfLoader);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
function onComplete(evtObj:Event):void{
externalMovie = MovieClip(swfLoader.content)
//------------------button code
this.addEventListener(MouseEvent.CLICK, onClick);
function onClick(evtObj:MouseEvent):void{
externalMovie.stop();
//this.removeChild(swfLoader);
//trace(evtObj.target.name)
var buttonClicked:String = evtObj.target.name;
swfLoader.load(new URLRequest(buttonClicked + ".swf"));Hello - Thank you for responding. I am very new to AS3 and I am not certain how I make the unloadAndStop() work in the code I have. There is sound in each of the 19 loaded swf. I am publishing for 10. I think the stop(); you are referring to is for my website link.
The issue is in this portion of the code. I tried changing the code to externalMovie.unloadAndstop(); and it didn't help. Is this a function that replaces swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete); ?
This is the link to the page, if it would help to see what going wrong.
http://www.firstcommusic.net/amped/nov-dec/in_theQ.html
//run at once
var sRequest:URLRequest = new URLRequest("TV_track01.swf");
var externalMovie:MovieClip;
var swfLoader:Loader = new Loader();
swfLoader.load(sRequest);
this.addChild(swfLoader);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
function onComplete(evtObj:Event):void{
externalMovie = MovieClip(swfLoader.content)
Maybe you are looking for
-
It takes so long for my computer to boot up, open applications. i.e. Switching from firefox to photoshop, I get the beachball for 40-50 seconds every time. Is there something I can do to help this situation. It's not just firefox & photoshop, it's al
-
Authentication on Window NT LAN through web
We want our students to see there results online . But we want to authenticate them by there user Id and password which they use inside the campus. on window NT network. Can we access window NT password database if not then any other suggestions. Tha
-
Standlone weblogic server error
Use jdev 11.1.1.3 My application runs well in embedded server. But when deployed in a standalone server, I get this error. This happens after I click a checkbox / save and then scroll through the rest of the rows. This does not happen in the embedded
-
How do I get my adobe CS4 installed?
Ok so here's the problem I bought the student version of adobe cs4 extended. I filled out the form on www.myidentit-e.com/adobe-student-edition. I filled out all the boxes to the best of my ability and the emailed me saying they have my info. So, wit
-
Hi Experts, Can someone please explain me how I can probably do a report bursting using webi. My requirement are as follow: Suppose I have the below table in my report.When i burst my report, user A should receive details of A only on his email id.