Trying to get dll calls to work like c++

Hi,
I understand there have been many posts about dll files.  I have reviewed them and found nothing that helps me.  I have a segment of c++ code that communicates with a digital correlator, reading data from it.  The c++ code works fine, but when I wrote the code in Labview, I get results that are reasonable sometimes....sometimes I get good data, sometimes odd data, and sometimes no data.  The c++ code ALWAYS yields good data.  The function prototypes in each of the call library functions matches that in the c++ code. 
The C++ code is attached.
NOTE THAT there are a few things (like calculating delay times and writing to file I don't do in the labview code).
The labview code never outputs any values in TraceA or TraceB, which should be values around 300,000.  The DLL location is set correctly, as evidenced by the fact that the code works....just not consistently.
Any help would be greatly appreciated.
Josh
Attachments:
Correlator.vi ‏38 KB
sample.cpp ‏6 KB

Your message is very clear!
I have no idea how the fact that this particular code was made to work would help you unless you try to use the same DLL which would seem rather strange. As to what the OP posters problem was:
One has to provide buffers to DLL functions for ALL parameters when one calls them. Yes LabVIEW does take care about buffer allocations everywhere else so you don't have to worry about that, but when calling C code, LabVIEW can't even guess what buffers the function may need. And therefore it correctly doesn't try to guess at all.
Those arrays that the function should write into, have to be allocated BEFORE one calls the function. It's the single most problem why DLL calls don't work as expected either returning rubbish or crashing. And anyone claiming to have read all the posts about DLL calling on this board or also on lavag.org should have gotten across at least two dozen messages from me where I pointed that out and explained it in detail.
in detail: The graph arrays do get initialized but in the same frame all control get initialized to default. That is completely wrong! one does either one or the other but not both and definitly not in the same frame because of uncertainety which is executed first.
nTrace is initialized to 0 and then used as indication in the CallLibrary Node, how large the array needs to be. Well a 0 element array is just that an array of no content, therefore a buffer that can hold no information and therefore it's sheer unluck that the Call Library Node doesn't crash.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions

Similar Messages

  • Trying to get my old macbook working like new again.

    I have an old black laptop, probably around 2005/6 not too sure. I dont really have any of the manuals or any of the disks anymore.
    I think from years of use from a teenage girl (and a few new batteries) its giving up. It become really really slow and its got to the point where its quicker to use my phone for things or the horrible computers at college.
    Really was thinking of wiping it completely clean which i was hoping would give it a new lease of life. I know all my passwords for things like facebook and my emails, i have an external drive i can copy all my files that i need onto, whats the next step?
    There is noting apart from photograhs and a few word doc's that i need. I am running version 10.6.8 2GHz Intel Core 2 Duo 2 GB 667 MHz DDR2 SDRAM.

    No, but Apple is selling the disk on their store website.

  • I have an ipod touch 2nd generation, i'm trying to get apps that will work and i cant find any. Its says i need an update because it has ios 3.1.3 , but on itunes it says there is no update ? what apps can i get??

    i have an ipod touch 2nd generation, i'm trying to get apps that will work and i cant find any. Its says i need an update because it has ios 3.1.3 , but on itunes it says there is no update ? what apps can i get??

    Sounds like you actually have a 1st generation as those cannot update beyond iOS 3.1.3.
    Model Identifier Utility
    rachelfromnorthumberland wrote:
    what apps can i get??
    Finding iOS Apps Compatible with Older Devices

  • My Pro Tools program was damaged by the Creative Cloud system. I was invited to install and try the Cloud,but it did me a great dis-service and has set me back in Production and personal time trying to get my pro Tools working again. I am really disappoin

    My Pro Tools program was damaged by the Creative Cloud system.
    I was invited to install and try the Cloud,but it did me a great dis-service and has set me back in Production and personal time trying to get my pro Tools working again. I am really disappointed and would like you to advise me how to restore my program to its working state. I am in a traumatic state since I have Artistes life work being processed in the Pro Tools 9 Program. Help! Help! Please.Ps. I tried reinstalling the software from the Disc....Still NOT working.

    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • I am using an I phone 5 in Germany and trying to get text messaging to work through the hands free Bluetooth connection on a Honda CRV. It keeps telling me that text messaging is not a feature of my phone. messages come in on the phone.How to resolve ?

    I am using an I phone 5 in Germany and trying to get text messaging to work through the hands free Bluetooth connection on a Honda CRV. It keeps telling me that text messaging is not a feature of my phone. messages come in on the phone.How to resolve ?

    mono 8 bit 8k is 64kbps, yes. 8 bits times 8,000 = 64,000 = 64k bits/sec.
    And yes I think that's a typo - there's no such thing as 'Mone' that I've ever heard of...
    But you might want to check to find out if this is a mu-law non-linear format, possibly - there are several ways that 8 bit 8k wav files can be encoded, and typically phone systems don't use linear ones. If you have a log-in to Zultys' user-base system they have an FAQ there, I believe - the answer might be in that, and it won't cost $500.

  • I am trying to get my printer to work.

    I am trying to get my printer to work. It is a Canon MP240, it does not show up in the printers menu. Though it is plugged in via USB.

    This printer does have a driver available via Software Update, meaning that when you connect the printer to the Mac via USB cable the driver should be downloaded and installed automatically for you. Of course this will not occur if the Mac cannot detect the printer at the end of the cable. So if you open Print & Scan, select to Add and the MP240 is not shown in the Default Add Printer view then there could be a problem with the USB cable or with the printer.
    To double-check if the printer can be seen by the Mac, open System Information and under the Hardware entry in the sidebar, select USB. Then in the top right pane you will see all the USB connections on your Mac and what is currently connected to them. If the MP240 is not shown, then try moving the cable to a different USB port on the Mac. And don't use a USB hub or the USB port on the keyboard. If moving doesn't help the printer appear under one of the USB busses, then try a different USB cable. If that still doesn't help, turn off the power to the printer and unplug the power cord for 10 minutes before reconnecting and turning it back on.

  • HT201363 my rescue me email is no longer active. trying to get a call scheduled but it says all the numbers i enter are not valid.....help!!

    my rescue me email is no longer active. trying to get a call scheduled but it says all the numbers i enter are not valid.....help!!

    Hi aj_russ,
    As long as you still have access to your Apple ID account, you should be able to change or edit the Rescue email address associated with your security questions. You may find the following article helpful:
    Apple Support: Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/ht5312
    Regards,
    - Brenden

  • Im trying to get my imessage to work on my iphone4

    im trying to get my imessege to work on my iphone4,i set up the account and did everything by the book .
    the imessege works fine on my macbook but dont seem to work on my iphone .
    i allways had this probleme on my iphone but recently i upgraded my ios to ios 7 and it didnt made any diference .
    please help....

    This may be of use,
    http://support.apple.com/kb/HT4527

  • Beginner trying to get my beans to work with jsp on tomcat

    Please help me open my eyes!
    I know this is a stupid oversight on my part, but I've been working for days on getting other things to work on my tomcat server, so I'm out of ideas on this one.
    I've followed all the tomcat docs instructions on where to put my jsp and bean files and set my classpath to where my beans are located. jsps work fine for me but when I try to run this jsp that uses my CalcBean, I get this and similar internal server errors:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 1 in the jsp file: /jsp/calc/calculate.jsp
    Generated servlet error:
    C:\jakarta-tomcat-4.0\work\Standalone\localhost\research\jsp\calc\calculate$jsp.java:56: Class org.apache.jsp.CalcBean not found.
    CalcBean calc = null;
    ^
    Do I need to register my bean somewhere like web.xml?
    Thanks so much in advance for any help!!

    rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww

  • I am trying to get TRON-Legacy to work on itunes......

    I have been trying to get the TRON-Legacy soundtrack to work on Itunes and it isn't reading, or doing the internet download that it needs to do to aquire the music and such. I have tried multiple times and have had no success.
    Can someone help me?
    Thanks!

    I'm assuming this is the iPod Touch, since that is the only iPod that accesses the iTunes store. I would recommend you post this here https://discussions.apple.com/community/ipod/ipod_touch

  • OS Win XP, trying to get phone modem to work

    ''locking as a duplicate - https://support.mozilla.com/en-US/questions/867405''
    Desk top computer with Windows XP OS, I am trying to get the 56K phone modem to work. Any suggestions?

    That is extremely vague.
    Maybe if you were t provide some information, any information, then someone could help.

  • I'm trying to get built-in microphone working on Satellite C850

    Dear Forum
    I am trying to get the built-in microphone working on my C850.
    Nothing is recorded if I use the sound recorder utility.
    In the Recording tab the only microphone listed is a Realtek High definition Audio which is set as the default device, is enabled and mute is off.
    Should this be an internal microphone?
    Any suggestions will be greatly appreciated.

    > While researching this I saw screenshots where the microphone was listed as 'Internal Microphone'. In my laptop it is listed as 'Realtek High Definition Audio'. Could my laptop not 'know' that it has a built-in microphone?
    Obviously the notebook supports the Realtek HD audio driver.
    I would recommend you to download and to install the latest Realtek HD audio driver which you could download directly from the Realtek page: http://www.realtek.com.tw/downloads/

  • Trying to get 'External Sample Editor' working.

    Hello,
    I cannot find anything in the manual about changing preferences as to what editor you are using. I found the key command and tried to get DP as my external but once I saw that wasn't going to work I couldn't find any possible way to change my choice of editor. There seems to be no preference or menu that would let you pick a new one. Is my only choice to complete trash prefs and rebuild everything? Not a huge ordeal but tedious none the less.
    Chris

    It's a lot easier than that.
    On my system there is an alias :
    ~/Library/Preferences/Logic/External Sample Editor
    You could try removing the file from it's location or going about the 'select new original method.

  • [SOLVED] trying to get Heros of Newerth working

    hello ive just installed Arch Linux and i cant seem to get Heros of Newerth working
    ive tried installiing it through the ABS but it fails to launch and with the client from the HON website i get the following error
    warning: The VAD has been replaced by a hack pending a complete rewrite
    K2 - Fatal Error: Couldn't load vid_gl2
    i am using the official nvidia driver with both the 64 bit and 32 bit libs installed. Any help would be appreciated
    Last edited by jwenzel2 (2012-10-31 01:55:14)

    Do you really think people can magically know what your system is? I mean, what do you even expect. You give 1 bit of info (nvida) and expect people to be able to help you. Are you serious?
    Provide at least these: lspci, lshw -C video, lshw -short, glxinfo|grep -i rend, pacman -Qs mesa, pacman -Qs nvidia, pacman -Qi linux, uname -a

  • Help,I am trying to get function calls from a flash file within an embedded SMIL file to work with Netscape.

    Basically, the functions are on the html document in which the SMIL file is embedded and the flash file within the SMIL file calls the function from a button.
    The code on the html doc determines whether the browser is Netscape or IE and then executes the appropriate code. For ex. for Netscape the function is:
    document.radio.SetSource('video.smi')
    and for IE the function is:
    radio.SetSource('video.smi')
    All the function calls work fine in IE but in Netscape it does nothing.

    Basically, the functions are on the html document in which the SMIL file is embedded and the flash file within the SMIL file calls the function from a button.
    The code on the html doc determines whether the browser is Netscape or IE and then executes the appropriate code. For ex. for Netscape the function is:
    document.radio.SetSource('video.smi')
    and for IE the function is:
    radio.SetSource('video.smi')
    All the function calls work fine in IE but in Netscape it does nothing.

Maybe you are looking for

  • Can iTunes or QuickTime be forced to install on a 64 bit Windows OS?

    I have used both QuickTime and iTunes on Windows 2000 Server (full updated) with no problems. A recent computer disaster caused me to get a newer machine and I chose one with dual opteron processors, and I installed Windows 2003 Server x 64 as the op

  • Download ie8 and now i can't bring up any ie

    I downloaded ie8.....now when i push on the icon for ie...it starts to bring up the web page and then crashes and disappears...i have looked in my remove programs...but there is not ie8 there to remove....i have the internet.....i can bring up my yah

  • Can't get Airport to join a network

    Hi, all - I have a G5 PowerPC running the latest and greatest. I connect to the Internet via a 2Wire modem. My G5 is connected via Ethernet. All is OK, except... ...when I try to join my modem's network, I get either a bad password or timeout message

  • Help me a idea about java - IE please

    I know how to use JAVA to open i web page. But does any one know , how to submit a form on this web, and close it? For example, this form is on the web. When i run, it will fill some text, and then click the sumbit button, and then close the IE. Anyo

  • Chunk expression .color returning error

    Greetings, this one shoudl be so simple it is driving me crazy. I'm trying to test and set the color of a word in a text field, containing ten comma separated words, as follows in Dir 8.5 message window: put member("test").text -- "one, two, three, f