How to pass pointers around labview

Hello

What is the proper way to pass pointers, pointing to the DLL allocated memory around labview?

I spent some time with the cast of type C standard working as:

typedef struct
{
    void *mem;
} myVars;

int InitMyVars(int64_t *myVarsLVPtr)
{
    void *myVarsPtr = NULL;
    myVarsPtr = malloc(sizeof(myVars));
    if(myVarsPtr)
    {
        *myVarsLVPtr = (int64_t)myVarsPtr;
        return 0;
    }
    return -1;
}

int UseMyVars(int64_t *myVarsLVPtr)
{
    void *myVarsPtr = NULL;
    myVarsPtr =(void*)*myVarsLVPtr;
    //return funcWithVars(myVarsPtr);
}

Subsequently set up nodes to call library as follows:

And pass the pointer on labview as a 64-bit number (since it's a pointer, I value, it makes no difference if its signed or not signed, please facepalm me so bad)

In this way is very ugly. I don't like it. Found several discussions, saying that "whenever someone writes a code like int tmp = (int)(&something); a little fluffy kitten chokes to death." Unfortunately, so far of programming was a certain felinicide. "It makes me a kittenchoker series.

It is also dangerous for the different platforms, for example. i686 and x86_64.

I was self learning all that now look back at it, it's like if I missed something some time.

There must be a better way.

I am grateful for the suggestions.


Tags: NI Software

Similar Questions

  • How to pass data to LabVIEW teststand Hex

    Hello

    Is it possible to pass data Hex Teststand to a LabView VI.

    In the column 'Type' of the Module tab on the stage, I only have the options "ASCII" or "binary string".

    What I need to change my VI to take the hex data, or can I change the Type of TestStand so that I can enter the Hex data

    When I enter the Hex data directly in the VI, it works fine.

    Thank you

    Sound advice from Omar! If you decide to follow this method, here's a useful KB...

    How to convert between hexadecimal and ASCII in LabVIEW

    http://digital.NI.com/public.nsf/allkb/894CF5FE064971BF8625758400014993?OpenDocument

  • How to pass variables between Labview and Teststand

    It is probably a trivial question, but I'm new to TestStand. All I'm doing is updated to a variable in Labview and then pass this value in a local variable Teststand. A simple test that VI is attached. I get no error and it seems correct, but when I followed the variable via TS watch display is not updated. Also I am not able to read the variable outside TS. It is probably a trivial thing, I'm doing wrong, but I'm stuck.

    Too bad, it was simple. Just need to add the context of sequence as input, then set it to ThisContext TS

  • How to pass the Visa Resource Name parameter to labview dll in labwindows/cvi

    Hello world

    I build a dll of labview, the prototype is: double getchannelpower (double f, uintptr_t * VISAResourceName);

    I don't know how to go from VISAResourceName to this function.

    Is it related to the ViPSession paremeter in function viOpen(REES ViSession, rn ViRsrc, ViAccessMode am, ViUInt32 ti,ViPSession vi)?

    BRs,

    lotusky

    Hey, guys:

    I figured out how to pass the parameter.

    In labview, you must replace the control of visa with string control. In this way, the generated dll function at the entrance of the string type.

    I hope this will help others!

    lotusky

  • Passing variables between LabVIEW and TestStand

    Hello

    I'm just learning how to use TestStand and although there are a multitude of resources available, I always find me at a loss on how to pass variables between TS and LV, leaving me to think that there is one fundamental thing that I'm missing which is likely, given that I have a weeks experience with LabVIEW and a days of experience with TestStand.

    I took a glance to the example of 'Clusters' to the Code Modules in TestStand examples (I use TS 2016 if it matters) because I thought it would be quite ideal for what I hope. In this case, I hope to be able to pass a string (a file path) to LabVIEW and VI power take this string and use it as part of an order for the Exec.VI system.  Then, I would be able to pass strings back to TestStand to show the user if an error occurred, but I thought I should get the first part of work.

    I guess my question is what do I have to wait to see in clusters to the example of the Modules of Code? The Watch window displays all defined variables premise on which has the ContainerOut in the Variables pane, but I don't see any kind of update on facades (VI1.vi and VI2.vi) LabVIEW code. Should I be?

    I looked at a few other discussions of the forum here and here, as well as the document of the basis of knowledge here, but could not recreate their solutions. It seems that the connector pane would be a viable way to go, but I'm not sure on how we create and use effectively. According to this document , it makes it seem like it should be simple enough to makes these terminals, but I am still missing a key step. I was able to follow all the steps on the knowledge base document and run the sequence, but then had no idea if it worked or not; I have the report show me the values of the variables I put, but I have no idea whether or not he actually did anything with the LabVIEW VI, or how I could see that.

    Please let me know if you need further information or clarifaction everything I ask.

    Thank you for your time,
    JColvin

    Digilent, a company of National Instruments

    If you want to enter values, you must create a vi for instance dialog box

    The OK button will allow new values to pass to the output terminals.

    A Cancel button will pass just the original through the output values without alteration. The VI will close when either the OK button or cancel were pressed.

    Concerning

    Ray

  • How to pass a string to a vi from a dll?

    I have a DLL that generates errors in the log. How can I display my Panel before these errors? In other words, how to pass a string from a DLL to a vi using the library to call feature?

    Thank you

    Diego

    The DLL actually allocates memory for the string? If this is the case, there should be another function to free the memory. Otherwise you won't be able to do the deallocation of LabVIEW, which means you would have to write a wrapper DLL. If you do not have the deallocation, then you will have a memory leak.

    Are you sure that the DLL is not simply wait for a buffer "of a proper size? In this case, you can simply create a U8 in LabVIEW to a size that is larger that the largest string that you expect to get.

  • How to pass data (more effective) autour

    Hello
    I wonder how to pass around large data around across the application.

    For example:
    1 data or data of my analog channels
    (I have a lot of screws that will process these data of waveform)
    Is it not wise to spend around analog continuous data?

    2. What if you want to process digital data?
    (I must treat these unique bits in several screws, for example,)
    security door bit, stop bit of emergency, must be treated as higher priority than screw
    input 1, selector, etc.).

    Or you have any suggestions, what type of data I should use. I have a
    global impression screw actually write these digital data in a file, then
    These files are passed around?

    3. is there a mechanism that pass around data in memory, NOT in the files?

    By far, the way the more effiecient to pass data autour is a thread.  If you are really worried about memory, then you must avoid the connection of the wire that he holds the large amount of data.  This could mean making your processes in series (one at a time) passing the data of one Subvi to another via the controls and indicators and the connector pane.

  • How to pass the session IMAQ to the Subvi

    Hello

    My experience with LabView is neither very good nor extended. I am a scientist and I'm with IMAQ data acquisition. My current problem is that the people who wrote the script is modular, versatile, or clear initially structured. So I try to reduce the ridiculous number of tests in a simple flowchart to a level that people can actually understand it... and to make the more versatile script for future experiments.

    I'm introducing quite a few subVIs to be executed repeatedly. However, I can't know how to pass the IMAQ session on the Subvi. I constantly get the error messages. In this case, I want to acquire images with OIDE_CollectFrame.vi controlled by OIDE_TrialPhaseCollect.vi. I couldn't understand how to assign the refnum IMAQ session class, either.

    It is probably a newbie question, but usually I program with LabView.

    Dennis


  • How to passing arguments to an exe

    Hai Everbody

    I know that LabVIEW has the ability to call an exe file created in different platform, can I know how to pass arguments to the special exe (which is located in another platform) via LabVIEW... I wish someone could help me out of this

    Thanks for your answers, I found the solution... As the exe is in .net, I used the syntax for the command line arguments in .net...

  • How to pass the value of the Timestamp from one Page to another

    From a column report link, I need to pass a DATE (that includes both) form one page to the next. If I use the basic name/value pairs under the section of the column link, the URL stops when it encounters a colon. For example, '2012-05-08 16:38 ' invades as ' 2012-05-08 16 "»

    In addition, all values after the colon in the DATE value are removed from the URL.

    I know not why this is happening. This is because oracle sees the ":" and this is a field terminator does not assume.

    How can I work around this problem? I saw the post suggesting the API URL_ENCODE but, I can see someone to call this, or any other code in the section of the link column. I've also seen some people suggest that this be done as a conditional branch. Simularly, I can't find in any case to call the branch section of the link column.

    There must be a way to pass this value, and I can't be the first person to ever attempt this. I am totally stuck and have spend hours on this issue.

    Thank you


    -Joe

    As fac586 said, you wouldn't have this problem if RISKDM2. INTRADAY_VM_CLEARER has a primary key, you can reference instead. Still, can you guarantee that the date will be unique?

    If so, suggested use fac586 of 'YYYYMMDDHH24MI' format mask for the link, but set the value of a hidden point new (say PX_HIDDEN_PARAM_ITEM). The last step then on the page that you are linking, have simply a page process that defines the element of effective date of to_date (PX_HIDDEN_PARAM_ITEM, 'YYYYMMDDHH24MI'). This before the process that brings back the record and after that should work just fine.

  • I bought a Macbook used, and now I can't update iMovie, iPhoto and iTunes without apple ID of the older owner how can I work around this?

    Hey everybody,

    This is my first post. A couple of years, I bought a used Macbook. I never did update (it is so long and then I decide to Watch youtube videos... it is not used for work or school). So now, I've updated the Yosemite and I want to get everything updated and it requires that I put a password of the former owner apple ID to update iTunes, iPhoto and iMovie. How can I get around this without reformatting and losing thousands of photos and all my files.

    Thank you guys.

    If you are the legal owner of the computer, but if the software you want is owned by another user is not yours. You cannot add any other purchases to your ID. You own, or that they are.

    backup with time machine

    move all your data in the folder user to an external drive or a flash drive is formatted in a format not mac or by checking the box "ignore this volume permissions" in get info of this device.

    do a clean install of the operating system

    create a new administrative account

    the Time Machine restore requests

    transfer your data from external sites back to the new account.

  • My school (Washington State University - site Angel) appears as "Untrusted" and I can't access any of the content, how do I get around this?

    I get an error "this connection is untrusted" when I connect to the website of my school and therefore can not access all of the content, that I need for my class. It is a new problem, I just had to reinstall Mozilla when I upgraded my hard drive, it worked two days ago, but not today. Does anyone know why this would happen, or how I can get around this? The only option that is imparted to me is of ' get out me of here! "which is the exact opposite of what I need to do.

    Check the date and time of the clock on your computer: (double) click on the clock icon in the Windows taskbar.

    Find out why the site is not approved, then click on "Technical Details to expand this section.
    If the certificate is not reliable because no issuer channel was provided (sec_error_unknown_issuer) and then see if you can install the intermediate certificate from another source.

    You can retrieve the certificate and check details such as WHO issued the certificates and the expiration dates of certificates.

    • Click on the link at the bottom of the error page: "I understand the risks".

    Let Firefox recover the certificate: "Add Exception"-> "get certificate".

    • Click on the "view..." button. "and inspect the certificate and the Coachman, who is the issuer of the certificate.

    You can see more details like the intermediate certificates that are used in the details pane.

    If "I understand the risks" is missing, this page can be opened in a (i) frame and in this case, try the shortcut menu and use "Frame this: Open image in New Tab".

    Note that some firewall monitors connections (sure) and that programs like Sendori or FiddlerRoot can intercept connections and send their own certificate instead of the certificate of the Web site.

  • Satellite Pro L100: How can I get around the startup password?

    Hello

    We have a Satellite Pro L100 PSLA4E and unfortunately, a startup password has been entered that we do not know. Does anyone have ideas how we can get around this?

    Thanks for your time, any ideas are greatly appreciated.

    BEAK

    Hello

    If you mean the BIOS password, then I have some bad news for you.
    If the BIOS password is not known to you, you can't bypass the password.
    This can be done by the partner of service authorized in your country.

    Just ask the guys for a helpa? ¦

  • How to pass windows boot camp support software to install windows 10

    It took me forever to download and save the boot camp windows software to a usb flash drive support. Now I begin the process to install 10 Windows using boot camp, he wants to download it again. How can I get around this?

    El Capitan wants to do it again. If you want to ignore it completely, install Yosemite on an external drive - How to install OS X on an external drive connected to your Mac - Apple Support - and use of the BCA v 5.x on Yosemite.

  • HOW TO PASS THE HEX OF THE MAIN PROGRAM VI ENUM, SUB VI ENUM VALUE

    HOW TO PASS THE HEX OF THE MAIN PROGRAM VI ENUM, SUB VI ENUM VALUE.

    HOW THEN IT WILL CHOOSE CORRECT ON SUB VI HEXAGONAL ENUM VALUES.

    Enum values are strings, you must first convert the hexadecimal value to a hexadecimal value chain represtation.

    Then that convert from the enum.

Maybe you are looking for

  • Outlook

    Hi all Very frustrating, I moved just from PC to Mac, and overall, I'm very happy however, I have a problem with Outlook. When I try to delete, and email using the 'X' option does not delete and of then two 'X' appear!  The only way to remove them is

  • Why the rejection of multiple photos doesn't work anymore when you change pictures?

    Why the rejection of multiple photos doesn't work anymore when you change pictures? Does anyone else have this problem? It works on my other Mac but just stop working on my computer laptop pro, I have the latest OS and it worked until a few weeks ago

  • After say - and reconnecting battery CMOS, power supply T400s has stopped working

    Hi all A few days ago, I had to say and then plug back the CMOS battery. After putting my T400s back together, the power supply in power did not work more (the computer is plugged in and power cable works fine with other computers, but it will not pr

  • Identification of novice system

    I'm new to the identification system (as both a concept and a tool box!), someone has suggestions I can begin to familiarize themselves with it? I'll make both linear and non-linear identifications during the project, I am working on, but unfortunate

  • Strange crashes: unable to solve

    I had problems with Windows 7 crashing a lot over the past two days. About 6 or so times, my computer froze everything and is completely unresponsive. This may not be related to any individual act or process such that it can happen in the workplace o