Passing array of large piles of CLN fails

Hello

I am trying to pass an array of clusters to a DLL, but it is not passed correctly. I spent a few similar to this (although smaller) clusters without any problems before, but somehow it doesn't line up properly or something. What I'm trying to do is by the way a table of items followed by an information structure. The length of the array is the nItems parameter in the information structure. The problem is that when reading nItems in CPP code, that it is not with the value passed as you can see in the log file by pressing and the assertion error. This indicates that the structures are not transmitted correctly.

It seems to me that the cluster corresponds to struct definitions and I'm sure that I use the correct settings in the CARS. I had trouble before with large bouquets where labview can get confused and I'd get instane questions objects but I don't know if that's the problem here.

h file

#pragma pack(4)
typedef struct TKdlgItemVal
{
    int intVal;
    double  doubleVal;
    char    szVal[256];
} TKdlgItemVal;

typedef struct TKdlgItemConf
{
    int     nType;                  // The item type code (see below), replaces nParam2
    double  dX;                     // Item x position or 0 for default layout (was dParam1)
    double  dY;                     // Item y position or 0 for default layout (was dParam2)
    char    szText[256];            // The prompt string for the item, following | then tooltip is optional
    double  dWide;                  // Item width in dialog units.
    double  dHigh;                  // Item height for group boxes only.
    double  dLo;                    // Item value limits for reals and integers.
    double  dHi;
    double  dSpin;                  // Spinner value or zero for no spinner.
    int     nPre;                   // Precision for real items & max chars for string (0 for don't care).
    char    szList[1024];           // Selector list - items separated by | char. Required for list type.
    char    szLegal[256];           // Legal characters for string type, leave blank for all legal.
    TKdlgItemVal    sDlgItemVal;
} TKdlgItemConf;

typedef struct TKdlgInfoConf
{
    int     nItems;                         // The number of dialog items
    double      dWide;                          // Dialog width
    double      dHigh;                          // Dialog height
    char        szTitle[60];                    // The dialog title
} TKdlgInfoConf;
#pragma pack()

extern "C"  __declspec(dllexport) int setS2Dlg(TKdlgItemConf asDlgItems[], TKdlgInfoConf sDlgInfo);

CPP file

extern "C" __declspec(dllexport) int setS2Dlg(TKdlgItemConf asDlgItems[], TKdlgInfoConf sDlgInfo)
{
    std::ofstream myfile;
    std::vector    m_asDlgItems;
    myfile.open ("logger.txt", std::ios::out | std::ios::app);
    myfile<<"NItems: "<

Thanks in advance,

M

I wish I could delete this post because I feel very stupid. It was a simple case of transmitting a cluster to the CLN, but I forgot to set the parameters in the c code pointer rather than pass by value...

Tags: NI Software

Similar Questions

  • error when pass array 1 d by data in table pointer via Labview-built c++ dll

    I'm trying to generate a Labview VI to a DLL and let it be invoked by vc ++, by which a 1 d array is passed. However, I can't generate the DLL when you use the data pointer to the table, which gives the error like below:

    [ERROR]
    Code :-2147221480
    Strengthening of the DLL.
    Error when compiling the DLL as a function name or a parameter is illegal. Check function and parameter names are legal C identifiers and are not inconsistent with the LabVIEW headers.
    Additional information: 9 project link errors
    Type Library generate error. MIDL.exe failed during the compilation of the odl file used to create the type library.
    Note: The error indicates that the odl file has unknown types. This error is possible when
    works with non-standard types is exported using the method qualifier exporting files in
    release the configuration that have not been recompiled during the build process.

    The Prototype of VI define is as below

    But, if I use the pointer to manage through the table, the generation is successful, error-free. I write something to call the DLL built labview, which basically reads 1000 double the data of an instrument.

    #include "TestDQMaxDLL.h"
    #include 
    
    using namespace std;
    
    int main(int argc, char** argv) {
        cout << "Start testing DQMax DLL" << endl;
    
        int leng{ 1000 };
        DoubleArray rawDPData = AllocateDoubleArray(leng);
        test_dqmax_dll(&rawDPData);
        cout << "Successfully invoked the DLL!" << endl;
        cout << "DoubleArray.len: " << (*rawDPData)->dimSize << endl;
        for (int i = 0; i < leng; i++)
        {
            cout << (*(rawDPData + i))->elt[0] << "\t";
            if (0 == i % 10)
            cout << endl;
        }
    
        system("pause");
    
        DeAllocateDoubleArray(&rawDPData);
    }
    

    But the printed results are not correct.

    My questions are:

    1. why cannot generate DLLS with the data of table pointer. In this case, the argument of the function is as simple as a double array.

    2. for table handle pointer, when the resutls are incorrect and how to get the good ones.

    Any comments would be appreciated.

    BTW: I use Labview 2012 with Visual c ++ 2013 on Windows7 64 bit.

    I never needed to pass a table of LabVIEW handle external code. Search this forum for posts of RolfK, it is most likely to have posted such an example. I recommend that you keep things simple and remodelling your table a table 1 d 2D before moving on to external code and manage as a 1 d table (it's just a little extra math).

    Sorry I don't have a solution on why you can't build with a 1 d as a pointer of table table. If you post your project I'm happy to try to build (I'm on LabVIEW 2012, however), but as you said, it will rely on another machine, it seems more likely to be a problem with something on the specific computer where there is a problem.

  • Passing arrays in function in a dll

    Hello

    I have a dll below function

    FI_API uint8_t FI_capture_settings_init_wrapper (uint32_t * cap_set, uint32_t sen_set *, uint32_t * rec_set uint32_t * exp_set)
    {

    * cap_set = (uint32_t) 55;

    *(cap_set+1) = (uint32_t) 56;
    cap_set [2] = (uint32_t) 57;
    sen_set [0] = 54;

    Return 1;

    }

    I call the function of library in labview. I initialize a global array of variables and pass it to the FI_capture_settings_init_wrapper(). After, I display the values in the table an indicator table as shown in the picture. The value is supposed to change in Labview. The API returns a value. But the table is not changed in labview. Please see my camerainit.vi

    Your shared variable is an external resource that contains data, so when you read the excerpt from LabVIEW variable, shared data and copies in a local array, which is then passed to the DLL function. Because the table is not used after the call to the DLL, it is simply thrown then. Then you read the shared variable and LabVIEW retrieves its data, which has not been changed since and copy them again in a local array to show on front panel indicator. If you want the shared variable to represent the new data, you must rewrite the right Terminal to the explicitedly compose the node of the library in the shared variable. And the variable shared again just after reading is obviously completely false performance wise since the wire that came out the library node call already contains data and should therefore be wired by later use.

    If your first problem is that you treat a shared variable as something that LabVIEW could be considered as an internal pointer that she cannot, the shared variable is hosted by the shared variable engine, which is a separate process and data access is on a TCP/IP based protocol. Even if it is a control on the front panel the code would that he should do, since LabVIEW as a data flow language will copy the data of the control in a local array and passing to the DLL, and unless you're writing the changed data that comes out of the right side of the rear Terminal in the control the data in the control will NOT change.

    Then learn how data flow programming! LabVIEW is generally not about data as a reference that can be modified by reference to a function. Whenever LabVIEW suspect a function might modify the data passed in, it MUST create a copy of the data so don't up don't not the concept of stream which is the fundamental basis of LabVIEW programming by the window. Forget shared, globals variables and build local even in LabVIEW as a general programming, especially when you come from a traditional programming language such as C (++), VB or c#. A thread of LabVIEW is THE variable, and you should only use global and local variables if it is strictly necessary for something. Especially a shared variable as an external resource connected through TCP/IP is a killer of absolute performance and should only be used if you need to transfer and access the data between different (possibly the network connected) process.

  • Asking how I can pass array generated using the registry to offset at the end of the iteration of a loop in the beginning of a new iteration?

    Hi guys,.

    I currently have a problem in my Final project of the year at the Nanyang Technological University, Singapore.

    Basically, currently I develop a Lab View 2009 comb filter (attachment: filter2.vi correct comb)

    Entry into the comb filter is delivered in lots of 1000 samples.

    However, I'm supposed to process data on a continuous basis.

    Basically, my comb filter takes the difference between the current sample (sample t number) and the number of the sample (t-40) and divides the result by the square root of 2.

    The problem is that for the second lot from, I have to take the difference between each sample 40 first the current batch for each sample 40 last of the previous batch. My program currently cannot deal with this problem since it can not pass the 40 sample past the current batch in the batch so that we can perform this task. I tested it using test comb filter.vi (attached).

    Could anyone help with a suggestion?

    I would really appreciate since the approach of the project deadline.

    Thanks before.

    Kind regards

    Agus Frédéric

    School of mechanical and aerospace engineering

    Nanyang Technological University

    Send samples of past 40 current a shift register. When you read then it's going to be the last 40 precedents.

    Then subtract previous last 40 40 first current and divide. Fact.

    Basically, as indicated in attached vi.

    /Y

  • SPA112: impossible to pass to 1.4.1 firmware (update failed)

    Hello

    I recently updated the firmware from a dozen of SPA112 to 1.4.1. Everything worked well, except one. Even after a power cycle, always reports "Upgrade failed". It displays the following system information:

    Model: SPA112, 2 FXS
    Hardware Version: 1.0.0
    Boot Version: 1.3.1 (December 11, 2013 - 11:38:47)
    Firmware version: 1.3.5 (004) July 31, 2014
    The Firmware recovery: 1.0.1 (005)
    Serial number: CBT154009VM

    I found it's my only camera with the greater than 1.0.x version of start. It upgrades only to the version of the firmware 1.3.5.

    Y at - it incompatible with the firmware 1.4.1 and the starting version 1.3.1?

    Thank you for your support.

    Christoph

    No such problems known (as I know). Make sure that the upgrade file is complete and intact (older firmware may not detect some types of changes):

    Payton_1.4.1_002_102615_1042_pfmwr.bin
    SHA256 = 595bb908e9223daafc68e0615c793bf65d3ae393b0ae77fdfe0b9d67b88f5911
    SHA1 : c3a3ebb7029e5c41333ee1d6a09ae9a2e732d005
    MD5 : 74dd18427f94bc76ae2e08bb0dbddcda
    SIZE : 9961864
    If not changed then turn on syslog & debug (highest level) and capture him during the upgrade. It may disclose the real cause of the failure to upgrade.
  • How to pass Array Collection to the test?

    Hello

    I'm going through the c# collection (ArrayList) of application object in TS. I output value assigned in TS container, but when executing end of sequence, then an error occurred: "value specified to not the expected type".

    What should I do to get full access to my ArrayList? What kind of type of variables should I assigned ArrayList?

    Thanks for the help anyway.

    Piotr

    Hello

    It should work if you use ObjectReference rather a container

    Discover this simple example

    Concerning

    Jürgen

  • Best way to pass an array between TestStand, CVI

    Hello

    I was not able to judge or to find the best practice to pass arrays between TestStand and CVI. I'd preferably done in pass pointer to array. For example, if I have a function written in CVI DLLs:

    int GetAverage (double* aBuffer, double aSize, double* aAverage)
    

    TS I have an aBuffer double array [100]:

    -I can't simply pass

    GetAverage (aBuffer, 100, &aAverage)
    

    - or, I can go:

    GetAverage (&aBuffer[0], 100, &aAverage)
    

    -The only thing that is TestStand accepts:

    GetAverage (aBuffer[100], 100, &aAverage)
    

    I don't think not good because the size is just repeated.

    I had no problem if I could write

    GetAverage (aBuffer[100], &aAverage)
    

    but the problem is in this case there is no possibility fo CVI to determine the size of the table, like sizeof (aBuffer) just return, sizeof (double).

    Can you provide me with advice for best programming practices in this case?

    Concerning

    RB

    Hello

    Just in addition:

    Is there another way to access the tables.

    Often, I use for this task, the TS-API. The only parameter you need is in this context of the sequence.

    Maybe you should also visit this example:

    TestStand 2010\Examples\AccessingArraysUsingAPI\UsingCVI\AccessingArrays.seq

    Concerning

    Jürgen

  • Pass the array to the formula node Eval (any chance to avoid this?)

    Hello

    I have not installed on my PC of MATLAB.

    I need to be able to say from the entry Panel custom formula "y = sin(Fm*2*pi*t[i]) + 2 * sin(3*Fm*2*pi*t[i]) + 3 * sin(4*Fm*2*pi*t[i])..."

    This form may contain a variable of harmonics (sine or cosine functions), but strict number of input parameters: Fm, t [i].

    FM - is a frequency.

    [i] t - is a time (ramp model) which is a table

    Can I pass array as a parameter of t [i] entry in formula node? How to do what other parameters, which are constants?

    Is there another method how to implement this - using the variable functions count?

    You are still far too complicated and it's still not scalable for a variable number of terms. You must be able to get out of math based text and think in terms of real LabVIEW.

    Here's a quick example using the terms in your first post (I show only a picture, because I have more LabVIEW 7.1).

    Modify if needed.

    NOTE:

    If you have more than a couple of terms generally, I tenacious feel that it would be simpler to configure a table complex stick (with the desired amplitude and frequency positions) and do an inverse FFT on this.

  • 'Pass' or 'Fail', based on another field?

    Enter this script so a field (field1) enters the 'success' or 'Failure' as a number of Field2 is < 2 or > 1? Can I get into this as a custom in Field1 calculation?

    You need to give more information on exactly when you want to 'Pass' or 'Fail' to display.

    If you want to display "Pass" If the value is > 2 and 'Fail' if it is< 1,="" try="">

    For Text1 custom calculation script

    var F1 = this.getField("Text1").value;

    var F2 = this.getField("Text2").value;

    Do Text1 white if Text2 is > 1 and< 2="" or="" is="">

    If (((f2 > 1) & (f2))< 2))="" ||="" (f2="">

    F1 = « » ;

    }

    Pass if Text1 Text2 > 2

    ElseIf (f2 > 2) {}

    F1 = "Pass";

    }

    Do Text1 fail if Text2<>

    ElseIf (f2<>

    F1 = "Fail";

    }

    Display result in Text1

    Event.Value = f1

    You need to replace 'Text1' and 'Text2' with the names of the fields in your form.

  • Failed to connect to the SQL Server integrated with foglight

    Hi all

    I try to connect with MS SQL Server embedded foglight Management Server and failed to do so due to the error below. Could someone help me on this ASAP:

    org.springframework.beans.factory.BeanCreationException: error creating bean with name "foglight-core-services" defined in the URL [jar:file:/E:/Quest_Software/Foglight/server/default/tmp/deploy/tmp7024790750014228181foglight.sar!/com/quest/nitro/service/core-beanref.0.ctx.xml]: instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: error creating bean with name 'exporting' defined in the [com/quest/nitro/service/common.ctx.xml] class path resource: calling the init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: error creating bean with name "com.quest.nitro:service = Licensing" defined in the [com/quest/nitro/service/core-services.0.ctx.xml] class path resource: calling the init method failed; nested exception is org.hibernate.exception.DataException: could not execute the query

    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)

    to org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$ 1.run(AbstractAutowireCapableBeanFactory.java:409)

    at java.security.AccessController.doPrivileged (Native Method)

    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

    to org.springframework.beans.factory.support.AbstractBeanFactory$ 1.getObject(AbstractBeanFactory.java:264)

    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)

    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)

    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)

    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)

    at org.springframework.context.access.ContextSingletonBeanFactoryLocator.initializeDefinition(ContextSingletonBeanFactoryLocator.java:141)

    at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:384)

    ... more than 165

    Caused by: org.springframework.beans.BeanInstantiationException: could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: error creating bean with name 'exporting' defined in the [com/quest/nitro/service/common.ctx.xml] class path resource: calling the init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: error creating bean with name "com.quest.nitro:service = Licensing" defined in the [com/quest/nitro/service/core-services.0.ctx.xml] class path resource: calling the init method failed; nested exception is org.hibernate.exception.DataException: could not execute the query

    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)

    to

    Kind regards

    Shiva

    Hello

    It is probably part of a larger battery error (if you can download the zipped file of complete log we can see if something is visible).

    This is a new installation or and upgrade or displacement of FMS? What version do you use?

    Have you tried to stop the foglight server, make sure that the DB is down too and then restart?

    There are articles describing errors as part of a larger pile of errors.

    This article KB https://support.quest.com/SolutionDetail.aspx?id=SOL64412 talks to ip in the hosts file is not wrong

    Other articles describing similar problems:

    There is an article describing a bug that has been fixed at https://support.quest.com/SolutionDetail.aspx?id=SOL63134

    Another speaks of a problem with the Storage Manager service https://support.quest.com/SolutionDetail.aspx?id=SOL73892

    With the attached log file we can see more information, I recommend also the opening of a case of pension because they can help solve the problem in a more interactive way.

    I hope this helps.

    Golan

  • Problem of Array.prototype

    Hi all

    What is the problem with this code I get the below error?

    Array.prototype.pushUnique = function (a: Array): void {}
    var l:Number = this.length;
    var exist: Boolean = false;

    for (var i: int = 0; i < l; i ++) {}
    If (this [i] [0] == [0]) {}
    There = true;
    }
    }
    If (! exists) {}
    This.push (a);
    }
    }

    I call it like this:

    allBlobsArray.pushUnique (tempArr);

    Finally, I get an error:

    TypeError: Error #1034: Type coercion failed: cannot convert function-2499 in flash.events.InvokeEvent.
    at mx.core::WindowedApplication/dispatchPendingInvokes() [E:\dev\3.0.x\frameworks\projects\ai rframework\src\mx\core\WindowedApplication.as:2539]
    at mx.core::WindowedApplication/enterFrameHandler() [E:\dev\3.0.x\frameworks\projects\airfram ework\src\mx\core\WindowedApplication.as:2526]

    More on:

    Array.prototype.pushUnique = function (a: Array): void {}
    var l:Number = this.length;
    var exist: Boolean = false;
    //
    for (var i: int = 0; i < l; i ++) {}
    Debug.Warning ("in GetConfigData");
    $temp_arr:Array = this [i];
    If (this [i] [0] == [0]) {}
    There = true;
    //                }
    //            }
    If (! exists) {}
    Debug.Warning ("pushDone tabLenght =" + l);
    Debug.Warning (a);
    This.push (a);
    //            }
    }

    Gives me the same error.

    Concerning

    Christoferek

    Hi again,

    I must say, the way you do the audit is turn off the hood... Did you write that yourself or did you find some wrong resources somewhere? I think you're the first guy I've seen for some time to use prototype AS 3.0; This method is really not cool. Why don't you simply do something like this:

    package
    {
        import flash.display.Sprite;
    
        public class ArrayExample extends Sprite
        {
            private var _arr:Array = new Array();
    
            public function ArrayExample()
            {
                // Add some items to the list.
                trace("Added to the list: " + pushUnique("a", _arr));
                trace("Added to the list: " + pushUnique("b", _arr));
                trace("Added to the list: " + pushUnique("c", _arr));
                trace("Added to the list: " + pushUnique("a", _arr));
                trace("Added to the list: " + pushUnique("a", _arr));
                trace("Added to the list: " + pushUnique("b", _arr));
                trace("Added to the list: " + pushUnique("d", _arr));
    
                // Display the final list content.
                trace("Final list values: " + _arr.valueOf());
            }
    
            /**
            * Check if the passed Object exists in the passed Array.
            *
            * @param value The value that you want to check to the Array.
            * @param arr The list of values.
            *
            * @ return Returns false if the object alread exists in the Array; else,
            * it pushes the new value into the Array and returns true to signal the success.
            */
            public function pushUnique(value:Object, arr:Array):Boolean
            {
                // If the Array if empty then add the item and return true.
                if (arr.length == 0)
                {
                    arr.push(value);
                    return true;
                }
    
                // Check if the value already exists in the list.
                var timesFound:int = 0;
                for each (var item:Object in arr)
                    if (item == value)
                        timesFound++;
    
                // If it hasn't found then add it to the list; else, return false.
                if (timesFound == 0)
                {
                    arr.push(value);
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
    }
    

    Better yet, you can create a utility class that implements the pushUnique method in the same fassion and reuse it in all your projects. You might also take some logic out, may just return 'true' or 'false' if the object exist and decide to another place if you want to add to the list, or do something else with the received information. It will be useful.

    Kind regards

    Barna Biro

    Blog: http://blog.wisebisoft.com

  • All my downloads on ~ 200 MB either fail or end up corrupted

    Whenever I try to download something that size ~ 200 MB or higher, it will take several (5-10 +) try to download successfully. The download will fail somewhere in the middle of the process, or it "will end" as soon as it should, and when I try to open it, it eventually corrupt. I tried to restart/reset firefox in the past, but the larger downloads will still fail almost always in some way.

    Another issue that is somewhat related to this, is that my internet speed always seems to register. It is supposed to be 6 Mbps, but once it reaches about 500 Kbps, it descends slowly until it is approximately 156-180 kbit / s. sometimes, he will return at top speed, but only momentarily. I had this problem of download with anything other than firefox, like steam. I power cycle my router on a regular basis, given that often speeds will reach a ridiculous level, so its restart has really solved this problem.

    PS I know the difference between a Megabit (Mb) and a megabyte (MB) and so on, so I do not typos in speeds, just in case anyone is wondering.

    Try cleaning your cache, try to free up space, try firefox in safe mode

  • Pavilion Memory Test failed., ID 64W662-5066J2-XD7XGK-400V03 failure

    Crash... The BIOS memory test passes, but the HP Diagnostic memory test fails with the ID 64W662-5066J2-XD7XGK-400V03 failure.  Product ID VM298UA #ABA.  Any ideas?

    Hello

    Try the following.

    First, download the Memtest Image file (.) (ISO) on the following link.

    http://www.memtest.org/download/4.20/Memtest86+-4.20.ISO.zip

    It is a zipped file, if you do not have an extraction utility installed, download and install 7-Zip.  Please note that If you have a 64-bit installation, download and install the Installer x 64 64-bit .msi on the link below.

    http://www.7-zip.org/

    Then, right-click on the zipped file, select Extract 7 - Zip, select the files and then click Ok.  Open the newly extracted folder to find the Memtest Image.

    Now, you will need to use an application like ImgBurn to burn the ISO correctly on a blank CD - a guide on the use of ImgBurn to write that an ISO on a disc is here.

    When you created the CD, shut down the laptop.  Tap the escape key when you rewind to enter the Boot Menu.  Insert the Memtest CD.  Select 'Options of Boot' (usually f9), use the arrow keys to select the CD/DVD drive and press ENTER to boot from the disc.

    At least 3-4 passes and see if errors are found.

    Kind regards

    DP - K

  • allocation of an array of 2d in labVIEW and move to the DLL function to obtain data

    Hi all!

    I searched a lot about this, but one cannot find any solution. Please find attached the vi that I try to get a unit of 32 channels data,

    100000 samples per channel with 14-bit resolution. And please also find enclosed the header for my dll file. (in the header, it is the GetBuffers function).

    There is not a lot of data, it is a little more then 6 MB in the task of LAbVIEW Manager eats about 30 MB more memory, then it should. Are there explanations why?

    Because there is much more data in a single channel (million samples or more)

    Then I will try to allocate a 2D to data array, but when I try to run my LabVIEW vi crashes.

    Could you please help?

    Best regards

    Tomzi

    Dear Tomzi!

    To allocate the data in a table in LabVIEW, you must always initialize, as in a you must have a valid entry on cell (x-, y - 1) have a size of table of (x, y). It is usually best to use the function Array initialized for this purpose.

    There are ways to pass arrays 2D to DLLs, cand find you examples of both in examples > communicate with external Applications > external Code using the > integrating DLLs > DLL.vi call. Basically, LabVIEW can pass in the form of a big table 1 d 2D tables, so you'll need to spend too much table size index it. If you pass the array 2D handles it is preferable to use the typedef that LabVIEW generates for you, something along the lines of

    / * LabVIEW created typedef * /.
    typedef struct {}
    Int32 dimSizes [2];
    Double elt [1];
    } TD1;
    typedef TD1 * TD1Hdl;

    I hope this helps.

    Best regards:

    Andrew Valko

    NOR Hungary

  • How Labview grab handles in the array?

    I have an array of large 2by2, and I do a lot of travel such as the removal of the top row and add the data to rank the lowest. The size of the array never changes, but I manipulate the data a bit.

    My question is: how Labview manages this manipulation? Is this just smart enough to manipulate pointers rather than copy the values over and over again?

    I'm looking at the interface with the dll, and it would seem that Labview for a 2by2 arry have only a pointer to all the numbers such that the number is simply distributed over a block of memory. Is Labview all done with any size chart? Just store in a large part?

    Thank you!

    d1sturbanc3 wrote:

    I have an array of large 2by2, and I do a lot of travel such as the removal of the top row and add the data to rank the lowest. The size of the array never changes, but I manipulate the data a bit.

    My question is: how Labview manages this manipulation? Is this just smart enough to manipulate pointers rather than copy the values over and over again?

    I'm looking at the interface with the dll, and it would seem that Labview for a 2by2 arry have only a pointer to all the numbers such that the number is simply distributed over a block of memory. Is Labview all done with any size chart? Just store in much?

    Thank you!

    Yes to the most, "depends on" the rest of your questions.

    Operators of memory "inplace" you will work within a single buffer. Some of the normal array operators will do the same (replace the subset of table for example). Build table, no.

    Try to use "tools > profile > buffer Allocations... Show.

    To see where you have additional buffers in your code.

    BTW: The process using «Show the buffer...» "and then rewrite to eliminate is sometimes called"Chase points ".

    Have fun!

    Ben

Maybe you are looking for