Call labview vi interactiv​ely from diadem 10
Hi, I am trying to run a LabVIEW VI from DIAdem. I have LabVIEW 7.1 loaded on my machine and got Diadem 10. I have downloaded the tool for calling LabVIEW VIs interactively from DIAdem but am unable to run my VI. Only VIs from library DIAdem_selectVIs executes. Is there any solution to call LabVIEW VI from DIAdem 10.
This is the link. Plz Check it out.
http://zone.ni.com/devzone/conceptd.nsf/webmain/1A98AB48E35D913086256E23004E6A22?opendocument&node=5050_US
Regards,
Peter.
Pizza
Hi Brad,
Thanks for your quick response. I worked on that example You have sent. It's working fine. I find little hard to pass my channels from Diadem to Labview and vice-versa. Can You please help me. I have attached a simple array addition Labview VI.
Cheers,
Peter
Pizza
Attachments:
pressure 2.vi 10 KB
Similar Messages
-
Calling labview 8.2 Vi from teststand 3.5 throws an error
calling labview-8.2 vi in teststand-3.5 throws the following error.
In the development environment, where Teststand 3.5 and LabVIEW 8.2 are installed, teststand file doesnt throw any error. However when the same sequence is deployed in a machine that doesnt have teststand and labview. (Both Teststand runtime engine and Labview runtime engine) are installed in the end machine.
Trying the execute the sequence in the end machine throws the following error
"Error loading step 'Call LabVIEW measurement module for amplitude imbalance' of sequence 'MainSequence' in file 'TSG06-Amplitude Imbalance.seq'.
LabVIEW: VI version is later than the current LabVIEW version."
Attachments:
Error.JPG 26 KBHi,
Should have also asked this question before.
What is your LabVIEW Adaptor set too on the target system. Use ActiveX Runtime Server or LabVIEW RTE. If its set to use the LaBVIEW ActiveX Runtime Server which can be either the Operator Interface or the seperate ActiveX Server, then these are probably built with an early labVIEW.
If so you would need to rebuild the server you are using.
Regards
Ray Farmer
Regards
Ray Farmer -
Some errors when calling LabVIEW VIs Interactively from DIAdem
Hi! I'm having some trouble using the "Calling LabVIEW VIs Interactively from DIAdem" found on:
http://zone.ni.com/devzone/conceptd.nsf/webmain/1A98AB48E35D913086256E23004E6A22
Following the troubleshooting section didn't resolve the issue. I
recompiled and built the exe (DIAdemLabVIEW.exe) for version 7.1.1,
which I am developing on. But still I got the same error message, after
a waiting for about a minute, on a diadem popup window:
Error in <MenuAdd...ctDo.vbs (row:1, column: 1)
Error in <addmenuentry.vbs (row:14, column: 3)
ActiveX component can't create object.: 'DIAdemLabWIEV.Application'
Using the llb's and exe's that was included with the installer worked
flawless, with the exception that LV 7.1.1 vi's didn't appear on the
popup window(DIAdemLabWiev.vi). So I tried to recompile and build for
the 7.1.1, with this result.
I'd be very grateful for fixes or solutions for this problem!
Regards
Roger IsakssonBrad, thanks for the reply! Below is my (correct?) modification of your script. Have I got it right?
Dim lvapp, vi, viPath, paramName(1), paramVal(1)
Set lvapp = CreateObject("LabVIEW.Application")
viPath = "C:\TEMP\Test.exe"
Set vi = lvapp.GetVIReference(viPath)
vi.FPWinOpen = True
paramName(0) = "In Name"
paramVal(0) = "In Value"
paramName(1) = "Ut Name"
Call vi.Call(paramName, paramVal)
Call lvapp.Quit()
MsgBox "Parameter1 Value = " & paramVal(1)
I am not sure about the format of the <paramName(0) = "In Name">.
The control name is "In" and is a I32, the name for the indicator is
"Ut" and has the same storage type as the control.
Running the script gives an error in line 4, that is the <Set vi =
lvapp.GetVIReference(viPath)>. I'll attach the exe and the error
message.
I have another question regarding the relatively large amount of RAM
that diadem uses for export from my labview application to diadem. More
than 10 times the size of the data is required for exporting to diadem.
Since our application use relatively large files, actually up to
several GB's, this soon becomes problematic. See the attached picture
of the memory usage after exporting a 10MB segment (contains 42
channels of measurement data). Your help in these matters would be
appreciated!
Regards
Roger Isaksson, Damill AB
Message Edited by Roger Isaksson on 09-09-2005 10:22 AM
Message Edited by Roger Isaksson on 09-09-2005 10:22 AM
Attachments:
VBError.JPG 181 KB
Test1.vi 9 KB -
I am trying to run a LabVIEW VI from DIAdem. I looked in the help files but the example seems to only open LabVIEW 7.0 and not open the VI. The process stops on the LabVIEW startup screen. Also I have LabVIEW 7.1 loaded on my machine and would like to be able to select which version of LabVIEW I start with DIAdem. Is any of this possible?
Thanks in advance.
AJLHi AJL,
If your VI happens to be in the LabVIEW directory or subdirectory structure, you can use native functions in DIAdem 9.1 to call that VI from DIAdem. If the VI is further configured to run when opened, it will automatically start:
IF IsAvailLabVIEW = TRUE THEN
LVTemplatePath = "examples\DIAdem\File\File Headers\"
LVTemplateVI = "Binary File Analyzer.vi"
Call LaunchLabVIEW
END IF
Otherwise you will need to create VBScript object variables from the VI server of LabVIEW and execute their methods and set their properties to have the same remote control over the VI as you would from another VI using VI server. The example Tom pointed you to shows this in intricate detail, in the context of a very large application. Here's what VI server looks like in VBScript:
Dim lvapp, vi, viPath, paramName(0), paramVal(0)
Set lvapp = CreateObject("LabVIEW.Application")
viPath = "C:\Favorite LV Menu\Binary File Analyzer.llb\Binary File Analyzer.vi"
Set vi = lvapp.GetVIReference(viPath)
vi.FPWinOpen = True
paramName(0) = "file path"
paramVal(0) = "C:\DIAdem Hands-On\ReadMe.txt"
Call WndShow("SHELL", "MINIMIZE")
Call vi.Call(paramName, paramVal)
Call lvapp.Quit()
You can read and write more than one parameter for VIs with multiple input/output terminals. Note that the paramName() and paramVal() variables are VBScript arrays. The number of elements in these arrays does NOT have to match the number of terminals-- all you need to put in these VBScript arrays are the parameters that you care to read/write in the VI.
Ask if you have additional questions,
Brad Turpin
DIAdem Product Support Engineer
National Instruments -
Hi there,
I try to start a VI within a llb from a toolkit and it doesn't work...
The path to the VI is :
C:\Program Files\National Instruments\LabVIEW 8.5\vi.lib\Addons\Time Series Analysis\Correlation and Spectral Analysis.llb\TSA Welch (waveform).vi
I try this code :
' Initialize the LVRuntime
Dim sgRunTimeVersionT : sgRunTimeVersionT = ""
LVRuntime.Init sgRunTimeVersionT
' Load "Test.VI"
Dim objVI
Set objVI = LVRuntime.LoadVI("
C:\Program Files\National Instruments\LabVIEW 8.5\vi.lib\Addons\Time Series Analysis\Correlation and Spectral Analysis.llb\TSA Welch (waveform).vi")
' Call the VI
Call objVI.Run(true)
' Clean up
Set objVI = Nothing
LVRuntime.DeInit
I had
[LVRT]
libdir = "C:\Program Files\National Instrument\Labview 8.5"
in the Diadem.ini file
The error message is attached...
Please, could anyone help me !
Thank's in advance.
Attachments:
error9.JPG 17 KBDuplicate post.
Please post answers in this thread. -
Is it possible to call a LabVIEW VI by reference from a CIN?
I am calling by reference in my LabVIEW program and would like to do the same from a CIN, if possible.
> I am calling by reference in my LabVIEW program and would like to do
> the same from a CIN, if possible.
>
It is not possible to directly call a VI by reference from a CIN.
There are a couple approaches that are similar that will work. If you
have the professional version, you can build a DLL from VIs and can call
the DLL entrypoints from your CIN.
It is also possible to signal a LV occurrence from a CIN, and a LV
diagram could run a VI or perform an operation when the occurrence is
set. You will not be able to pass parameters with the occurrence though.
Finally, the approach that will be easiest to debug is to change the CIN
so that it returns to the diagram more often. Call the CIN and have it
return with an action. The actions can be -- run
a particular VI, delay
for x ms and call the CIN again, end the program, etc.
This last approach will be slightly less efficient at runtime, but in my
experience they are much more flexible and much easier to debug.
Greg McKaskle -
I would like to Call Labview application (as Active X Server) from Visual C++. I need any type of exemple on how to do this, any input will be greatly apriciated.
In the summer there has been an example in the Developer Zone, but i can't find it again. I can send you the attached zipfile from that example. The example is resricted to single threaded applications. In multi threaded applications you must initialise OLE in the thread where you communicate with the active-X server.
If you need more information contact me at [email protected]
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Attachments:
VCandLabVIEW.zip 91 KB -
Calling LabView ActiveX Server from TCL?
Does anyone have experience calling a LabView ActiveX server vi from
TCL? I created a simple VI with one control (labeled "A") and one
indicator (labeled "B") and a +1 adder between them. I can load and
open the VI from TCL:
package require tcom
set lv [::tcom::ref createobject "LabView.Application"]
set viPath "D:\\National Instruments\\LabView\\Activity\\a.vi"
set vi [$lv GetVIReference $viPath]
$vi FPWinOpen True
But when I try to send in data:
$vi -namedarg Call A 1
I get the error message "unknown parameter A".
I have also attempted to duplicate the "ActiveX Server" example
from the LabView help file, calling "Frequency Response.vi". This
approach encounters the same error message:
% package require t
com
3.0
% set lv [::tcom::ref createobject "LabView.Application"]
::tcom::handle0x013202F4
% set viPath "D:\\National
Instruments\\LabView\\examples\\apps\\freqresp.llb\\frequency
Response.vi"
D:\National Instruments\LabView\examples\apps\freqresp.llb\frequency
Response.vi
% set vi [$lv GetVIReference $viPath]
::tcom::handle0x01335AE8
% $vi FPWinOpen True
% $vi -namedarg Call Amplitude 10
unknown parameter Amplitude
If anyone can point me in the right direction, or give me an
example of how to do this I would greatly appreciate it.
TIA.
LeslieIn article ,
Leslie Brooks wrote:
>"Bruce Hartweg" wrote in message
>news:...
>> "Chin Huang" wrote in message
>news:[email protected]...
>> >
>> > I don't use LabView, but from the Visual Basic example I saw, it seems
>> > the Call method takes two arguments. The first is an array of parameter
>> > names and the second is an array of parameter values. Try to send in
>> > data with the Tcl command
>> >
>> > $vi Call [list A] [list 1]
>>
>> I'm unable to help the original question (don't know LAbView or VB stuff) but
>> just want to point out that [list A] is equal to A and [list 1] is the
>same as 1.
>>
>> Bruce
>
> I know what is supposed to be passed to the 'Call' method. Doing
>this:
>
>set inst [::tcom::info interface $vi]
>$inst methods
>
> produces (among other things):
>
>{1015 VOID Call {{{in out} {VARIANT *} paramNames} {{in out} {VARIANT
>*} paramVals}}}
>
> So the 'Call' method is expecting two parameters, both pointers
>to variants. TCOM appears to be passing the correct parameter type
>because the TCOM documentation says that a TCL List maps to a
>one-dimensional array of VT_VARIANT. However, the results are
>INvariant (bad pun intended):
>
>% $vi -namedarg Call Amplitude 10
>unknown parameter Amplitude
>% $vi -namedarg Call [list Amplitude] [list 10]
>unknown parameter Amplitude
>% $vi -namedarg Call [list Amplitude] [list [::tcom::na]]
>unknown parameter Amplitude
>% set i 5
>5
>% $vi -namedarg Call [list Amplitude] {incr i}
>unknown parameter Amplitude
>% $vi -namedarg Call [list Amplitude] [list [incr i]]
>unknown parameter Amplitude
>% $vi -namedarg Call Amplitude [incr i]
>unknown parameter Amplitude
>
> Who can help me with this? Who is the LabView Guru?
Try invoking the Call method without the -namedarg option. The
-namedarg option doesn't work the way you seem to think it works. The
-namedarg option provides a way to specify arguments named from the
method's parameter specification. For example, you discovered that the
Call method take two parameters named "paramNames" and "paramVals".
Tcom returns the error "unknown parameter Amplitude" because "Amplitude"
doesn't match either parameter name. -
Does anybody know of a simple way to call LabVIEW VIs from within a MATLAB m-file? I would like to be able to write VIs in LabVIEW and then script them (for stochastic analysis, etc.), and think MATLAB would be an awfully convenient way to do this (also useful for data analysis, etc.). I have looked at LuaVIEW, but it appears to have been largely abandoned.
Thanks!Hello Erik,
Building it into a DLL as Altenback said is a solid way to do this, and here's a Knowledge Base article that also explains how to transfer data in binary or ASCII format, How do I Transfer Data Between The MathWorks, Inc. MATLAB® Software Development Environment and LabV...
Thank you,
Deborah Y.
LabVIEW Real-Time Product Marketing Manager
Certified LabVIEW Architect
National Instruments -
Hi,
I'm having trouble calling labview dll from C# to perform certain function.
The function supposed to return the values in the float Analysis[] array. However, when I execute it it only returns zero values.
It seems that some parameters are not properly passed to the dll.
Below is the function in the header file:
void __stdcall Optical_Center(char FileDirectory[], long ImagePtr,
short int Height, short int Width, char ReadFromFile, float Analysis[],
long lenAnalysis);
and my corresponding dll import in c#:
[DllImport(@"SMIA.dll", CharSet = CharSet.Ansi)]
public static extern void Optical_Center([MarshalAs(UnmanagedType.LPStr)]string FileDirectory, long ImagePtr,
short Height, short Width,char ReadFromFile, IntPtr Analysis,
long lenAnalysis);
string str = @"C:\SMIA.raw";
int len = 3;
long m_lenAnalysis = 3;
long m_ImagePtr = 0;
short m_Height = 2464;
short m_Width = 3280;
IntPtr m_PtrArray = Marshal.AllocHGlobal(len * Marshal.SizeOf(typeof(float)));
char m_ReadFromFile = '1';
Optical_Center(str,m_ImagePtr,m_Height,m_Width,m_ReadFromFile,m_PtrArray,m_lenAnalysis);
float[] m_Analysis = new float[len];
Marshal.Copy(m_PtrArray, floatArray,0,len);
Marshal.FreeHGlobal(m_PtrArray);
string printstr = "";
for (int i=0; i<len; i++)
printstr = printstr + floatArray[i].ToString() + "\n";
MessageBox.Show(printstr);
Appreciate if anyone can help, thanks.
KLI was just about to post the header file of the DLL, when
I noticed that there's a function called LVDLLStatus.
This little thingie turned out to be a rather handy tool.
With that function I found that in the DLL I had a problem
with another function that prevented the DLL to be correctly
loaded.
This other function in the DLL is for generating digital output
and it worked as it should, when tested from LV.
Anyway if someone is interested, I got it working by using
the LoadLibrary and GetProcAddress function, as in the
source code thatI posted earlier.
I will investigate what is wrong with that digital output, and
post into a another thread if I have problems with that. -
How to call LabVIEW dll from ATL COM dll
I have tried to call simple LabVIEW 8.6 Dll from win32 test application, class Library.
I have include LabVIEW generated SharedLib.h file and SharedLib.lib file in the test application which I created as simple win32 console project and also from win32 class Library. I was sucessfully able to call my LabVIEW dll funtion.
But when I create ATL COM project and try to add SharedLib.h file and SharedLib.lib file I used to get following erors
Error 1 error C2733: second C linkage of overloaded function 'StrCatW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 463
Error 2 error C2733: second C linkage of overloaded function 'StrCpyW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 464
Error 3 error C2733: second C linkage of overloaded function 'StrCpyNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 465
Error 4 error C2733: second C linkage of overloaded function 'StrCmpW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 466
Error 5 error C2733: second C linkage of overloaded function 'StrCmpNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 467
these many errors.
Will some one explain me how to call LabVIEW dll from ATL COM dll.
Thanks & Regards,
JayI also had this problem. My application is unicode-aware, but I was attempting to link it to a library with primitive C-string arguments. You could dynamically load the DLL as suggested (more work), modify the header files (really not recommended), or if you are feeling lucky you could try fooling the compiler, as I was successfully able to do in Visual Studio 2010, by steering the preprocessor around those functions (assuming you're not using them, of course -- otherwise this probably wouldn't work):
// prepare for NI extcode.h inclusion. avoid linker errors for this project.
#define StrCatW(a,b) IgnoreLinkError_StrCatW(a,b);
#define StrCpyW(a,b) IgnoreLinkError_StrCpyW(a,b);
#define StrCpyNW(a,b,c) IgnoreLinkError_StrCpyNW(a,b,c);
#define StrCmpW(a,b) IgnoreLinkError_StrCmpW(a,b);
#define StrCmpNW(a,b,c) IgnoreLinkError_StrCmpNW(a,b,c);
// header file for my LabView-built DLL (ASCII single-byte character arguments)
#include <MyLibraryHeader.h>
// clean up afterwards, put things back to 'normal'
#undef StrCatW
#undef StrCpyW
#undef StrCpyNW
#undef StrCmpW
#undef StrCmpNW -
How to call LabVIEW from TestDirector
Hai to all,
I want to call LabVIEW function from TestDirector. That TestDirector using VBScript. is it posible? if posible can you give the procedure.
thanks for advance!
reddyHello,
in this case you have to contact Mercury for more informations. There are no experiences in this way from the LV side.
Regards
Thomas D.
NI Germany
(SRQ 204139) -
Calling labview from external code
hello all,
I m a student and new to labview,i just want to ask that whether i can call VI developed in LAbview form my c++ code?
plz reply,it's urgent.
waititng for replies.
Thanx9866662680 wrote:
hello all,
I m a student and new to labview,i just want to ask that whether i can call VI developed in LAbview form my c++ code?
plz reply,it's urgent.
waititng for replies.
Thanx
If
you have the Application Builder or the LabVIEW Professional Developer
system you can compile the VI into a DLL and call that DLL as a
standard C DLL from Visual C(++). OTherwise you could call LabVIEW over
Active X and execute the VI through that. There are examples for
calling LabVIEW through Active X in your LabVIEW installation.
Rolf Kalbermatter
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
Calling LabVIEW from C# Using ActiveX?
Hi,
I try to call LabVIEW VI's from C# using ActiveX/COM, but I am not
successful. I was able to do this from C++ and there are nice articles on
the NI site dealing with the C++ integration.
I tried to follow the instructions of the C# help, using a wrapper for the
LabVIEW application call. I included the TypeLib that I created with the
tlbimp-tool in my project. Basically my code looks like this:
LabView50TypeLib._Application myLV = new
LabView50TypeLib.ApplicationClass() ;
LabView50TypeLib.VirtualInstrument myVI = new
LabView50TypeLib.VirtualInstrument();
myVI = myLV.GetVIReference(,?,?);
myVI.SetControlValue();
myValue= myVI.GetControlValue();
myLV.Quit();
I even don't know if the fi
rst line is correct. I know that the second line
is not OK, because there is no class "VirtualInstrument" - but from what
class should I derive my instance for the VirtualInstrument? And different
from my C++ implementation, the GetVIReference now needs 3 parameters
instead of 1 (the path).
What am I doing wrong? Does anybody have a working example on this?
Thanks a lot & best regards,
Martin SchellenbergerHello
After adding a reference to the LabVIEW type lib to the project (I just to o to Project >> Add Reference and I browse for the typelib myself), and including the labview namespace at the top,here is what I tried
using LabVIEW;
//form code here
//Event for button code
LabVIEW.Application lv = new LabVIEW.ApplicationClass();
LabVIEW.VirtualInstrument vi= lv.GetVIReference(@"c:\a.vi","",false);
vi.FPWinOpen=true;
vi.Run(true);
So all it does is it opens the VI and runs it, seems to work fine. Hope this helps
Bilal Durrani
NI
Bilal Durrani
NI -
Hello all,
I am using DIAdem 10.0 Advanced, LabVIEW 8.0 PDS. I would like to start a LabVIEW IHM from a VBS script. I use VI Server to call my VI from DIAdem.
Here is the script and the VI I use (VI attached):
Dim lvapp, vi, viPath, paramName(1), paramVal(1)
Set lvapp = CreateObject("LabVIEW.Application")
viPath = "C:\TEST\test.vi"
Set vi = lvapp.GetVIReference(viPath)
vi.FPWinOpen = True
paramName(0) = "Input"
paramVal(0) = 10
paramName(1) = "Output"
paramVal(1) = 0
Call vi.Call(paramName, paramVal)
Call lvapp.Quit()
I found a similar example on your web site.
Question 1:
I need to know the syntax for all the other properties and methods of a VI object (method like Get or Set Control Value for example).
Is a documentation (other than the LabVIEW help which is dedicated for LV programmers) exist in order to be able to use all the features of VI Server from another environment (CVI, VB, ...)?
Question 2:
Is it possible to call a VI with VI Server with the parameter "Wait until done" to FALSE? (run a VI asynchronuously from DIAdem)
Thanks for your answer.
MatthieuG
Eurilogic
Attachments:
Test.vi 9 KBHello,
I finally found a way to get the documentation of VI Server. I can view the "LabVIEW.TLB" type library file with a OLE/COM Object Viewer (a utility from the Windows SDK).
Maybe you are looking for
-
Mobile Me to iCloud created two Apple IDs
I know that similar questions have come up but none of them seem to fit my situation. When MobileMe transitioned to iCloud, I was prompted to create an iCloud account. My [email protected] was then linked with [email protected] so they would be interchangeable
-
Passing Parameter to jspx page in URL
hello all, I want to know if it is possible to send paramters in jspx url . And if it is , then how can we acess those parameters in the backing beans . I am using jdeveloper 10.1.3 My link is http://10.11.5.5:8989/WF_APPS/faces/LoginPage.jspx and i
-
Document layout changes when creating PDF
We have the problem of the layout/formatting of documents changing whenever we try to print to PDF from, for instance MS-Word. We open a large document of lets say 100 pages in total, then when we choose PRINT and now select ADOBE PDF instead of the
-
Photoshop CS5.1 Printing
Hi - hope someone can help me - When I try to print, I get the following window - "There was an error opening your printer. Printing functions will not be available until you have selected a printer and reopened any documents" This occurred after I
-
Importing Captured Video from XSplit. Audio/ Video Out Of Sync
So, I have looked all over the Adobe site before posting this question. When I import video (regardless of using the file>import or dragging the file into Pr6 directly) the audio and video desync really really fast. I've seen some thins all over, but