For the complex data type, how to generate the Dll with compatible interface to C/C++

Hello

I used the Labview FPGA module to develop test equipment. Now, I need to write a driver that is to be a Dll with compatible interface to C/C++ for this equipment. So that my client who is familiar with C/C++ can call the driver without any study on labview. But I had a few problem on how to convert labview for C/C++ data complex data type. To clearly explain to my question, I have attached a simple example. (see attachment) I try to generate a Dll for the attached example VI and get the the function prototype at the head of the files as below:

' void OpenFpgaReference (LStrHandle * RIODevice, TD1 * errorIn, LVRefNum * FPGAVIReferenceOut, TD1 * errorOut).

As you have known, the type of data "LStrHandle * RIODevice" and "LVRefNum * FPGAVIReferenceOut" Labview data format are. C/C++ do not have this kind of data type and can not reconige it. As a result, I can't call the Dll of C/C++ programming language. How to convert these two data type of labview for the C/C++ compatible data format, and then build the Dll? Anyone know about this?

The answer is really apprecaited! Thank you in advanced.

Ivan.Chen wrote:

As I found in the following article:

http://digital.NI.com/public.nsf/WebSearch/FB001AA027C8998386256AAD006C142D?OpenDocument

LVRefNum is the name of resource of LabVIEW VISA or refnum, and "it is impossible to convert LabVIEW VISA name of resource or refnum VISession valid ID."
This means that external code modules can not access & control the session VISA which is open by labview. But for my purposes, I will not attempt to access this VISA extenal code(C/C++) session. I just hope that save this session VISA in the external code once I opened it in Labview dll; and pass it to the labview dll when needed. While I have not need to login again when I need to control the device. Is it possible to do?

A LVRefNum is really just a single int32 value. Its meaning is useless for other environments than those who created it so that you Michael not any what in C/C++ caller but pass it back to other functions in your DLL, but this often isn't a problem at all.

You can take the following statement of the LabVIEW extcode.h headers and add them to your delabviewed header files to make it work in such a way.

#define Private (T) typedef struct T # _t {void * p ;} * T}

Private (LVRefNum);

The LStrHandle you must set a standard C string instead in your export DLL and document what is the size of the string buffer should have if it is an output parameter.

TD1 error clusters should also be divided into their parameters (C compatible) separate for all items or just to the left of suite entirely.

Rolf Kalbermatter

Tags: NI Software

Similar Questions

  • Consume a web service from ASP which responds with complex data types...

    Here's my problem - I'm trying to consume a web service from a provider that uses complex data types.

    The starting of the WSDL part looks like this (I have not included all) - named have been changed to protect the innocent:

    " < wsdl:definitions targetNamespace = ' http://domain_name ">
    WSDL: < types >
    " < s:schema elementFormDefault ="qualified"targetNamespace =" http://domain_name ">
    < s:element name = "Authentication" >
    < s:complexType >
    < s:sequence >
    < s:element minOccurs = "0" maxOccurs = "1" name = "User name" type = "s:string" / >
    < s:element minOccurs = "0" maxOccurs = "1" name = "Password" type = "s:string" / >
    < s:element minOccurs = "0" maxOccurs = "1" name = "Token" / >
    < / s:sequence >
    < / s:complexType >
    < / s:element >
    < s:element name = "AuthenticateResponse" >
    < s:complexType >
    < s:sequence >
    < s:element minOccurs = "1" maxOccurs = "1" name = "AuthOK" type = "s:int" / >
    < s:element minOccurs = "0" maxOccurs = "1" name = "Token" / >
    < / s:sequence >
    < / s:complexType >
    < / s:element >

    Since it is a return, with a sequence of complexType, I expect an array or a structure returned, but instead I just get the value of "AuthOK" and no way to get something else.

    Here are the ways I tried to call it:

    < cfscript >

    WS = createObject ("WebService", "https://WSDL_URL");

    WS_ret = WS. Authentication (name of user = "username", password = "password", token = "");

    < / cfscript >

    < cfdump var = "" #WS_ret # "/ >"

    < cfinvoke webservice = "WSDL_URL" method = "Authentication" returnVariable = "WS_ret" >

    < name cfinvokeargument = "userID" value = "7253320" / >
    < cfinvokeargument name = "password" value = "ctpjxs3" / >
    < name cfinvokeargument = "SecurityToken" value = "" / > "

    < / cfinvoke >

    < cfdump var = "" #WS_ret # "/ >"

    Any ideas how I can get the other variables in the sequence? I have other calls after that have a greater amount of variables, and as such I can't use without being about to get more than the

    You can try using the function GetSOAPResponse to review the XML code you receive.

    'GetSOAPResponse '.

    http://livedocs.Adobe.com/ColdFusion/8/htmldocs/help.HTML?content=functions_e-g_59.html#50 54378

    "Troubleshooting SOAP requests and responses.

    http://livedocs.Adobe.com/ColdFusion/8/htmldocs/help.HTML?content=webservices_27.html#1222 070

    As for the question of docs, I suspect mediocre edition is at fault.  I assume that the web service is supposed to have an echoStruct method but this is unclear.

  • Working with complex data types in web services...

    Hi all
    I have created a Web service and created an interface for this in the ADF. Now that my web service returns a complex data type, I followed the steps in this article "http://www.oracle.com/technology/products/jdev/howtos/1013/wsadf/adfcomplexwstypes.html" and it works very well, my results are also displayed. But the only problem is that I get a warning "Houston-25009: cannot create an object of type: java.util.calendar value: 2008-09 - 23 T 23: 51:30.000 + 05:30 ' and if I can replace all the java.util.Date oracle.jbo.domain.Date then I get a warning" Houston-25009: failed to create an object of type: oracle.jbo.domain.Date with the value: 2008-09 - 23 T 23: 51:30.000 + 05:30. Now I am unable to understand this, but I think it's a problem of data type mapping, but do not know how to remedy this.

    Everyone knows the wayout?

    Concerning
    Lokesh

    Hi Lokesh,
    I have been troubled by the same question in the past. The problem is that the entrants is a format for dateTime xml adf trying to analyze the underlying java object. Java.util.Calendar, java.util.Date, or oracle.jbo.domain.Date to get a date in adf when scanning automatically your incoming xml file. See this thread on the forum for more information jdeveloper Re: how to deal with xsd: DateTime to webservice in ADF? The answer that gives Frank Nimphius is correct but I used option 1 option 2 should also work.

    Kind regards
    André

  • Convert or map Typedonnees decimal Transact-SQL for Oracle Number data type?

    MSSQL 2005
    Oracle 10.2 g

    In a MSSQL table, I have a column with the data type set on (decimal (1.0), null) with the values of line-1. (695 lines in total)

    In the Oracle table, the proposed mapped column is a number data type. When I import data, I received 695 errors with the message "invalid value for the field. How to properly convert or map Decimal (MSSQL) Transact-SQL for Oracle Number data type for a negative value?

    Thank you.

    How do you load data into Oracle? What tool or programming language you are using? Can you post something cause what you stated in your post should work, but there may be some ODBC, or other type of conversion factors to be taken into account.

     > create table t1 (field1  number(1,0));
    
    Table created.
    
     > insert into t1 values (-1);
    
    1 row created.
    
    UT1 > select * from t1;
    
        FIELD1
    ----------
            -1
    

    HTH - Mark D Powell.

  • Ksoap2 complex data types

    I'm moving the xml as a parameter in a Web service, however it doesn't seem to work.

    The Web service is a service of .net, the required parameters is a group of data.  It is built in xml that I put in a string and then add it as a parameter to aid,

    SoapObject rpc = new SoapObject(serviceNamespace, _soapAction);rpc.addProperty("paramname", xml);
    

    I have no problem to send the basic parameter types, the type complex seems to be incorrect.  Someone else has managed to use complex data types when communicating with a web service using Ksoap2?

    Use SoapSerializationEnvelope addMapping with namespace, the name of the class (as in the wsdl document) and class (getClass() or .class) itself.

  • When I view my Photos, they have a place and a date. How can I print them with that on them?

    When I view my Photos, they have a place and a date. How can I print them with that on them?

    You want to print the information on the image itself?  To do this, you will need to export the picture on the desk and edit it with a 3rd party image editor that supports the text and layers:

    Some Image editors that support layers and text:


    Photoshop Elements for Mac 11 - $79

    GraphicConverter - $40
    The Rainbow painter - $30

    Photos of affinity- $50

    FX Photo Studio - $30

    Inpaint - $20
    Imaging - $38
    Acorn - $50

    Pixelmator - $60

    Seashore - free

    GIMP for Mac - free (Yosemite & Mavericks only)

  • Thunderbird 38.3.0: No writable calendars are configured for the invitations with the provider for Google Calendar 1.0.4

    Hello

    I searched many hours today in the internet and your forums, but it seems that this problem is not solved yet:

    No writable calendars are configured for the invitations with the provider for Google Calendar.

    My Thunderbird is 38.3.0 and the provider for Google Calendar 1.0.4.

    I put calendar.google.enableEmailInvitations; true but it did not help. I also tried [email protected]... @googlemail.com. Calendar works fine, it syncs, I see all the entries etc. But I can't accept invitations even IF she must have write access.

    What can I do? Is there a solution for this?

    Thank you!
    Daniel

    Use CalDAV here to access Google Calendar via lightning. I have no experience with the add-on of the provider.
    In any case, it is my understanding that you must assign an e-mail address to a calendar in order to be able to accept the invitations for this calendar. I see that in your screenshot.
    You can try to remove the Google calendar in lightning and re-create it. Given that all the data is on the server nothing will get lost.
    Or you may want to try CalDAV.
    https://blog.Mozilla.org/calendar/2013/09/Google-is-changing-the-location-URL-of-their-CalDAV-calendars/

  • If win 2003 is upgraded for the 2008 edition, it will fix alingment compensate for the problem with the SAN disks?

    If win 2003 is upgraded for the 2008 edition, it will fix alingment compensate for the problem with the SAN disks?

    Hi elvirkaric,

    Your question in Windows Server 2008 is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet Forum. You can follow the link to your question:

    http://social.technet.Microsoft.com/forums/en-us/w7itproinstall/threads

  • Where is the support for the iPhone with some of these issues?  It's amazing that none of the iphone Tech responded to the unanswered questions.

    Where is the support for the iPhone with some of these issues?  It's amazing that none of the iphone Tech responded to the unanswered questions.

    This is a user forum. You to read the terms of use to which you agreed to when registering, you would have been aware that the participation of Apple here is minimal.

  • Event ID 10016 - the application-specific permission settings do not local Activation permission for the COM with the CLSID server application

    Lately, I'm getting this system error a lot now that I've upgraded to Windows 8 Pro is an event DistributedCom 10016 ID. Here is the text of the error:

    The application-specific permission settings do not local Activation permission for the COM with the CLSID server application

    {D63B10C5-BB46-4990-A94F-E40B9D520160}

    and APPID

    {9CA88EE3-ACB7-47C8-AFC4-AB702511C276}

    the user NT AUTHORITY\SYSTEM SID (S-1-5-18) from the address LocalHost (using LRPC) running in the container of the application unavailable SID (not available). This security permission can be modified using the Component Services administrative tool.

    Anyone has an idea why I get this error?
    Walt

    Same thing here. Grayed. Windows 8.1 seems to fill the observer of events with many more errors than previous versions.

    Edit: OK, discovered why it is grayed out. There are 2 reg key, you must set permissions before going to the Configuration of DCOM in component services. The CLSID key and the APPID key.

    From another forum, although it applies to a different application, same principle:

    1. open Regedit.
    2. go in HKEY_Classes_Root\CLSID\ * CLSID *.
    Note: * CLSID * stand for the ID that appears in your event viewer error. In your case, it is {C2F03A33-21F5-47FA-B4BB-156362A2F239}.
    3. right-click on it and select authorization.
    4. click on Advance and change owner to administrator. Also click on the box that will appear below the threshold of owner.
    5. apply a full control.
    6. close the tab, then go to HKEY_LocalMachine\Software\Classes\AppID\ * APPID *.
    Note: * AppID * is the ID that appears in your event viewer. In your case, it is {316CDED5-E4AE-4B15-9113-7055D84DCC97}.
    7 right-click on it and select authorization.
    8. click on Advance and change the owner to administrators.
    9. click on the box that will appear below the line owner.
    10. click on apply and grant full control to the administrators.
    11. close all tabs and navigate to the administration tool.
    12. open component services.
    13. click on the computer, click my computer, and then click DCOM.
    14 find the corresponding service that appears on the display of the error.
    15. right-click on it, and then click Properties.
    16. click the Security tab, and then click Add a user. Add the SYSTEM and then apply.
    17. check enable local.

    Then use the relevant keys here and the DCOM Config utility should give you access greyed onareas:

    CLSID:

    {D63B10C5-BB46-4990-A94F-E40B9D520160}

    and APPID

    {9CA88EE3-ACB7-47C8-AFC4-AB702511C276}

  • Bug 7372061 R12 APPROVAL INITIATE BUTTON IS grayed OUT FOR THE BILLS WITH WI

    Hello

    Is it patch available for > > > > Bug 7372061 R12 APPROVAL INITIATE BUTTON IS grayed OUT FOR THE BILLS WITH TAX WITHHODLING
    In workbench Bill initiate approval checkbox is grayed out for the Bills with the withholding tax.
    Fixed apinvutb.pls 120.44.12000000.15



    I tried to search on metalink but theres no such fix name.


    Thank you

    Hello

    I think that you have nothing to do at the moment. As suggested before, log a SR and do escalate the issue.

    Good luck!

    Kind regards
    Hussein

  • How to use the node function call library for a function in the dll with the data SUB type

    Hi all

    I would ask for your kind help

    I am facing a problem with the call library node.

    I have a C++ (stdcall) function, which has Sub as data type

    XXXX error code (hwnd, lid, getValue, * Sub data1, * Sub data2)

    data1 and data2 types are constantly changing based on the value of 'getValue '.

    Mainly I can use the call library node several times and adapt each node according to the types of data data1, data2 and extract the values and use in the code. Here is no question. Real question is:

    My question:

    How can I use a node of library time call and make a case according to the 'getvalue', who will control the data1, data2 data type. Here I really seeking solutions.

    My tests:

    I used varaints as entry to the libray call node of the data1, data2 and selected parameters in the call libraby node as "Adapt to type. Here labview just crashed.

    I appreciate your suggestions to feedbackand.

    Thank you

    Karine

    You must allocate enough space for data1 and data2, and then pass a pointer to this space. An easy way to do this is the function to initialize table. Set the U8 type and size for the number of bytes required. Pass this array to the function as a pointer of table data.

    After the function call returns, you need to extract the data in the table. You can do it manually, but a simple approach is to use the array of bytes to a string. Then, in a housing structure, use Unflatten chain to convert the string to the correct data type. This method also converts the "endianness" which will be probably necessary; Be sure to only set all entries for unflatten correctly.

  • How to add the primary key for the table with the existing data?

    The table is already busy data. There was no primary key before, so for each column, there are some duplicate values.

    I want to add a new column, which should be of the integer data type and can automatically incremented, from 001. I tried with Oracle SQL Developer, but it says "ORA-01758: table must be empty to add mandatory (NOT NULL) column. How can I do? Thank you!

    Hello

    Look for the [ALTER TABLE | http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_3001.htm#sthref4803] command to find out how to add a column (step (1)) and a (step (3)) constraint to an existing table.

    For the step (2):

    CREATE SEQUENCE  employee_id_seq
    START WITH  1
    ;
    
    UPDATE  employee
    SET     id  = employee_id_seq.NEXTVAL;
    

    When you create a sequence, START WITH 1 is the default value, so that the line is not really necessary above... I've included just to show how you could start with any number you have chosen.

  • How to generate a pulse with the signal generator?

    Hello

    I would like to ask if anyone knows how to use the Elvis platform to generate a regulated pulse wave?

    It should look roughly like the picture above. A sine wave with the regulation.

    Anyone who can answer my question please respond to my post.

    Thank you.

    You are using LabVIEW to generate the waveform or using the Soft front panels? In LabVIEW, you can use the express VI generator function and specify the Type as "Sine". Then, simply change the amplitude of the sine wave. During the actual pulse, the amplitude would be what you want (i.e. 1 V) and while the pulse is idle, set the amplitude to 0.

    If you use the soft front panels, you can use the Waveform Editor to create a waveform that includes a sine wave for the length of your pulse and then the values of '0' for the rest of the time. Then use this waveform in the flexible front of the arbitrary signal generator. Simply create a component of sine as the first part of the wave and then add another element to a level DC '0' for the rest.

  • How do I create a small PDF file for the web with fonts embedded in the InDesign files?

    How can I actually "convert" my files of 100 pages, produced magazines in InDesign (300 dpi, CMYK, prepress ready images) to PDF size reasonable to publish on the web. I tried "smaller" size of the file in Acrobat, but it does not incorporate the fonts and images are very unclear. I tried printing of high quality, but the file size is too large (100 + MB). Can someone point me in the right direction? My company said I need to get a PDF (below 38 MB) file to the webmaster to display. I asked the administrator of the site - he had no idea of converting to InDesign.  Thank you!

    You can start the press or high-quality Print PDF you make when you run the optimizer, as both will be incorporated, fonts and images high resolution. You don't want to have courses for your magazine of font substitution.

    If you have converted the images to CMYK before placing them, it matter which two presets you used for the base file, but if it's RGB, high quality print Prest will abandon them this way, which will also result in a smaller file. You can also convert the CMYK to RGB in Acrobat, if necessary. Do this before you re - sample.

Maybe you are looking for