Passing Array of Srings between Visual Basic and Labview dll

I have searched and searched for the correct way to pass an array of
strings between Visual Basic 6.0 and a Labview 7 dll. So far, I still
do not know how to pass the array. When I create the dll in LV, the
array of strings is presented as a string, not an array. I am familiar
with passing arrays of type double, but I really need to know how to
pass an array of strings. Any and all help is appreciated.
Bob

Hey Bob,
From what I understand, that can get kind of messy. You have to allocate the memory in VB in the format that LabVIEW expects (see the externalcode.h file in National Instruments\LabVIEW 7.0\cintools for details). Then pass a pointer to that location to LabVIEW. There are a couple of related examples online. They don't necessarily show how to pass an array of strings to VB, but they should show how to pass a string and an array. I hope this helps.
Using Microsoft Visual Basic to Call LabVIEW DLLs That Pass String Data Types
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B123AE0CB9B0111EE034080020E74861&p_...
Using Microsoft Visual Basic to Call LabVIEW DLLs That Pass Array Data Pointers
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3D9E556A4E034080020E74861&p_...
Regards,
Chris J

Similar Messages

  • How to make a link between Visual C++ and LabView?

    I want to use my labview program to read the data generated by visual C++ program to perform some control to digitial oscilloscope. I have read your homepage. I know it is using ActiveX to get everything done. However, I dont know where to get started!The data is just a simple number, 1 to 8. So what should I do right now? Where Should I start?
    thanks for helping me.

    Possible alternatives to ActiveX calls:
    If you program can save the data to a file, then you could read the file from LabVIEW and act accordingly.
    If the data is generated by a function that is in a .dll, you can make a call to the function from LabVIEW using the "Call Library Function".
    If you have the code of your C++ program, maybe you can work a CIN that will work directly from LabVIEW.
    There can be other alternatives.
    Regards;
    Enrique
    www.vartortech.com

  • What are the main differences between Signal Express and Labview?

    National Instruments provides a matrix so one can quickly compare the
    various versions of Labview but no comparison of Signal Express with
    Labview. Hence how does Signal Express compare with Labview? What
    are some of the things one can do with Labview one can't do with
    Signal Express?
    Howard

    hrh1818 wrote: Which version of Labview are you referring to? I don't consider the graphical version of Labview to be a full featured programming language. LabWindows/CVI is by a long shot a lot closer to being a full featured programming language than the graphical version of Labview.
    Howard,
    You clearly don't know what you are talking about. There is no "graphical version" of LabVIEW, there is just LabVIEW. Click on the article "Is LabVIEW a general purpose programming language?" written by the Jeff K. for some easy reading from a few years ago. It is all still true (except that object oriented features and recursion have been added in recent versions).
    One of the main points at this years NI-week was the discussion of how processor development is switching more and more to multicore designs  to improve performance because a simple boost in clock frequency is becoming more difficult. Linear, text based code is not well suited to take advantage of multticore design, while the dataflow based LabVIEW programming language automatically scales well to multiple processor cores, without any need to rewrite older code. I would say that only LabVIEW is futureproof in this respect. LabVIEW programmers are not wimps that are simply too stupid to write text based code. LabVIEW is not a toy language for people that don't want to learn a "real" programming language.
    LabVIEW is arguably the best programming language in terms of getting things done! I've never felt limited with LabVIEW and my programs often don't even have anything to do with data acquisition or instrument control. The difference between text based code vs. LabVIEW is like "DOS vs. Windows", "Radio vs. HD television". "Trilobyte vs. Homo sapiens" (sorry Putnam ). Text based code is monochrome, archaic and outdated and its linearity imposes unecessary constraints on the programmer that can only be (partially) overcome by wasting even more time throwing even more code at it.
    Sure, a seasoned text based programmer will initially have problems adapting to LabVIEW, just because you would need to adapt to and embrace the power of dataflow and not try to make a literal translation of the text code to LabVIEW, retaining old habits. If you get stuck, come back and ask here in the forum.
    You were looking for object oriented features and failed. All you need to do is a quick site search. All the information is out there. Just because you cannot find it in the first five sentences of the glossy brochure does not mean it does not exist. Maybe you want to read one of the application notes such as:
    LabVIEW Object-Oriented Programming: The Decisions Behind the Design
    In general, you should avoid judgement until you have all information. Your opinions seem quite biased and superficial and not really based on hard facts.
    Initially you asked about the difference between signal express and LabVIEW.
    hrh1818 wrote:
    > What kind of measurments do you want to do and what kind of requirements do you have?
    > You can also see for yourself and download evaluation version of both.
    No thanks, there has to be a better way to get an answer to my
    question than get involved in a two month study project.
    If you would answer the first question quoted above, we could certainly help you with the decision. Isn't that the main purpose of this thread?
    You can also contact your local LabVIEW Field Engineer to go over your requirements and help you make a decision. They usually know their stuff!
    Message Edited by altenbach on 09-02-2007 11:51 PM
    LabVIEW Champion . Do more with less code and in less time .

  • Passing arrays through multiple PL/SQL procedures and functions

    I am maintaining a large PL/SQL application. There is a main procedure that is initially called which subsequently passes information to other PL/SQL functions and procedures. In the end an error code and string is passed to PUT_LINE so it can be displayed. What I would like to be able to do is have an array that stores an error code and string for each error that it comes upon during going through each of the procedures and functions. This would involve passing these codes and strings from function to function within the pl/sql application. What would be the best way to implement this and is it possible to pass arrrays or records to other PL/SQL functions? Thanks.

    Here is one simulation ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.20
    satyaki>
    satyaki>
    satyaki>create or replace type n_array is table of number;
      2  /
    Type created.
    Elapsed: 00:00:07.10
    satyaki>
    satyaki>CREATE OR REPLACE PROCEDURE Get_Array(array_in IN n_array,
      2                                        array_out OUT n_array)  
      3  IS
      4  BEGIN 
      5    array_out := n_array(); 
      6    FOR i IN 1..array_in.count 
      7    LOOP 
      8      array_out.extend; 
      9      array_out(i) := array_in(i) * 2; 
    10    END LOOP;
    11  END Get_Array;
    12  /
    Procedure created.
    Elapsed: 00:00:00.89
    satyaki>
    satyaki>
    satyaki>Create or Replace Procedure Set_Array(myArray IN n_array)
      2  is  
      3    i   number(10);  
      4    rec emp%rowtype;  
      5    w n_array:=n_array(1200,3200);
      6    bucket n_array := n_array();
      7  Begin
      8    Get_Array(w,bucket);  
      9   
    10    for i in 1..myArray.count  
    11    loop 
    12      select *  
    13      into rec 
    14      from emp 
    15      where empno = myArray(i); 
    16      dbms_output.put_line('Employee No:'||rec.empno||' Name:'||rec.ename);
    17      for j in 1..bucket.count
    18      loop
    19        dbms_output.put_line('Commission Sub Type: '||bucket(j));
    20      end loop;
    21    end loop; 
    22  End Set_Array;
    23  /
    Procedure created.
    Elapsed: 00:00:01.33
    satyaki>
    satyaki>
    satyaki>select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          9999 SATYAKI    SLS             7698 02-NOV-08      55000       3455         10
          7777 SOURAV     SLS                  14-SEP-08      45000       3400         10
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-81       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       4450                    10
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       7000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-87       1100                    20
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
    13 rows selected.
    Elapsed: 00:00:00.28
    satyaki>
    satyaki>declare
      2    v n_array:=n_array(9999,7777);  
      3  begin  
      4    Set_Array(v);  
      5  end;
      6  /
    Employee No:9999 Name:SATYAKI
    Commission Sub Type: 2400
    Commission Sub Type: 6400
    Employee No:7777 Name:SOURAV
    Commission Sub Type: 2400
    Commission Sub Type: 6400
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.15
    satyaki>
    satyaki>Regards.
    Satyaki De.

  • Problems with visual basic and acrobat X

    Hello,
    In visual basic (excel), I had written a program in visual basic (excel) to open a pdf file on the local server.
    Before I updated to acrobat pro X, I had acrobat pro 8 on my pc.
    With the 8 I didn't had any problems to open the pdf-file.
    Now with the X version, it only opens the start window of acrobat x pro.
    Did they changed something in Xversion?
    Does anyone has an idea to solve this problem?
    Below you can find my visual basic code.
    Thanks in advanced !!
    Sylvie
    Code:
    Sub OpenPDF(bestand As String)
    Dim retval
    Dim sAdobeReader As String
    sAdobeReader = Chr(34) & "C:\Program Files\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe" & Chr(34)
    'sAdobeReader = "C:\Program Files\Adobe\Acrobat 10.0\Acrobat\Acrobat.exe"
    retval = Shell(sAdobeReader & Chr(34) & bestand & Chr(34), 0)
    End Sub
    Private Sub SelectedPDF()
    OpenPDF ("N:\11276.pdf")
    End Sub

    This is really a user forum, I think you need a developer forum... maybe SDK?
    http://forums.adobe.com/community/acrobat

  • Relations between Matlab structures and LabVIEW clusters

    I have a DLL created with Mathworks COM Builder, used as an ActiveX component in LabVIEW. Thus, I am able to have my Matlab functions inside LabVIEW. However, I have a problem regarding the pass of parameters between Matlab and LabVIEW.
    When the Matlab functions parameters are simple -DBL, DBL arrays, strings-, there is no problem. LabVIEW does the right translation. But I have not been able to pass a Matlab structure to LabVIEW, which counterpart I think it would have to be a cluster. To solve this situation I need to split the structure components and pass them separately.
    Does anyone know how to do it without the workaround?
    Thanks in advance and have a good day,
    spj

    Hello Tishu,
    1)       Can we use nested for loop in Mathscript node?
    1) Yes you can. Remember that loops should be avoided as much as possible in m-scrips. Most of the times you can use vectorization to represent same task.
    2)       Which one of these is feasible: 1) Matlab script node
                                                              2) Mathscript node
    2) What exactly is the "Feasable" question? Real time (see below) or nested loops (see above)
          3)  Is there any other way to interface between matlab and LV for real time signal processing?
    3) Real time is different depending the application. Some applications need ns or ps real time (RF appls) others need seconds delay. Real time means "determinism". That a task will execute in a know time with little jitter. Windows is not a real time OS therefore nothing in it will operate in real time. Can you tell us something about the signal your are processing (Audio, Image fps, Radar)?
          4)  Suppose X is 1D array (DBL) in Labview. And Mathscript code is as below:
    For i=1:inf,  4) Is this vector a valid one? inf = Inf which is different from 1/eps.
    Y= X-1;
    end
    Here X is input and Y is output.
    Such code does not produce output (Y variable) in real time processing.
    Does it wait till the FOR LOOP ends?  Is there any solution to such problem? 5) What is this suppose to produce?
    Let me know,
    yardov
    Gerardo O.
    RF Systems Engineering
    National Instruments

  • DateAdd(interval,number,date) Visual Basic to LabVIEW Time Stamp add 18 months

    Hi all,
    I need to match Visual Basic Cmd  =  DateAdd("m", 18, Date()) which adds 18 months to today's date.  When I use LabVIEW Time Stamp VI's at first I tried adding 1.5 years in seconds. but this did not match the VB generated method?  What method do  I use in LV to obtain the VB DateAdd("m", 18, Date())
    Example 'Add one month to January 31, 2000
    document.write(DateAdd("m",1,"31-Jan-00"))
    Output:
    2/29/2000

    Well this is how you do it. However, it doesn't seem to work with the month. There was a thread about this problem not too long ago. If you overflow the month in the date/time rec cluster (so it is greater than 12), date/time to seconds returns 0. Every other element works fine. You can add 1000 to the day and it will figure it out just fine. When this bug is fixed, this will work. Also, it might only be a bug in recent versions. I'm on 8.5 and it doesn't work right.
    I realize this isn't a great answer to your question, but as far as I know, this is the easiest way to do what you want and have LabVIEW handle all the work.
    Message Edited by Marc A on 10-03-2007 03:56 PM
    Attachments:
    Example_BD.png ‏2 KB

  • ActiveMovie Control,Translating ActiveX calls from Visual Basic into Labview

    Hello,
    I want to use DirectX to display a movie. In the attached file is a Visual Basic example
    which I tried to translate into Labview.
    To play the movie IMediaControl from ActiveMovie control type library Version 1.0 C:\WINDOWS\system32\Quartz.dll) is used.
    To display the current Position I tried to wire the IMediaPostion. But I have no idea how to implement this in the Block Diagram.
    After opening it the following message is shown.
    Error 3005 occurred at Automation Open: Object specified is not creatable in Play Movie Current Possition.vi
    Attachments:
    Play_Movie_Current_Possition.vi ‏48 KB

    Hello Joe,
    the Windows Media Player has a lot of overhead. I also found it difficult to deal with the different Versions.
    I want to display data in a graph and show the connected video frame in a separate window.
    I used the QuartzTypeLib because it is on every Windows Computer and is easy to code in VB.
    With one call I can start the video in Labview., but I find no way to wire the current position. I do not really understand how ActiveX is implemented in Labview. I attached a LV 7.0 vi. I hope you can open it.
    Tiemo
    Attachments:
    Play_Movie_Current_Position.vi ‏63 KB

  • Difference between java.exe and java.dll

    can some one tell me the difference between java.exe under bin directory of jdk and java.dll under bin directory of jre under jdk. and how to determine jre the application is using.How to locate istalled jres in windows registry

    can some one tell me the difference between
    java.exe under bin directory of jdk and
    java.dll under bin directory of jre under jdk.java.dll is the library containing the Java Virtual Machine. java.exe is the
    program you execute to run Java. It uses java.dll. The java.dll can also be used
    to invoke Java classes from other languages using the Java Native Interface (JNI), see
    http://java.sun.com/j2se/1.4.2/docs/guide/jni/index.html for more information.
    Steve Dever

  • Difference between actual ,basic and forecast dates

    hi,
    wat is the difference between actual start date,basic start date and  forecasted start date

    Ady,
    Can you give a little more info than this?
    Regards
    Gill

  • The suitable LabVIEW data type correspinding to the array of structure in Visual Basic ActiveX DLL

    Hi!
    I need to call a VB ActiveX DLL from LabVIEW. When I run my LabVIEW code, I always meet an error as:
    Error 1 occurred at Incorrect Function in T06.vi
    Possible reasons:
    LabVIEW: An input parameter is invalid.
    I have read the VB DLL code that defines the data type. It fills data to a structure, then puts this structure to the array, and sends the array of structures to the method.
    VB Code:
    For I = 1 To 31
    Set MyInputData(I) = New EM_nkd_DataPoint
    Next I
    With MyInputData(1)
    .Amplitude = 8.44
    .DataPointType = R_HW
    .DataSource = MEASURED
    .Wav
    elength = 409.56
    End With
    With MyInputData(2)
    .Amplitude = 91.60113
    .DataPointType = T_SUB
    .DataSource = MEASURED
    .Wavelength = 409.56
    End With
    ~~~
    With MyInputData(31)
    .Amplitude = 91.96825
    .DataPointType = T_SUB
    .DataSource = MEASURED
    .Wavelength = 657.43
    End With
    My problem is that I can’t find a suitable kind of data type in LabVIEW which is corresponding to this case
    Attached my LabVIEW code for reference.
    Many thsnks.
    TX
    Attachments:
    T07.vi ‏166 KB

    Hi,
    if you have a complete source code including EM_nkd_DataPoint class module, take a look inside in order to see data types for Amplitude, DataPointType, DataSource and Wavelength (probably for Amplitude and Wavelength is SINGLE). If this code is not available, maybe the author mentioned a type for T_SUB and MEASURED even if they are constants.

  • Passing array result set between Viewstack pages

    Hi, all.
    I want to use an array result in various Viewstack pages. So
    the main application run a RemoteObject call, gives the result to a
    function that makes the area. I then want to call the array result
    from other pages in the Viewstack. Is there a way to reference from
    the other pages? I cannot seem to do it. Thanks.
    I would add my code, but I cannot find the Attach Code thing
    they are talking about.

    Eric and Tracy,
    Thanks for these suggestions. I will try them. I think the
    real issue is knowing HOW to call back to the "parentApplication"
    (whatever that is. ;) I just learned something new, thanks).
    I do appreciate the more in-depth how-to's, having come from
    the procedural world of CF. Like many starting to use Flex, I sort
    of fell into this field, having no real background or formal
    programming experience and learning by example is really useful. I
    mainly did business development before getting into Flex
    programming.
    Like learning to talk in another country that also uses sign
    language and clicks in the vocabrulary, we have to learn a whole
    new vocabulary and even way of thinking about what and how we say
    things. Again, thanks for the patience and time.
    Gary McNeel
    Struggling Flex Coders Anonymous Member Since 2007

  • Difference between Word basic and DIADEM script

    I'm trying to program some things in Word via a DIAdem script. One thing I want to do is move to the end of the document. When I turn on the macro editor in Word and press End to move to the end of the document, the Word basic editor comes up with this
    Selection.EndKey Unit:=wdStory
    If I enter the above in my DIAdem script (adding Word. in front of it) DIAdem of course doesn't like the "Unit:=wdStory" part. When I execute
    Word.Selection.EndKey
    it only goes to the end of the line.
    There are some other commands I want to do that also have qualifiers like this. How do you tell DIAdem script about the qualifier?
    George

    George,
    Word (and Excel, Powerpoint) come with a large number of constants like the one you used. When you want to use more of them, I recommend to include the type library which comes with those products. DIAdem makes this very easy : Go to the menu in SCRIPT : "Script"=>"type library overview". From the dialog you select the product your are interested in e.g. "Microsoft Word 11.0 Object Library".
    Then click the button "Clipboard". This generates a little code snipped. Goto to your script and insert from clipboard (ctrl+v). What you will see is something like this :
    ' Microsoft Word 11.0 Object Library
    ' D:\Programme\Microsoft Office\OFFICE11\MSWORD.OLB
    Call AutEdTypeLibAdd("00020905-0000-0000-C000-000000000046", "8.3")
    If you now add a line like "MsgBox("wdStory : "&wdStory)" you will teh result you expecct.
    Andreas

  • Difference between the Matlab and LabVIEW Hann (Hanning) functions

    Hi All,
    I'm hoping someone out there can satisfy my curiosity. I have been porting over some code from Matlab to LabVIEW and came accross a difference in the two implementations of the Hann function. Essentially:
    LabVIEW has array length = n
    http://zone.ni.com/reference/en-XX/help/371361J-01​/lvanls/hanning_window/
    Matlab has array length -1 = N.
    http://www.mathworks.co.uk/help/signal/ref/hann.ht​ml
    (where n= N in the two implementations)
    As I'm not very clued up on signal processing I was hoping someone could explain why there is a difference in implementation and why array length was chosen for the LabVIEW implementation. According to wolfram the parameter a is full width at half maximum:
    http://mathworld.wolfram.com/HanningFunction.html
    http://mathworld.wolfram.com/FullWidthatHalfMaximu​m.html
    Is the difference just due to the interpretation of what this value should be?
    I've attached a modified version of the window comparison example to illustrate the diference.
    Thanks,
    Attachments:
    Window Comparison from example.vi ‏32 KB

    ^N wrote:
    LabVIEW has array length = n
    Matlab has array length -1 = N.
    Could part o the confusion be due to the fact that LabVIEW arrays start with index zero and matlab arrays start with index one?
    I'll look at your code later...
    LabVIEW Champion . Do more with less code and in less time .

  • What is the relation between photoshop cs4 and atkogl32.dll?

    Hi.
    Some times -not always- my photoshop cs4 Extended Edition, crash.
    However, if I disable OpenGl function, photoshop works perfectly.
    Of course: I have up to date the graphic card drives.
    Every crash, appears a magic word:atkogl32.dll.
    Uncle google says that atkogl32.dll is relating with Asus.
    Could you please help me?
    Thanks in advance.
    My graphic card: Asus EAX1650XT (256mb).
    MOBO: Asus P5W DH Deluxe.
    OS: Windows XP professional edition service pack 2.
    Processor: Core 2 duo E6320.
    Greetings from México.

    Hi, freeagent.
    Thanks for answering to me.
    Do you advice me to throw out all 3rd party plugins?
    Well... I only have 3: niksoftware color efex Pro, Viveza and Grain surgery.
    They work very good.
    Another option?
    I am sad...
    PS cs4 is an amazing program. It opens itself in 3.4 seconds.
    Of course: it is faster than cs2...
    Thanks in advance.

Maybe you are looking for

  • Ipad 2 keeps freezing - hardware problem?

    I have an iPad 2  (Model MC979LL/A) running IOS Version 7.11 (11D201) and the screen keeps freezing. I have pretty much exhausted all the good advice regarding hard resets with the two buttons, resetting from settings, and I have used iTunes to do mu

  • Vga-dvi connector

    Just installed a new graphics card that has a DVI port and a VGA port. I need to get two DVI Apple monitors into the computer. Can somebody point me to the correct adapter? I looked at some adapters on Newegg and some people were having problems with

  • Web Logic installation for Window NT

    Hi, I can not install the WebLogic into my computer by any way. Can Some one show me the step by step how to install web logic. Thank yiou very much Dan Nguyen

  • Itunes Match - 2nd Computer/Library

    I have bought and set up itunes match on a macbook pro. I am now on a second laptop - a macbook air. I emptied the itunes library from the air and then turned on itunes match. playlists and their songs from the macbook pro's library have appeared, bu

  • Error in JSP : Ambiguous class

    In application i am getting following error :- Error in JSP, Ambiguous class: java.beans.Statement and java.sql.Statement here java.beans package is not imported still it gives error. if i write java.sql.Statement then it works fine. Code is as follo