Want to pass 2D integer array from VB 6.0 to LabView (v 8.0) DLL

I was able to pass 1D arrays from VB 6.0 to LabView 8.0 with no problem.  I checked the literature for help regarding 2D arrays and found
scant help unless it was for VB.NET, C or single dimensional arrays.  Thanks.
I wrote a simple test VB program to pass 2D arrays shown below after which I get a memory crash:
Private Declare Sub Test2D Lib _
    "C:\Documents and Settings\Owner\My Documents\builds\Test2DArray\Test2DArray\Test2DArray.DLL" _
    Alias "Test2darray" (ByRef varInArray As Variant, ByRef varOutArray As Variant)
Private Sub cmdStart_Click()
    On Error GoTo handle_error
    Dim intInArray(8, 8) As Integer
    Dim intOutArray(8, 8) As Integer
    Dim varInArray As Variant, varOutArray As Variant
    Dim i As Long, j As Long, k As Integer
    For i = 0 To 7
        k = i * 8
        For j = 0 To 7
            intInArray(i, j) = k + j
        Next j
    Next i
    varInArray = intInArray
    varOutArray = intOutArray
    Test2D varInArray, varOutArray
    Exit Sub
handle_error:
    MsgBox Err.Description, , ""
End Sub
In the Labview DLL I have a definition of the exported function call as:
void Test2darray(TD1Hdl * InArray, TD1Hdl * OutArray)
(in the Labview DLL I take the input array, add 1 to each of the elements and then stuff it into the output)

jd162,
The following discussing forum may help out:Pass array to "Labview 7" DLL in Visual Basic . Let us know if this helps out at all.
Chris C
Chris Cilino
National Instruments
LabVIEW Product Marketing Manager
Certified LabVIEW Architect

Similar Messages

  • Passing a integer array  client to server

    Hi
    Is it possible to pass integer array from client to server
    Through soap.
    Basically i want to pass this array buffer
    int[] buffer = new int[(int)len];
         for(int i=0;i<len;i++){
              buffer[i] = F.read();
              System.out.print(buffer[i]+ " ");
    Nams Thanks

    Yes, if the server is written to accept one.
    To create a server to accept one, create a service endpoint
    interface that has a method that takes a int[] as a parameter and
    generate the service from that by following the steps in the jaxrpc
    tutorial. Then generate the client from the generated WSDL.

  • Code for how to read an integer array from the command prompt...

    hello,
    Could anyone give me the code for how to read an integer array from the command prompt...its very urgent!..

    If you are using a recent version of Java (5 or later) you can use Scanner:
    http://java.sun.com/javase/6/docs/api/java/util/Scanner.html
    That page has some example code on it, too.

  • How do you pass an ActiveX Variant from an external application to LabVIEW?

    Background: I created a LabVIEW ActiveX server. I can access it with my external application (Matlab). I have a control variable in my LabVIEW executable. I want to use Active X to set the value of my control variable from my external application.
    Documentation: The only reference in the documentation for this task is in the Using ActiveX with LabVIEW in the LabVIEW 2009 help. It simply says "Use the variant control and indicator to pass data to or from ActiveX controls." I also went through all the ActiveX examples in the example finder and did not find any vis that passed variables using ActiveX.
    Questions:
    What should my control variable look like in LabVIEW? Should it be a refnum, a variant, or a data type? Does it have to be wired to a vi connector?
    Do I need to do any magic on this variable, such as change its properties?
    How do I pass the value from my external application to the variable in my LabVIEW executable?
    Thank you.

    Hello Lyn,
     The control variable should be a refnum and it would have to be wired to Automation Open with the correct reference.
    Here are some great examples of using ActiveX Server in LabVIEW
    LabVIEW Executable Used as ActiveX Server in LabVIEW
    http://decibel.ni.com/content/docs/DOC-9647
     Calling ActiveX Code from LabVIEW
     http://decibel.ni.com/content/docs/DOC-9073
    Andy Chang
    National Instruments
    LabVIEW Control Design and Simulation

  • How to pass an integer parameter from main report to subreport?

    I don't understand why this isn't working, but I have a main report with parameters:
    StartDate=datetime,
    EndDate=datetime,
    Program=text,
    ChartType=text.
    In this RDL, I have a chart with Action configured on this bar chart series.  The Action expression is:
    ="javascript:void(window.open('http://evolvssrs/ReportServer/Pages/ReportViewer.aspx?%2fIncoming%2fCensus+Report+Modifier&rs:Command=Render&rc:Parameters=true&StartDate=" & Parameters!StartDate.Value & "&EndDate=" & Parameters!EndDate.Value & "&Program=" & Fields!program_info.Value & "&ChartType=" & Fields!ChartType.Value & "','_blank'))"
    (program_info is a FIELD uniqueidentifier value matching the value of the Program parameter).
    So for this subreport, I have tried ChartType parameter as both integer and text, but each time i click on a bar from the main report, it opens a new window with ChartType field empty.  But the other 3 parameters: Start Date, End Date, and Program are
    all populated.  Why is it doing this and how can I fix please?
    Ryan D

    Hi Ryan,
    If I understand correctly, you have got empty in the ChartType parameter text box when you enable go to URL action.
    In my test, if the value we pass to the subreport which is not include in the parameter available values, we would get the empty text box. Please check if it has the specific ChartType values in the subreport parameter available values.
    Alternatively, please check if it has pass value to the subreport. We can add a parameter without available values and default values to check if it is can accept the Field ChartType Value from the main report.
    Hope this helps.
    Regards,
    Alisa Tang
    If you have any feedback on our support, please click
    here.
    Alisa Tang
    TechNet Community Support

  • I want to import digitised bit steam from n9010a spectrum analyser to labview platform how can it be done

    i want to intercept a fm signal and digitised it using n9010a sprectrum analyser and further import the digitised data for further signal processing using labview

    I'm not sure why you posted to this board instead of instrument control. By now, I would hope you simply used Help> Find Instrument Drivers to get what you need.

  • Passing array from one servlet to other

    I got values from jsp to servlet and i am storing them to
    String[] test = req.getParameterValues("testOne");
    Now i need to use redirect
    req.sendRedirect("/servlet/myapp?test="+test);
    Not working. Why?

    String[] test = req.getParameterValues("testOne");This code creates a String array with 0 or more entries depending on the number of "testOne=" parameters in the request.
    req.sendRedirect("/servlet/myapp?test="+test);The +test results in test.toString() on an array which will be some sort of class description, not the values in test.
    What are you trying to do here? Do you want the servlet to process the same request, in which case why not use forward instead of reDirect?
    If you must use reDirect and want to pass the test array to the servlet, you could add it as a session attribute. If you really insist on using the param string, try:
    String s = "/servlet/myapp?";
    for (int k = 0; k < test.length; k++) {
        s += "test=" + test[k];
    }This will pass as many "test" parameters as there were "testOne" parameters.

  • Passing an array from Java to Pl/SQL Procdures

    I am relatively new to the Java world and I am unable to pass back an array from Java back to the calling PL/SQL procedure. I have read many of the posts that deal with this issue and in specificly have viewed Ask Tom. My main issue is trying to get the data types matched up. I am able to return varchar2, numbers, and the like, but an array of filenames is not happening. I have tried a variety of "types" but unable to accomplish the task. Please help.
    I have my Java class basically defined as:
    public static oracle.sql.ARRAY[] getCollection(String directory)
                   throws SQLException
    { // provide a directory and get a listing of files
    File path = new File( directory );
    String[] list = path.list();
    return list;
    SQL Type and PL/SQL Procedure is:
    CREATE OR REPLACE TYPE PTO_FILE IS TABLE OF VARCHAR2(100);
    create or replace function get_dir_collection( p_directory in varchar2 ) RETURN PTO_FILE
         as language java
    name 'DirCollection.getCollection( java.lang.String ) return oracle.sql.ARRAY[]';
    /

    I know that it is not an ARRAY. It is however an "array" and I am attempting to map Java's String[][ to some "object" on the oracle side.  I have looked at the link you sited and was not able to find the data mapping.  I have found that mapping data types between different "languages" is some of the most difficult aspects of working with multiple languages.
    Any suggestions? Thanks

  • Passing Array from Class to JSP

    Hoi all,
    I am using MyEclipse Tomcat 4.1 and MySql
    I am trying to pass a 2D array from my struts framework action class to the forwarding action JSP.
    the Array is filled correctly, I check that by printing the values of the array as they are filled by my ResultSet into my console.
    but when I pass the Array to my JSP the value is null.
    I did the following in the class:
    request.setAttribute("Aray",aray);     and in the JSP i request the Attrebute as follows:
    String[][] ary =  request.getParameter("Aray"); Any help will be appreciated thx .

    request.setAttribute("Aray",aray);
    String[][] ary = request.getParameter("Aray");
    See the difference?

  • Loading 7831R memory with contents of Array from Host VI?

    Hi,
    Can anyone help - how can I load the contents of an array in the
    labview Host VI into the memory of the FPGA on the 7831 board? When I
    try to do this in a FOR loop, and index each element, it says that the
    array must be a fixed size for this target. How do I do this? I
    initialise the array in an earlier sequence frame, and am reading from
    a local variable.
    Thanks for any advice,
    Joe.

    In LabVIEW FPGA all arrays must have a fixed size, because they are allocated as static memory on the FPGA. As much as possible you should avoid allocating (large) arrays in your LabVIEW FPGA diagram since this will use a lot of FPGA space; about 1% of the FPGA for every 4 bytes of array data.
    Instead of using an array in your diagram you can use the Memory Read and Write functions which provide access to 16kB of memory which is separate from the FPGA.
    If you want to use an array as you described, you should create an array constant in your diagram or an array control on your front panel. To set the size, right click on the array index display and select 'Set Dimension Size'. Select the fixed size and specify the number of elements in the array.
    T
    o pass values to an array on the diagram use the 'Array Replace Subset' function on the existing array.
    If you have an array control on your front panel you can directly pass the whole array from your host application to the FPGA VI and do not need to pass individual array elements.
    Christian L
    NI Consulting Services
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • Sending arrays from Excel into Labview

    I want to send an array from Excel VBA into a LabView VI.
    The Excel example shows how to send individual numbers and return an array into Excel but not send an array.
    Everything tried sends blank arrays into LabView, which can then be modified in LabView and returned to Excel.
    A VBA code snippit that does not work is:
    Sub LoadData()
    ' LoadData Macro
    ' Keyboard Shortcut: Ctrl+l
    ' This is an example to demonstrate LabVIEW's Active-X server capabilities.
    ' Executing this macro loads a LabVIEW supplied example VI "Frequency Response.vi",
    ' runs it and plots the result on an Excel Chart.
    Dim lvapp As LabVIEW.Application
    Dim vi As LabVIEW.VirtualInstrument
    Dim paramNames(0)
    Dim paramVals As Variant
    Set lvapp = CreateObject("LabVIEW.Application")
    viPath = lvapp.ApplicationDirectory + "\examples\apps\freqresp.llb\DAK Frequency Response.vi"
    Set vi = lvapp.GetVIReference(viPath)   'Load the vi into memory
    vi.FPWinOpen = True                     'Open front panel
    paramNames(0) = "Foo"
    paramVals = Sheet1.Range("j1:j1000").Value
    Call vi.Call(paramNames, paramVals)
    This code generates an error - expecting 1D array or variants.
    However, if I supply the correct array, then LabView thinks it is empty
    'foo' is a cluster
    'Array' is a double array
    Neither work to receive the data

    Thanks for the reply but that approach will be difficult.  The problem to solve is relatively simple IF LabView could read arrays (it writes arrays easily).  Here is the problem:
    I want to convolute two large arrays.  I have written VBA programs to do this but they take too long - over 30 sec whereas the LabView version take <1 sec IF I could get the data into LabView.
    The convolute is part of an optimization program that goes though many loops so that it takes hours to run efficiently AND if I manually change cells in the spreadsheet, then it takes 30sec to come back as VBA does not respect clean cells (for some reason).
    I was trying to write a function in VBA to do this calculation via LabView rather than VBA.  One way to  do this is to write a text file in VBA and read in LabView, then pass the results back or maybe the clipboard as a buffer.  That is faster but clumsy.  You could also have LabView look for dirty cells and then do the calculation as the server rather than the client.  Again, time consuming and cumbersome.  I have written pure LabView code to do the curve fitting but prefer to use Excel as that is easier to incorporate and work with the data.   You can do convolute using FFTs but Excel does not do that correctly - they CANNOT make their FFTs into a function (VBA functions cannot modify cells in the spreadsheet but only return variables.  FFT modifies cells so cannot be called from a function, only a macro, which then needs to be updated manually).  Again, I can kluge VBA (real kluge this time) to make FFTs work as a function BUT prefer the LabView solution, if possible, as I am not sure the FFT will actually save time.
    I am not sure if the problem is LabView's fault or Excel's (2013) fault that the variables are not set-up properly.  LabView claims to be able to do this.  Again, you can pass single variables into LabView and read back arrays but try as I might, I cannot get arrays into LabView.
    Any help in sending arrays (maybe Labview expects a variant variable and needs to convert it somehow) would be appreciated.  Variants are suppose to be able to be converted automatically but maybe there is a bug in LabView (2010) that does not handle input variant arrays correctly (I have tried making them clusters, double arrays, ect).  LabView thinks that all the arrays sent by VBA are empty. If LabView modifies the same array, VBA sees that modification so that the addresses appear to be sent correctly i.e. the array "handle" is being sent to LabView or else it could not fill the array to send back to VBA.
    If ever this is solved, I will put on-line the solution for others as again marrying both programs will have advantages.  Others may find this interesting is marry LabView with Excel so that LabView does some of the heavy calculations that Excel has kluged. 

  • How to call a CString array from TestStand

    I have a C++ DLL that uses a CString array, CString myString[ ],  that I need to pass back to TestStand 4.0 for inclusion in my results database.
    In the TestStand module definition the parameter argument Description comes up as a CStriing pointer (CString*) instead of a CStringArray.
    When I put my array of strings into the Value Expression I get an error: Expected String, found Array of Strings.
    I have no trouble passing just a string pointer but that's not working either.
    Can someone help?
    Thanks,
    Steve S

    Hi Steve,
    I don't think that you can pass a CString Array from C++ DLL to TestStand 4.0 directly.
    But you can do it another way: concatenate all Strings by a delimit in your CString Array to build a new String,  then pass it to TestStand. In TestStand you can separate those Strings by the delimit, and rebuild a String Array.
    For example:
    // If this is your CString Array.
    CString myString[] = {"AAA", "BBB", "CCC"};
    // Build a  new String in your C++, and pass it to TestStand.
    char  *myNewString = "AAA~BBB~CCC";
    // Separate myNewString and build an Array in TestStand...
    Hope that can help you!
    Message Edited by My NI on 11-29-2007 11:34 AM
    Regards
    MY

  • How to pass the NEW row from a trigger to a procedure

    I want to pass all NEW values from a trigger to a procedure.
    I wish to use a %ROWTYPE or similar,
    and I want neither to assigne them nor pass them one by one.
    Any suggestion?
    Thanks in advance

    hi vittorio
    i have a solution but im very sure it is not exact answer to your question . it will definitely help you .
    create table temp_type as select * from emp where 1 = 2;
    create or replace procedure emp_ins(emp_row emp%rowtype) as
    pragma autonomous_transaction;
    begin
    insert into temp_type(empno,ename) values(emp_row.empno,emp_row.ename);
    commit;
    end;
    create or replace trigger emp_ins_trig before insert on emp for each row
    declare
    /*  empr emp_types.emprowtype%type;*/
    empr emp%rowtype;
    begin
      empr.empno := :new.empno;
      empr.ename := :new.ename;
    emp_ins(empr);
    end;
    /unfortunately , in oracle we dont have a facility to access the members of a record or recordset by their position
    Such facility is very much there in Visual Basic , similar programming tools.
    we can access the members of a recordset by the index position ( here index means the position of the field)

  • Passing a internal table from method

    Hi All,
       I am using Object Oriented Programming in my program.
       I want to pass a Internal Table from a method calling statement written in a start-of-selection.
       Can any one give me the syntax for
    1. Declaring a method with importing parameter as internal table.
    2. Syntax for Method Implementation
    3. Syntax for calling the method from start-of-selection.
    helpful answers are rewarded.
    Regards,
    Azaz Ali.

    Hi,
      Calling Method is similar to calling function Module.
    CALL METHOD cl_gui_frontend_services=>gui_download
       exporting
          filename    =
    IMPORTING
       FILELENGTH                =
      changing
        data_tab                  = <b>( this is ur internal table name )</b>*  EXCEPTIONS
       FILE_WRITE_ERROR          = 1.
    <b>In OO ABAP u avoid creating table with header line</b>
    Best way to call method is to use <b>PATTERN</b> Button  
    1) Click Pattern Button
    2) Select Abap Object Pattern
    3) Enter
    4) Select Call Method
    5) Enter instance name ( i. e  used for create object ) ( No need for static method like gui_download )
    6) Enter Class / Interface name
    7) Enter Method Name
    done.
    <b>passing value to method is similar to FM.
    Creating internal table for Method
    any TYPE ........SAY  TY_Intern
    Then Syntax Should Be
    DATA : OO_INTERNAL_TABLe type table of TY_Intern.
    pass this to the Method.
    Hope This will solve ur problem.
    Please Mark Helpful Answers</b>
    Message was edited by: Manoj Gupta

  • How to return array of unsigned integer pointer from call library function node & store the data in array in labview

    I want to return array of unsigned integer from call library node.
    If anybody knows please help me
    Thanks & Regards,
    Harish. G.

    Did you take a look at the example that ships with LabVIEW that shows how to do all sorts of data passing to DLLs. I believe your situation is one of the examples listed. You can find the example VI in the "<LabVIEW install directory>\examples\dll\data passing" directory.

Maybe you are looking for

  • Batch problem with 'BAPI_PRODORDCONF_CREATE_TT'

    Hi All! We are using function 'BAPI_PRODORDCONF_CREATE_TT' but not fully sucessfully. We call this function to make a completion confirmation with a goods movement. Right now we are doing some test trying to get the same results that if we use COR6N.

  • Wait for command prompt - Enter-PSSession

    Enter-PSSession -ComputerName ServerName Restart-Service DNS -PassThru Exit-PSSession I am trying to restart the DNS Server service on several remote machines using a foreach loop.  The problem is the the script does not wait until the command prompt

  • Help with Omega Infrared Temperature Sensor with USB Interface Model(s): IR-USB

    Hi, I am a beginner when it comes to labview and was wondering if the IR-USB sensor by Omega was compatible with LabVIEW and whether anyone has worked with them before in lv. I also want to find out whether the vi for this sensor is easily available.

  • Does the MacBook have the thermal paste "problem"?

    I'm really thinking about saving up my money to get a MacBook, but with all of the thermal paste "problems" with the MacBook Pro, I'm not sure if the MacBook has the same problems. Has anyone with a MacBook taken it apart and examined the thermal pas

  • Why won't my songs play in numerical tracks order?

    I have an album with about 30 songs on it, and some of those songs came from different sources. I changed all of the items on "Get Info" so that they would match, (album title, artist, album artist, composer, track number, disc number, compilation, e