Matlab ActiveX control with DIAdem

I have successfully used DIAdem to transfer data back and forth with Matlab using Active, as well as run Matlab scripts. However, I would like to be able to see the Matlab command window (errors, warnings, etc.) as the script is running. Also, I have found that when having DIAdem open a Matlab .m file (using the NI files from the support website), variables that are 1 x 1 in size are not retrieved by DIAdem and in addition, some variables get a _1 etc. tagged onto the end of them. Any help would be great. Thanks.

Hello Justin,
if you use the little ActiveX control we provided, the MATLAB command window is visible once you connect to MATLAB. If you run a script nothing happens in this window because echo is "off" by default.
Use the "Execute" method to send "echo on all" before you execute the M-script
The GetChannel method is optimized to transfer array from MATLAB to DIAdem and doesn't accept single variables. There is a work around you can use to retrieve single variables from MATLAB :
You can use "GetCharVar" which is a method of the ActiveX control to retrieve a (single) character variable. If your variable is of a different type, please use the MATLAB function num2str to convert it before you retrieve it.
Here is an example :
' load a file..
Call oMatLabM.Execute("load D:\Source\scriptlibrary\Test\ML_SingleRow.mat")
' convert variable A to string :
Call oMatLabM.Execute("zzz = num2str(A)")
' retrieve it :
myVar = oMatLabM.GetCharVar("zzz")
' show it
MsgBox(myvar)
You may find it helpful to list all variables together with type and dimension. Please refer to the little script I have attached which shows how to list all variables in the current MATLAB workspace
Let me know if you need more details...
Attachments:
MATLAB_List_Workspace.VBS ‏2 KB

Similar Messages

  • Matlab ActiveX control from Diadem don't work

    I tried to transfer data from Diadem to Matlab as discribed in the KnowledgeBase 2QUAUTZL: Running MatLab M Scripts from DIAdem, transferring data between MatLab and DIAdem.
    I can only open a Matlab command window, but can't assign a variable to the Matlab workspace.
    Any help?
    Ralph Schmidt

    Hello Ralph,
    have you registered the "Matlab-DIAdem-Connectivity" yet? To do so:
    Detach ScriptLibrary.OCX in to the DIAdem directory and register it through regsrv32, either by pressing “Windows R” or “Start\Run” to bring up the run menu. At the Run prompt type:
    For Windows 2000 & NT
    c:\winnt\system32\regsvr32 "c:\program files\National Instruments\diadem 8.10\ScriptLibrary.ocx"
    For Windows Xp
    c:\Windows\system32\regsvr32 "c:\program files\National Instruments\diadem 8.10\ScriptLibrary.ocx"
    This will register the ScriptLibrary.ocx on your computer.
    You'll find the file here:
    http://digital.ni.com/public.nsf/websearch/1706BA4C65A8533686256C630062DD03?OpenDocument
    Kai Kratt

  • Integrating custom ActiveX control with SapGUI

    Hi everybody
    I'm in the process of writing a custom MFC based ActiveX control written in C++ that we want to use in a product. I am currently at the point where I can instantiate the control and interact with the various methods that it exposes but I have a problem integrating the control more tightly with the SapGUI e.g. change of colors, fonts etc.
    I want to make the control to reflect the user changes when the user modifies any settings of the SapGUI. I've tried catching various events that are exposed by some of the dictionary classes such as cl_gui_props_consumer=>color_change/global_prop_change and cl_gui_resources=>resources_changed but these events only fire in my control once the PAI of the client program that encapsulates the control fires which is hardly appropriate since it means that the control will have to wait for user input before it will change reflect any changes in user settings.
    I've written a test program for my control and when I change my SapGUI colors the rest of the controls etc on the screen do change color but my control only change color once I've performed some action that fires the PAI. Personally I think the controls written by SAP intergrates with the SapGUI through some interface that is called behind the scenes by the SapGUI since the GUI will have some way of knowing the set of ActiveX controls instantiated inside it  and I cannot find any event in the ABAP controls framework (e.g. CL_GUI_OBJECT, CL_GUI_CONTROL) that will allow this type of integration. I'll be digging for the answer but any suggestions will by greatly appreciated.
    Thank you in advance for any help.
    Kind regards
    Ettienne Hugo

    Hello Ettienne Hugo,
    To get the SAP GUI Theme or font changes events you need to add your MFC application or ActiveX MFC dll into u201CSAP Configuration->Application Tab->Addu201D and u need to call the functions SapHookInit and to stop getting the change events u need to call SapHookExit.(sapfhook.dll provides these functions)
    I tried with exe, never tried with ActiveX MFC dll/ocx. With EXE it works.
    Thanks and Regards,
    Ashwini

  • MapPoint ActiveX Control with Labview 7.1

    I am looking for a basic example on how to integrate a MapPoint ActiveX control into a Labview vi so I can pull up maps at a given set of lat-long coordinates with zoom in and out capability.   I'm new to Labview and activex container use and have not previously attempted to program with MapPoint, but that is what I have to work with.  Not finding discussions on MapPoint use with Labview, at either MS site or here, so am looking for assistance to get me started.  Using Labview 7.1, MapPoint 2004 and Windows XP.

    Hi,
    I'm afraid I don't have any experience with MapPoint, but some of the other members might. If so, it would be great if they could post any code they may have...  
    As a general rule, programming ActiveX is a little tricky since properties and methods aren't always documented well. Furthermore, the ActiveX hierarchies for a particular application can change from revision to revision. This is why programs using activeX to interface with Word or Excel have problems with different versions of Office. If you have to use Map Point, you may want to check MSDN for any information they may have. You may also want to check out the ActiveX examples in the Example Finder by searching for ActiveX. They should give a general understanding of how ActiveX programming is done on the LabVIEW side of things.
    If you can use a web based application, it might make your life a little easier. You can specify lat long coordinates in Google Maps very easily. Im attaching a simple application that does this for you. Just enter the lat and long in decimal format and hit run. The resulting map will show up in the container on the front panel and you can pan or zoom to your heart's content. I hope this helps. Good luck with your application and happy holidays!
    Regards,
    Chris J
    Message Edited by ChrisJ on 12-20-2005 05:00 PM
    Attachments:
    lat long example.vi ‏33 KB

  • Control with DIAdem

    My Problem: I´m brand new user of DIAdem and I don´t have no experience with controling. I was at a basic DIAdem training, but that was 6 months ago and was focused more on "measuring/analysing", than controling!
    (and i doubt, if is DIAdem the right tool for our use ...... :-)) )
    The Idea -> Control of six pneumatic valves, XX time a day.
    I have no idea, how I can start ! I think the "controling script" will be very simple: We have six chanels A/D, we want to give an impulse ( for xx seconds, to tight the magnetic valve ). And this on 20 different times. e.g. 00:00 p.m., 00:10 p.m., 05:00 a.m., and so on .... Is DAC the right tool to do this ?! I think it´s no so easy to help me with this information, but maybe I ´ll find a DIAdemCRACK in the Web. Th
    anks !

    Hello Mr Rimblock,
    to realize a controlling task like yours it is most convenient to make use of the Script DAC driver. It allows you to call a VBS routine within a DAC scheme. The german DIAdem Basics course contains an optional example using the driver for GPIB communication with an instrument.
    Place DAC and VBS into the same folder and open the script. It contains 2 tables with time schedules (for 2 valves). Adjust the schedules, save the script and start the scheme. The output of the script dac block should be 1 if the valve shall be closed and 0 if it should be opened. You can adjust the time resolution by changing the tact of the scheme and adjusting the tolerance parameter in the script.
    Even though the program might not be doing exactly what
    you need, I hope you can use it as a starting point for your development.
    Ingo Schumacher
    Application Engineering
    National Instruments
    Attachments:
    schedule.VBS ‏7 KB
    schedule.DAC ‏7 KB

  • Activex Control with Office 2003

    Hi,
    I have an application where i need to export data to MS Word for reporting purposes. Thing is it works fine with Word 2000, but when i tried it on a Word 2003 system, the 'Table population' code gives me an error. I am reporting a data table, where I show all the results of calculations. any ideas on fixing this one?
    anand

    Hi Anand,
    Have you tried running one of the sample applications that come packaged with LV 7.1? In particular, try running the example titled "Sample Report (Word).vi". It uses the high level VIs to create a Word Document, including a table that is populated with data. If that works, I would look into comparing that example with your code and see what they have done differently.
    Jeremy L.
    National Instruments
    Jeremy L.
    National Instruments

  • Problems with automation open for activex control

    Hi,
    I want to open an ActiveX Control (.ocx-file) with the Automation Open function. This .ocx file was successfully registered by using regsvr32.
    The VI is working fine after using Automation Open and all the contained classes are accessible.
    However, after saving the VI and opening it again the error 2147221164 appears and the program failes - referencing the object new at the Automation Open functions solves the problem, but only till the next reopening of the VI.
    Hope somebody has a solution for this "instability"... 
    Sorry for bothering and thanks for any help!!!

    Hi smercurio_fc,
    originally i had a dll written in c++ which contained classes - i wrapped this in a activex control to have access via labview. Im calling the activex control with the automation open function in same VI in which i am also using property nodes and invoke nodes to have access to the classes and methods...
    But as i told before, it happens that Automation Open fails, when starting the VI again after closing(saving), even so it was working perfectly fine before...
    Thanks for your response... 

  • How to create ActiveX Control in LabWindows/CVI 2010

    I have LabWindows/CVI 2010 Full Development System (Debug Only) installed on a stand alone PC with Windows 7 (64bit).  Also I have Matlab (R2011a) (also 64bit) installed on this PC.  I tried to use "Create ActiveX Controller" under ""Tools".  I can locate the "Matlab Application (version 7.12) Type Library" in the ActiveX Controller Wizard. After click "next", I got a message "The Type Library is not intended for use on Win32".  My questions are:
    1) Is my LabWindows/CVI 32bit or 64bit?
    2) How to create my Matlab ActiveX Control?
    Thank you.

    Hi JGS,
    It means that you cannot use 64 bit libraries in CVI ti create Activex controls since CVI is a 32 bit application. You can however create 64 bit dlls, executables and static libraries. Here is a link to some information:
    http://zone.ni.com/reference/en-XX/help/370051T-01/cvi/programmerref/creating32bitappsversus64bitapp...
    Regards,
    Perry S.
    Applications Engineer
    National Instruments

  • Problems using ActiveX controls

    Hello all,
    I bought a set of ActiveX controls provided with a installation routine.
    Using those controls within LabView after installing them were no
    problem, but for distribution purpose I have to install those ActiveX
    controls manually.
    So I tried to do it on a separate computer by registering the ActiveX
    controls with regsvr32 [regsvr32 ]. But the attempt to
    start a LabView program where these controls were embedded ended with
    the error message "error opening document" (ole_lv5container) and "error
    510 occurred while loading ActiveX control ..."
    I'm working with Windows NT 4.0 and LabView 5.0f2.
    Does anyone know, what I made wrong?
    Bye, Alexander
    Sent via Deja.com http://www.deja.com/
    Before you
    buy.

    Hello all,
    I bought a set of ActiveX controls provided with a installation routine.
    Using those controls within LabView after installing them were no
    problem, but for distribution purpose I have to install those ActiveX
    controls manually.
    So I tried to do it on a separate computer by registering the ActiveX
    controls with regsvr32 [regsvr32 ]. But the attempt to
    start a LabView program where these controls were embedded ended with
    the error message "error opening document" (ole_lv5container) and "error
    510 occurred while loading ActiveX control ..."
    I'm working with Windows NT 4.0 and LabView 5.0f2.
    Does anyone know, what I made wrong?
    Bye, Alexander
    Sent via Deja.com http://www.deja.com/
    Before you
    buy.

  • Can we get the full command and syntax list for the DIAdem - Matlab ActiveX Interface?

    Hi,
    I am trying to utilize the DIAdem - Matlab Active X interface to open files for analysis in Matlab.  In order to do that, I need to pass a string from DIAdem to Matlab.  This does not work with the PutChannel function, since that only seems to work with doubles.  I noticed that ScriptLibrary.ocx contains many functions that are not described anywhere, such as 'PutCharArray'.  Any chance that we could have this list posted with the other info on this page:
    http://digital.ni.com/public.nsf/allkb/1706BA4C65A8533686256C630062DD03

    Hi Matt,
    This ScriptLibrary.ocx is not longer a supported approach for interfacing with MatLab.  The preferred method now is to directly use the functions exposed by MatLab's ActiveX server, along with the "ChnToVariant()" and "VariantToChn()" commands in DIAdem.  You can get an idea of this approach by reviewing the following example that ships with DIAdem:
    "Communicating with MATLAB"
    Unfortunately, this example does not show how to pass string values back and forth (though it would likely work to pass a string channel).  Whether this is possible will depend on the functions MatLab makes available in its ActiveX server to send or receive string scalars or vectors.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • ActiveX controls disappear when VI is loaded in a Sub-Panel with Start Modal Dialog usage

    Hi,
    I have a subpanel in a VI (VI1) in which another VI (VI2) is loaded. VI1 is used as a module for an Action step in TestStand. VI2 has ActiveX controls like ExpressionEdit and Adobe PDF reader etc. VI1 loads VI2 in a sub-panel and calls Start Modal Dialog.vi. I have set 'Show front panel when called' to true for VI1 so that the VI pops up when the sequence is run. When the sequence runs and when the Start Modal Dialog VI is called from VI1, all ActiveX controls in VI2 (loaded in the sub-panel) disappears. Here is the screenshot of the frontpanel of VI1 when the sequence is run:
    This problem occurs in TestStand 4.2.1, TestStand 2010 and TestStand 2010 SP1 (as far as I have tested. May occur in older versions too). In the attached file, VI1 is 'ExprEdit Test.vi' and VI2 is 'SubpanelLoad.vi'. The attached sequence is developed in TestStand 2010 SP1.
    How can this issue be solved?
    Thank you,
    Ganesh Kumar
    Solved!
    Go to Solution.
    Attachments:
    Subpanel Load ExpressionEdit problem.zip ‏23 KB

    Hi,
    An update on this issue: I tried changing the order of loading the VI in the SubPanel and the start modal dialog. I called start modal dialog and then loaded the VI (VI2) in the SubPanel. When I ran the sequence, the activeX controls did not disappear (I was pretty sure that the ActiveX controls in VI2 would not disappear since I am calling Start Modal Dialog before loading the VI in the Subpanel). Then I just changed the sequence of operations back to the previous order (loading the Subpanel with the VI and then calling the Start Modal Dialog). When I ran the sequence, the activeX controls where still displayed. But when I ran the sequence with the VI1 backup (that I had taken before making all these modifications) the activeX controls were not displayed. I a nutshell, I now have 2 versions whose codes are the same. But when I run the sequence with action steps for these VIs, the activeX controls disappear when the unmodified backup VI runs and does not disappear when the modified VI is run. I have attached the files that I used along with the sequence file. The details are as follows:
    ExprEdit Test (Not Working).vi - The unmodified backup VI for which the ActiveX controls disappear.
    ExprEdit Test (Working).vi - The modified VIs in which the ActiveX Controls do not disappear (But same code as ExprEdit Test (Not Working).vi).
    ExpreEdit Test.seq - The sequence file containing 2 action steps one each for theabove mentioned VIs.
    SubpanelLoad.vi - The VI that contains activeX controls and is loaded in the SubPanel.
    Note that the sequence is created in TestStand 4.2.1.
    Thank you,
    Ganesh Kumar
    Attachments:
    Subpanel Load ExpressionEdit problem.zip ‏36 KB

  • ExternalInterface in C# form does not work with debug ActiveX control

    Hello,
    I have a C# form that is a container for the Flash ActiveX
    control. Everything works find as far as communication between the
    two (container and Actionscript) if I use the release version of
    the ActiveX control. If I use the debug version, the container does
    not receive call events. Obviously I need to be able to debug both
    the C# and actionscript code simultaneously. I have searched this
    forum (and others) for any insight, but nothing glares out at me.
    Could this possibly be a security issue?
    Brad

    I thing I have a solution for you. I created a note on it end of November (unfortunately, our systems have not replicated it to the outside yet). Here is the content of the note:
    Symptom
    Using Visual Studio .NET, database logon code is not recognized.
    Crystal reports Viewer database logon parameter screen prompts for login.
    This symptom is only observed when using Crystal Reports 2008 Service Pack 2.
    Crystal Reports 2008 with Service Pack 1 works as expected.
    Reproducing the Issue
    Use Crystal Reports 2008 SP2 to create a report with dynamic parameter(s)
    Use the following code from the Crystal Reports SDK for VS .NET
    Dim crDatabase As Database
    Dim crTables As TablesDim crTable As Table
    Dim crTableLogOnInfo As TableLogOnInfo
    Dim crConnectionInfo As ConnectionInfo
    crReportDocument.Load("<path>")
    crReportDocument.Refresh()
    crConnectionInfo = New ConnectionInfo()
    With crConnectionInfo
    .ServerName = "<New Server Name>"
    .Password = "<password>"
    End With
    crDatabase = crReportDocument,Database
    crTables = crDatabase.Tables
    For Each crTable In crTables
    crTableLogOnInfo = crTable.LogOnInfo
    crTableLogOnInfo.ConnectionInfo = crConnectionInfo
    crTable.ApplyLogOnInfo(crTableLogOnInfo)
    Next
    CrystalReportViewer1.ReportSource = crReportDocument
    The above code works with Crystal Reports 2008 SP 1
    Resolution
    Add .DataSourceConnections(0).SetConnection to the code as follows:
    For Each crTable In crTables
    crTableLogOnInfo = crTable.LogOnInfo
    crTableLogOnInfo.ConnectionInfo = crConnectionInfo
    crTable.ApplyLogOnInfo(crTableLogOnInfo)
    Next
    ''This is the line of code to be added ****
    crReportDocument.DataSourceConnections(0).SetConnection("Sever Name", "Database Name", "Use ID", "Password")
    CrystalReportViewer1.ReportSource = crReportDocument
    The issue has been submitted for a resolution.
    Tracking number is ADAPT01333806.

  • I need a little help help with the Spreadsheet 9 ActiveX control

    Here's the situation: I want to import data from an Excel file to the MS Office Spreadsheet 9.0 ActiveX control on the LV front page. I can retrieve the data just fine but I can't get it to display in the control on the front page. I can select a range and when I try to write to the Value property I find that I cannot. The problem seems to be the Value property itself cannot handle 2-D data arrays. I can select a 2D range and write a single value which gets written to every cell in the range but when I read the data I get only the first cell in the range and an error if I try to caste the Variant output to a 2D array.
    I've noticed a Value2 property for the range when actually working with Excel but I haven't been able to determine where or if it exists for the Spreadsheet 9 control. I've attached a little test program to better show what I'm experiencing/talking about. Anyone have any suggestions on this? It seems like it would be possible or else why have the control there but I haven't found a way around it. Thanks in advance.
    Gary D
    Attachments:
    spreadsheet 9 test.vi ‏41 KB

    Jack J. wrote:
    Hey Gary,
    What version of MS Office does the 9.0 ActiveX control come with. I have version 11.0 here. I could get your program working on my computer but I had to reinitialize the activex control to the 11.0 control. I also had to reselect the properties. All the properties are essentially the same except Value. In this ActiveX version, I see the Value2 property (the Value property does not exist). And your method of reading and writing to the Value2 property handles 2D arrays.
    If you can tell me what version of Office you are using, I will try to find a computer with that version and try your program.
    Jack J.
    Applications Engineer
    National Instruments
    Most of the computers have Office 2000 which uses the Value property and the Spreadsheet 9.0 control. I too have been able to duplicate it ona computer with Office 2000 (Spreadsheet 11.0). I think it may just be a functionality of the Excel version though for some reason if I use Excel and go through the song and dance with the methods and properties, I get to the Value2 property.
    After writing that it seems weird that using Excel properties and methods gets me to the point where I can select the Value2 method and read/write accordigly, but with the Spreadsheet 9.0 control (which, I assume is simply embedding Excel in the app) I get to a different set of properties. Perhps Spreadsheet 10 (or 11) is on the computer but not showing up? That's the only sensible conclusion I can come to, though it seems weird for it to not show up on multiple computers which effectively kills that idea anyway.
    Anyway. thanks for any help you can provide.

  • Unable to view external webcam content.  I'm using IE11 with Windows 7 64 bit.  I've tried deactivating Activex control, tried different browsers etc, tweeked the tools for trusted sites etc, but am totally stuck. I know the cams are working as i can view

    Unable to view external webcam content.  I'm using IE11 with Windows 7 64 bit.  I've tried deactivating Activex control, tried different browsers etc, tweeked the tools for trusted sites etc, but am totally stuck. I know the cams are working as i can view them on mobile phone via puffin browser.  I can play Youtube videos etc just fine. So why not the webcam?

    First, confirm that ActiveX Filtering is configured to allow Flash content:
    https://forums.adobe.com/thread/867968
    Internet Explorer 11 introduces a number of changes both to how the browser identifies itself to remote web servers, and to how it processes JavaScript intended to target behaviors specific to Internet Explorer. Unfortunately, this means that content on some sites will be broken until the content provider changes their site to conform to the new development approach required by modern versions of IE.
    You can try to work around these issues by using Compatibility View:
    http://windows.microsoft.com/en-us/internet-explorer/use-compatibility-view#ie=ie-11
    If that is too inconvenient, using Google Chrome may be a preferable alternative.

  • My version of Macromedia Flash ActiveX Control isn't compatible with my version of Windows

    I am trying to use a new copy of Camtasia Studio 3, and I keep gettiong the error message that my version of Macromedia Flash ActiveX Control isn't compatible with my version of Windows and that I should ocntact Adobe for support. So here I am.
    I am running Windows7 64bit, and it's a brand new computer so I know that there aren't tons of legacy installations or Flash players on it. This page http://helpx.adobe.com/flash-player/kb/find-version-flash-player.html tells me that I have Flash Player version 11.4.31.110 installed but that I should have 11.4.402.287 installed. But I have installed the latest Flash player from the Adobe site (twice!) and it never gives me an option for 11.4.31.110 vs 11.4.402.287.
    I am using Chrome and Flash is working fine in my browser: It's only Camtasia that isn't working well.
    Thanks!

    Hm, I assume you mean Camtasia Studio 8?
    Check the chart on the page you linked. You'll see that the version you have installed is in fact the latest version for Chrome. They haven't updated it beyond that. Each browser engine has its own latest version of flash. IE and Mozilla are 11.4.402.287.
    Aside that, there's no reason Camtasia should be requiring you to have that version of flash. Make sure when you're publishing your content that you don't check off any options to "require the user to have the latest version of Flash". You should also (if possible in your project) try to target MP4/HTML5. Check any HTML being generated with it (hopefully using SWFObject) and check for the version checking code. There is absolutely nothing Camtasia needs to require the latest version to do. I've been using Camtasia (TechSmith codec mostly) for screen recording since version 2.

Maybe you are looking for

  • How do I organize or sort nokia web browser's book...

    How do I organize or sort nokia web browser's bookmarks? There are quite many bookmarked pages and scrolling through them is a pain, because they are sorted by oldest to newest. How bookmarks can be sorted alphabetically? Thanks

  • Textedit.app cannot export metadata to PDF

    Hello, I've create RTF document in TextEdit.app (OS X 10.8.3), fill my own Properties of this file (File->Show Properties) and export to PDF via File->Export as PDF- RTF file contain Properties: Author, Organisation, Copyright, Title, Subject, Keywor

  • Focus In Jframe

    I am trying to have a key listener inside a Jframe which will work no matter where the focus is, currently it only works when the focus is at certain locations. How can I do this, here is where I create the frame and components and attempt to get the

  • No startup sound

    i have an 2gzh intel macpro. I've heard no startup sound for about 12 months. When I reset the pram I hear the chime, but any startup after that is silent. I'm running 10.4.11 - I'm thinking of getting a new HD and upgrdading to 10.6 in any case, but

  • I keep getting popups about updating my browser to firefox 5 then 6 and now 7... Is this a scam?

    I am getting popup boxes (no firefox or mozilla logo) saying Firefox beta 5 (at first) then beta version 6, and now beta version 7 are available and asking me to download and install them. I suspect a pfishing or worse, but some of the functions in m