How do I write a Dll to perform a union in visual studio for use in LabVIEW?

Hello,
I'm new to writing dll(s). I'm attempting to write a Dll that will perform a union on a number from LabVIEW and then return the result to LabVIEW for my use. I've been struggling with this for a few days and I'm finally giving in to get some help.
This screenshot is the only description that I have to help me with what I am trying to do. Basically, I'm trying to pass a value that will be different based on a measured partial discharge value. In the screen below, the value used is "1061111989" This number is my reading. I need to pass this value from labVIEW into my dll to perform a union on it.
In my Dll, I need to write MeterReading.IntVal's value and get the MeterReading.FloatVal back.
I have Visual Studio 2012 Full and LabVIEW 2012 Full, I'm LabVIEW CLAD and I've written 17 test floors in the US to date; however, I've never had any need of Visual Studio until now. Can anyone help me out with this?
Thanks in advance, -Chris
-Chris
"You must be some sort of an engineer?" -Close Friend
Solved!
Go to Solution.

Sometimes, I try to solve simple issues in very complicated ways. What got me so confused here was the solution from the engineer of the device that I am reading from was using a union to get the value. I'm not familiar with unions so I thought that it was some structure that was not creatable in LabVIEW. Anyways, a typecast to single point gave me the proper value. Thank you.
-Chris
"You must be some sort of an engineer?" -Close Friend

Similar Messages

  • How can I print the "number lines" with the code in Visual Studio?

    How can I print the "number lines" with the code in Visual Studio?

    Hi BillionaireMan,
    What about your issue now?
    If you have resolved it, you can share the solution here, which will be beneficial for other members with the same issue.
    If you did not, please tell us more information,we will try my best to help you.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Error when compiling my API Programm thant i want to generate DLL for use in Labview!

    Pls see the attachment!!I use API "GetComputerName" to programm in vc6.0 to make a dll file for use in Labview.But i get the error in the attachment. Pls give me a hand!
    Attachments:
    machinename.zip ‏1493 KB
    error_when_compiling.txt ‏1 KB

    Hi,
    If you are using the CVI libraries on this you can use the GetCompName() function from the programmer's toolbox. However, your code looks fine, the only thing that you need to change is the data type of the paramenters in CompNameLength. Just declare them using the predefined Windows data types; like this:
    LPTSTR computerName;
    DWORD compNameLength = MAX_COMPUTERNAME_LENGTH+1;
    computerName = malloc(MAX_COMPUTERNAME_LENGTH+1);
    GetComputerName(computerName,&compNameLength);
    printf("%s",computerName);
    free(computerName);
    Don't forget to include windows.h where those types are defined.
    Good Luck!
    Juan Carlos
    N.I.

  • How can I debug a DLL created with MS Visual Studio C++ using CVI?

    I have developed a DLL using MS Visual Studio C++, which is called by an other application written in CVI.
    My goal is to debug the DLL written with C++ when is called from CVI.
    So far I have some msg popups, but I would like to have more debugging capabilities.
    Thanks, Adalbert

    Hello Adi11,
    As documented in the CVI Help under "Debugging DLLs": "In the LabWindows/CVI development environment, you can debug only DLLs you create in LabWindows/CVI with the Create Debuggable Dynamic Link Library command. Other development environments cannot debug DLLs you create in LabWindows/CVI."
    This information was also mentioned on the following discussion forum.
    Thanks.
    Wendy L
    LabWindows/CVI Developer Newsletter - ni.com/cvinews

  • I would like convert a c++ dll for use in labview--my device has no labview dll

    I have a piezoelectric control board (Piezomechanik gmbh) that I would like to use through LabView.  Currently, the company does not offer any support for Labview.  Windows sees the device (It came with a driver file), but the company only provides dll files for C++ and Visual Basic.  Can I convert these files to a format Labview can use?  How can I get Labview to communicate with the control board (and ultimately the piezoelectric device attached to it)?  Thanks!
    Solved!
    Go to Solution.

    This will only help you when you have the header file for the DLL, otherwise you will have to create the wrapper manually using the "Call library node" and the DLL api description or write an header file for the DLL yourself based on the api documentation and use the wizard.
    Regards,
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • How do i configure the usb port on a draytek vigor 2820n router for use with my imac

    i have an imac connected to the internet through a draytek vigor 2820n router. this router has a USB port with a HP Deskjet 5560 printer attached (for use as a network printer for other machines on the network). How do I configure this printer on the iMAC?

    I checked on the HP web site. Your aswer is on the HP website under your printer type. Update your drivers and follow the instructions given by HP and the printer will work as you have it connected.
    Good Luck

  • How to get the WSDL file to consume a WS from Visual Studio

    Hi gurus:
    I've created a receiver SOAP adapter in my XI system that could be invoked by:
    http://xiserver:50000/XISOAPAdapter/MessageServlet?channel=:Openlab_Desarollo:CanalComunicaciones_SOAP"
    It is working fine. Now I must send the WSDL file to an external enterprise so they can invoke the XI web service. Thay are using Visual Studio.
    But, how could I obtain or generate the WSDL file?
    Thanks in advance to all and regards,
    Alejandro.

    Hi,
    In ID, choose "Define Webservice" in Tools.
    There you can  provide the URl that you have given here, instead of using proposed URL.
    You will get the WSDL that you can consume in Visual studio.
    Regards,
    Vikas

  • How do i get SharePoint list as a data source in visual studio 2013

    In word add-in application,i have added the tree view as a custom pane.Now i wanted to load tree view from share point list.Could you please help to load sharepoint list from Visual Studio.

    Refer to the following posts, hope it helps
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/b392871a-b504-4679-a724-f85deb602ed2/how-to-bind-sharepoint-list-to-wpf-treeview
    http://www.codeproject.com/Tips/627580/Build-Tree-View-Structure-for-SharePoint-List-Data
    --Cheers

  • How to build different projects in different visual studio version using MS build

    hi,
    i have different projects which is to be built in different visual studio versions like vb6.0, vs2010, vb2013 etc..
    first i have to build some projects using vb6.0, next using VS2010 because vb6.0 project output is refered to VS2010 projects and vs2010 project output is referred to VS2013 projects.
    Using MS build script how i can do this.
    please help me.
    thanks.

    please help me.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=msbuild

  • How do I make Visual Studio 2013 use my dedicated graphics card instead of integrated graphics on my laptop?

    I am using Alienware 13 as a portable workstation. I do game development on Unreal Engine 4 using Visual Studio 2013. The issue I am having is that when I want to debug codes in Visual Studio 2013, it launches Unreal Engine 4 through the debugger and uses
    the integrated graphics card rather than my dedicated graphics card, which is an nVida Geforce 860M.
    When I wanted to change the settings in the NVidia Control Panel, I see this:
    The drop-down menu is grayed out, so I cannot select to change the graphics card to my dedicated card.
    What should I do? How do I make it so that Visual Studio uses my dedicated card? Thanks in advance.

    Hi tom_mai78101,
    Thank you for posting in the MSDN forum.
    It seems that it is not the correct forum for this issue, since this forum is to discuss Visual Studio WPF/SL Designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System, and Visual Studio Editor.
    As you said that you want to change the setting so that Visual Studio uses your dedicated card in NVidia Control Panel, since this NVidia Control Panel is third-party tool, we are not support it. So please post this issue this issue directly
    to this NVidia Control Panel Official website:
    http://www.nvidia.com/object/nvidia-communities.html , you will get better support.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to execute Coded UI automated test case remotely without installing Visual studio?

    We are using visual studio 2013 premium. my object is to run the Coded ui automated test case remotely without installing visual studio. can you guide me how to approach it successfully ?
    Thanks in Advance..  

    Hi Divakar,
    According to your description,
    as far as I know that if we want to run the automation test remotely without vs using mstest, we will need to install and configure the test controller and the test agent machine.
    Please refer to the following steps configure the test controller on locally machine and install a test agent on the remotely machine.
    Note: If you an
    automation test on locally machine, we must make sure the test agent be installed on remotely
    machine.
    Step1: you can try to
    configure test controller and agent, for more information:
    http://msdn.microsoft.com/en-us/library/hh546459.aspx
    Step2: you will need to
    assign roles to a Test Controller and Test Agent for Automated Testing in Visual Studio, please see:
    http://msdn.microsoft.com/en-us/library/ff469838.aspx
    Note: you will need to add a testsetting file before you assign roles to a Test Controller and Test Agent for Automated
    Testing in Visual Studio.
    Reference:
    http://msdn.microsoft.com/en-us/library/ee256991.aspx
    Step3: After you configure and install the test controller and test agent successfully, we can
    executed coded UI test remotely using  mstest.exe on test agent machine, we would call the testsetting file in command line.
    Reference:
    How
    to use MSTest.exe command-line options
    In addition, I find an article about
    Running tests in mstest without installing the VS IDE, please see:
    http://blogs.msdn.com/b/anutthara/archive/2009/12/16/running-tests-in-mstest-without-installing-the-vs-ide.aspx
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do you write any kind of content you want into a new file using Java?

    I know this is extremely basic, but I have absolutely no idea how to do this!
    How can I create a brand new file on my machine, this new file containing literally ANYTHING I want: String content; Image content, Excel content, Whatever content.. literally anything on the planet I can come up with..??
    I have tried everything I can think of to no avail and have exhausted every online tutorial I could find both here and via Google, to no avail. I can't figure it out, and this is all I have so far:
    * FileDownloader.java
    * Created on January 10, 2007, 3:47 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package FileTools;
    import java.io.*;
    import java.net.*;
    * @author ppowell-c
    public class FileDownloader {
        public static void download(URL url, File file) throws IOException {
            InputStream in = url.openStream();
            FileOutputStream out = new FileOutputStream(file);
            byte[] b = new byte[1024];
            int len;
            while((len = in.read(b)) != -1) {
                out.write(b, 0, len);
            out.close();
        public static void download(String path, File file) throws IOException {
         download(new URL(path), file);
        public static void download(String path, Object contents) throws IOException {
         ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(path));
         out.writeObject(contents);
         out.close();
    }This code fails to download contents into a new file in the case whereby I want to create a new .ico Icon file with the contents from ImageIcon.getImage() as an example, which is what I want to do right now.
    Thanx
    Phil

    beyond any mortal being? In PHP it's extremely easy,
    it's just three lines:
    <?
    $fileID = @fopen('/path/to/your/file', 'rb');
    @fputs($fileID, $contents);  // $contents can be
    literally anything, even anobject!
    @fclose($fileID);
    The thing here is - what is in $contents? I personally don't have a clue how to manually create the contents for a .bmp file for instance - I don't know what should go where in order for a .bmp reader to be able to recognize the file as a "real" bitmap (.bmp) file. I can, however, just put anything I want - anything at all into a file, write it out, calling it a .bmp file. Will it be a .bmp file? No, of course not. So, what is in $contents?
    ~Bill

  • How can I write to port C and read from port A&B simultaneously using 6503 DIO-24

    I attempting to read from Port A and B which are grouped together and at the same time I want to write to Port C. The problem I having now is that every time I want to read from Port A and B, Port C seems to be effected. I have only used the easy dio's vi this may be the root of my prblem

    Hello,
    You will need to use the advanced digital VIs to accomplish what you are trying to do.
    The Easy DIO VI's are simply a combination of two DIO advanced VI, so you will use the same two advanced VI with a little different calling method. We want to call both PORT Config VI first to configure two ports for read and one port for write. Then we can simply read and write to the ports as desired, perhaps in a loop.
    The best place to start would be to look at the LabVIEW examples for Digital Input and Output operations. In LabVIEW, go to Search Examples then under I/O interfaces select DAQ (or Data Acquisition)-> Digital Input and Output->Immediate Digital Input and Output. From her you will want to look at the examples under the 8255 chip which is the chip on
    the DIO-24. I would recommend looking at Read from two digtial ports and the Write to one digital port VI's.
    From here you will simply need to combine the two together. One note: you will want to make sure that both port config VI are called before either Port Read or Port Write VIs.

  • Using mingw to make a .dll for use in labview ?

    I have seen some posts on this, but none of them take it all the way from C code to configuring the shared library node...
    My code is heavily based on this:
    http://forums.ni.com/ni/board/message?board.id=170&thread.id=171056
    Here are my files:
    //reedll.h
    #ifdef BUILD_DLL
    // the dll exports
    #define EXPORT __declspec(dllexport)
    #else
    // the exe imports
    #define EXPORT __declspec(dllimport)
    #endif
    // function to be imported/exported
    EXPORT void tstfunc(int A, int B, int C);
    and:
    //DLL_Test.c
    #include "reedll.h"
    EXPORT void tstfunc(int A, int B, int C)
      C = A + B;
    Its meant to be as bare bones as I can get it. No crazy pointers or anything.
    I compile as follows usin MinGW:
    g++ -c -DBUILD_DLL DLL_Test.c
    g++ -shared -o tst.dll -Wl,--out-implib,libtstdll.a DLL_Test.o
    And it appears to compile fine.
    When I go to import the .dll into the shared library node the "Function Name" field is garbled and says "Z7tstfunciii" instead of "tstfunc".  Needless to say the shared library function icon that results doesnt work

    You should tell the mingw compiler to not name mangle the symbols. Most likely you use a cpp file enxtension and then mingw as Visual C will invoke the cpp compiler instead of c which by default name mangles function names.
    If you want or need to use cpp, you can also try to declare your exported symbols like this:
    #ifdef __cplusplus
    extern "C" {
    #endif
    EXPORT void tstfunc(int A, int B, int C);
    /* all the other function prototypes you do not want to be mangled */
    #ifdef __cplusplus
    #endif
    Not sure if __cplusplus is defined by mingw, if not you have to find how it indicates that C++ mode has been invoked.
    Message Edited by rolfk on 03-24-2010 02:48 PM
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Problem making a C++ DLL in Visual Studio 2010 work in LabView

    Hello, I've noticed that I cannot do ' extern "C" ' on the methods Open(), Close(), StartStreaming(), and StopStreaming() in the following Class:
    class ApplicationIo : public FiclIo
        friend class X5ScriptPlayer;
        friend class ApplicationSettings;
        typedef std::vector<__int64>    IntArray;
    public:
        //  Member Functions
        ApplicationIo(IUserInterface * ui);
        ~ApplicationIo();
        ModuleIo &  ModIo()
            {  return Module;  }
        unsigned int BoardCount();
        void Open();
        bool IsOpen()
            {  return Opened;  }
        void Close();
        void StartStreaming();
        void StopStreaming();
    How can I export the methods of the Class mentioned above? I've read the manuals and seen examples about how to get DLLs working in LabView, however none of them ever talk about when there is an actual Class involved and exporting the methods of said Class.
    Any help would be greatly appreciated.

    Okay, well at least that clears up one piece of the puzzle.
    Here is the wrapper I need:
    Here's the .h of the wrapper:
    #ifndef _APPIO_DLL_WRAPPER_H_
    #define _APPIO_DLL_WRAPPER_H_
    #define DLLEXPORT __declspec (dllexport)
    #ifdef __cplusplus
    extern "C" {
    #endif
    typedef struct ApplicationIo ApplicationIo; /* make the class opaque to the wrapper */
    DLLEXPORT ApplicationIo* Construct_AppIo(IUserInterface* ui);
    DLLEXPORT void Destruct_AppIo(ApplicationIo* LV_Ref);
    DLLEXPORT void Open(ApplicationIo* LV_Ref);
    DLLEXPORT void Close(ApplicationIo* LV_Ref);
    DLLEXPORT void StartStreaming(ApplicationIo* LV_Ref);
    DLLEXPORT void StopStreaming(ApplicationIo* LV_Ref);
    #ifdef __cplusplus
    #endif
    #endif /* _APPIO_DLL_WRAPPER_H_ */
    Here's the .cpp of the wrapper:
    #include "AppIoDll.h"
    #include "ApplicationIo.h"
    ApplicationIo* Construct_AppIo(IUserInterface* ui)
    return new ApplicationIo(ui);
    void Destruct_AppIo(ApplicationIo* LV_Ref)
    LV_Ref->Close();
    delete LV_Ref;
    void Open(ApplicationIo* LV_Ref)
    LV_Ref->Open();
    void Close(ApplicationIo* LV_Ref)
    LV_Ref->Close();
    void StartStreaming(ApplicationIo* LV_Ref)
    LV_Ref->StartStreaming();
    void StopStreaming(ApplicationIo* LV_Ref)
    LV_Ref->StopStreaming();
    The one problem I have with this is how am I supposed to get the pointer to the IUserInterface class to the C Wrapper constructor?

Maybe you are looking for