Call 'glutInit' causes dysfunction of LabVIEW

Hello

I try to use OpenGL in LabVIEW. I have compiled my dll source code that I called LabVIEW with node library function call.  I replaced the GLUT glutMainLoop for glutMainLoopEvent of freeGLUT. It is because glutMainLoop never leaves the main loop of the OpenGL and does not return control to the calling function (LabView), the fact of glutMainLoopEvent.

When the program is run the first time it's OK; but when I run for the second time, LabView crashes and closes.

I discovered that LabVIEW crashes when in the DLL function is called:

glutInit( &argc, argv );

where

argc = 0;
char **argv = NULL;

Do you have any suggestions how to solve this problem?


Tags: NI Software

Similar Questions

  • Programming a c application that calls a *.so built by LabVIEW.

    Hi all

    This question has probably been asked, but I can't find the answer.  So here's my question:

    I built a *.so LabVIEW under Linux and I would like to call from a 'c' application  The *.so LabVIEW returns a set of strings, and I want to know how to call from my c (memory allocation?) application.

    Here's the *.so source code, the function is named "testvi":

    Here is the source code of my c application:

    #include 
    #include 
    #include "testclusterofstrings.h"
    
    int main()
    {
        Cluster_Of_Strings clusterofstrings;
    
        Testvi(&clusterofstrings);
    
        printf("-------------\n");
        printf("String_A: %s", (*clusterofstrings.String_A)->str);
        printf("-------------\n");
    
        return 0;
    }
    

    I am getting the output when calling my next application:

    LabVIEW caught fatal signal
    13.0 - received SIGSEGV
    Reason: address not mapped to the object
    Try to reference the address: 0x0x19f5c381
    Segmentation fault (core dumped)

    So, what is the right way to do it?

    Thank you

    Michel

    smithd wrote:

    If it is a dll built labview and you pass parameters by reference, I'm not too surprised to initialize (although I expect labview to be kind enough to allocate the data structures for you). Maybe if you spent it a pointer to null instead it would work? Since your original post, maybe try this:

    int main() {}

    Cluster_Of_Strings * clusterofstrings = NULL;

    Testvi(clusterofstrings);
    .... }

    For some reason, I remember reading that labview will interpret the null as a sign that it must allocate the structure, but I could be completely crazy on this point.

    If it does not, then Yes you will have to allocate all the handles according to the case. Of \cintools\extcode.h you can see that a string is defined as follows:

    typedef struct {}
    Int32 cnt; / * number of bytes following * /.
    uChar str [1]; / * cnt bytes * /.
    } LStr, * LStrPtr, * LStrHandle;

    Since you have arrays of size-0 I think you really need to call DSNewHClr(sizeof (int32)) which will allocate a handle with all 0, and 0 is what you want. End result would be...

    int main()
    {
    
        Cluster_Of_Strings MeasInfo;
    
        MeasInfo.String_A = (LStrHandle)DSNewHClr(sizeof(int32));
        MeasInfo.String_B = (LStrHandle)DSNewHClr(sizeof(int32));
    
        Testvi(&MeasInfo);
    ....
    }
    

    Oh and for string functions, make sure that you look at the built-in functions first before making your own.

    In fact, all this is as well a little easier and more complicated at the same time. LabVIEW is entirely managed with its data types, but you must follow this management contract when you interface LabVIEW C code.

    First of all, the first attempt to assign a string handle with sizeof (int32) + sizeof (uChar) bytes without initialization of the length element is bad. This element of length can contain any value and cause LabVIEW wrongly that the handle is already large enough to fill its data and not to do anything and then by writing over the end of the allocated buffer.

    Also equipped to initialize the structure with the value NULL is not going to work. This group should be provided by the appellant that this is a region of data of fixed size passed as a pointer. However, initialization of the string inside the cluster with NULL handles should work fine, since LabVIEW considers NULL manages as the canonical zero length handle.

    However after calling the LabVIEW DLL function you are the owner of all memory that is allocated by this function and comes back to you, just as you would be if you had allocated those manages yourself before the call. So label correct is also deallocate it and it is not an option, but a requirement or you create memory leaks. He isn't getting noticed here since your test program ends in any case just after, but he bite you bad in a larger application if you forgot it.

    The code would then look like this:

    int main()
    {
        Cluster_Of_Strings MeasInfo;
    
        MeasInfo.String_A = NULL;
        MeasInfo.String_B = NULL;
    
        Testvi(&MeasInfo);
    
        printf("-------------\n");
        printf("String_A: %s\n", LV_str_to_C_str(MeasInfo.String_A));
        printf("String_B: %s\n", LV_str_to_C_str(MeasInfo.String_B));
        printf("size %d", (sizeof(int32) + sizeof(uChar)));
        printf("-------------\n");
         if (MeasInfo.String_A)            DSDisposeHandle(MeasInfo.String_A);        if (MeasInfo.String_B)       DSDisposeHandle(MeasInfo.String_B);   return 0;
    }
    // Returns the pointer to the string buffer in a LabVIEW string handle that has been made// sure to be zero terminated.char *LV_str_to_C_str(LStrHandle lv_str){    if (lv_str && !NumericArrayResize(uB, 1, (UHandle*)&lv_str, LStrLen(*lv_str) + 1))    {        LStrBuf(*lv_str)[LStrLen(*lv_str)] = 0;        return LStrBuf(*lv_str);    }    return NULL;}
    
  • Problem call Matlab external function under Labview 7.1

    Hello

    I have the problem when I want to call my m.file function in the script Matlab under Labview 7.1, that labview does not seem to be able to find this external Matlab function. I searched this forum, someone talked about setting search path in the tool-> option-> Matlab search path, but it seems that it does not exist in the version 7.1.

    Is it possible to solve this problem in version 7.1 or update to the latest version, the only solution?

    Thank you

    Hello

    I think you're confusing the LabVIEW MathScript nodes and the MATLAB® script.  The MathScript node is introduced in LabVIEW 8.0 and the setting of path search that you speak to MathScript, reason why it does not exist in LabVIEW 7.1.  Look at the example of differential equation Lorenz for the MATLAB script node.  It shows how to set the path of research to be compared to the VI.  The example is found in the node of script examples\scriptnode\MATLAB - Lorenz Diff Eq.vi.

    MATLAB® is a registered trademark of The MathWorks, Inc.

    Grant M.
    Staff software engineer | LabVIEW Math & Signal Processing | National Instruments

  • The call of the TestStand of LabView modules

    Hello

    I have some dllmodules developed to be launched from TestStand and so the methods require a context of sequence as in param.

    But now I would call these modules on a computer without TestStand. I thought the call of LabView but is it possible? I do not have access to change the modules.

    You can use the TestStand Deployment Utility, located in the TestStand menu under Tools-> deploy the TestStand system

    In the TSDU, you can create an installer to deploy a workspace TestStand and tab of Setup options, you can even choose to include the TestStand engine in the installation program.

  • How to implement a callback to the help function call library function node in LabView?

    I try to call a fuction from a SDK.dll library by using the node call library feature. The SDK has been provided to

    me and I don't have the source code, just the .dll and .h files.

    The SdkSetPropertyEventHandler function has a function of recall as one of its parameters. How to apply the

    callback using the NSI node? I'm a good programmer LabView but this is my first time using the library to call

    Function node. I read all the info I can find on the web site of NOR and the discussion Forum, but can not understand

    This one out. I'm using LabView 8.6.

    The deacribes SDK.h function as:

    Function: SdkSetPropertyEventHandler

    (SdkSetPropertyEventHandler) SdkError SDKAPI
    SdkCameraRef inCameraRef,
    SdkPropertyEvent inEvnet,
    SdkPropertyEventHandler inPropertyEventHandler,
    SdkVoid * context);

    //
    Description:
    Registers a callback function to receive the status
    change the notification events for the States of property on a camera.
    //
    Parameters:
    In: inCameraRef - designate the object camera.
    inEvent - designated one or all the events will be completed.
    inPropertyEventHandler - designate the pointer to the callback
    function to receive the camera property-related events.
    inContext - designated application information must be passed
    way to the callback function. All the data necessary to
    your application can be passed.
    Output: no
    //
    Returns: A sdk errors.
    -----------------------------------------------------------------------------*/

    A separate header called SDKTypes.h file contains the following data:

    typedef SdkUInt32 SdkPropertyEvent;
    typedef SdkUInt32 SdkPropertyID;
    typedef void SdkVoid;

    typedef struct __SdkObject * SdkBaseRef;
    typedef SdkBaseRef SdkCameraRef;

    /*-----------------------------------------------------------------------------
    SdkPropertyEventHandler
    -----------------------------------------------------------------------------*/
    typedef SdkError (SDKCALLBACK * SdkPropertyEventHandler))
    SdkPropertyEvent inEvent,
    SdkPropertyID inPropertyID,
    SdkUInt32 inParam,
    SdkVoid * context);

    Thanks for your help.
    Alejandro

    Andrew_E wrote:

    Hi Rolfk,

    You are absolutely right. This article describes what you were talking about? I'm just trying to get as much information as possible on this thread if the solution is easier to find for the future. Thank you.

    Yes, but I find the idea of using .net to call a LabVIEW VI as callback function C a bit as using a roll of Steam ironing your pants. Why do it? Well the steamroller has extra security guards that make it less likely that you'll break your pants in the process, but it's not elegant IMHO.

    Write a C DLL that translates between a C callback and a user event LabVIEW using the PostLVUserEvent() of the interface of the kernel to run LabVIEW function seems so eleganter for me. Yes, it's a bit of programming in C, but good!

    Rolf Kalbermatter

  • Call a dll built with Labview in Digital Micrograph

    Hello everyone,

    I am faced with a difficult problem. I use Digital Micrograph that run the DLL of enforcement. This DLL must be built with a structure of library written in C. In this C code, I can call a built with Labview VI. If the Vi is simple, Digital Micrograph is happy. But, if I include a graph in the VI, C code builds and create a dll but Digital Micrograph falls down. Of course, DM is unclear the type Labview graph. I can do what I want in my VI and how can I solve the problem?

    Thank you.

    Gautier

    gautierdufourcq wrote:

    I solved part of the problem, DM do not plant more but the Labview graph is not displayed. Do you have a solution? THX

    Is not a problem of LabVIEW.

    It's their DLL. Talk to DM.

  • 12.1.3 call process causes WSM errors

    Brand new 12.1.3 SOA suite installation. This instance will replace our current production of 11g installation.

    We are already testing with an instance of the UAT and I don't remember having this problem.

    I currently have a single deployment for testing of notifications.

    When it is called it triggers the following error. The deployment of wsm - h is also active. We do not have any policy of wsm. Where do I diagnose this?

    # < 31 August 2015 2:13:55 PM CDT > < error > < oracle.wsm.resources.enforcement > < helenasoa > < AdminServer > < ExecuteThread [ASSET]: '4' for queue: '(self-adjusting) weblogic.kernel.Default' > < weblogic > <>< 8d05ee4b-b069-44bf-a86c-444c8a6fab84-0000022f > < 1441048435535 > < WSM-07620 > < Agent cannot apply policies due to either failure during extraction of policies or a validation error , detail = "WSM-02557 the documents necessary to configure the runtime of the Oracle Web Services Manager have not been retrieved from policy application (wsm - MP) Manager, perhaps because the application is not running or has not been deployed in the environment." The query "& (@appliesTo~="REST-CLIENT()")(policysets:global/%). "is waiting for later retrieval.

    «. >

    # < 31 August 2015 2:13:55 PM CDT > < error > < oracle.wsm.resources.enforcement > < helenasoa > < AdminServer > < ExecuteThread [ASSET]: '4' for queue: '(self-adjusting) weblogic.kernel.Default' > < weblogic > <>< 8d05ee4b-b069-44bf-a86c-444c8a6fab84-0000022f > < 1441048435535 > < WSM-07501 > < failure in Oracle WSM Agent processRequest, category = security_and_management, = agent.function.client, = em, composite application function = null modelObj = null, political = null, policyVersion = null, assertionName = null.

    • oracle.wsm.common.sdk.WSMException: WSM-07620: Agent cannot apply policies that are due or failure during the extraction of policy or a validation error, detail = "WSM-02557 the documents necessary to configure the runtime of the Oracle Web Services Manager has not been extracted from the application of the Policy Manager (wsm - MP), perhaps because the application is not running or has not been deployed in the environment." The query "& (@appliesTo~="REST-CLIENT()")(policysets:global/%). "is waiting for later retrieval.

    ".

    at oracle.wsm.agent.WSMAgent.getPolRefPolMap(WSMAgent.java:1128)

    at oracle.wsm.agent.WSMAgent.processCommon(WSMAgent.java:1178)

    at oracle.wsm.agent.WSMAgent.processRequest(WSMAgent.java:563)

    at oracle.wsm.agent.handler.jaxrs.RESTClientFilter.handle(RESTClientFilter.java:143)

    at oracle.j2ee.ws.common.wsm.WSMJerseyClientBridge.handle(WSMJerseyClientBridge.java:275)

    at com.sun.jersey.api.client.Client.handle(Client.java:652)

    at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682)

    at $200 (WebResource.java:74) com.sun.jersey.api.client.WebResource.access

    to com.sun.jersey.api.client.WebResource$ Builder.method (WebResource.java:623)

    at oracle.sysman.emInternalSDK.webservices.rs.dispatch.HttpMethod.invoke(HttpMethod.java:489)

    at oracle.sysman.emInternalSDK.webservices.rs.dispatch.HttpMethod.invokeMethod(HttpMethod.java:234)

    at oracle.sysman.emInternalSDK.webservices.rs.dispatch.HttpMethod.invoke(HttpMethod.java:178)

    at oracle.sysman.emas.model.wsmgt.WSTestModel.invokeMethod(WSTestModel.java:1460)

    at oracle.sysman.emas.view.wsmgt.WSView.invokeMethod(WSView.java:596)

    at oracle.sysman.emas.view.wsmgt.WSView.invokeTest(WSView.java:372)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:606)

    at com.sun.el.parser.AstValue.invoke(AstValue.java:254)

    at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:302)

    at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)

    at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1972)

    at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)

    at org.apache.myfaces.trinidad.component.UIXComponent.broadcastInContext(UIXComponent.java:364)

    at org.apache.myfaces.trinidad.component.WrapperEvent.broadcastWrappedEvent(WrapperEvent.java:82)

    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:168)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:510)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:171)

    at org.apache.myfaces.trinidad.component.UIXComponent.broadcastInContext(UIXComponent.java:364)

    at org.apache.myfaces.trinidad.component.WrapperEvent.broadcastWrappedEvent(WrapperEvent.java:82)

    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:111)

    at org.apache.myfaces.trinidad.component.UIXComponent.broadcastInContext(UIXComponent.java:364)

    at org.apache.myfaces.trinidad.component.WrapperEvent.broadcastWrappedEvent(WrapperEvent.java:82)

    to oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$ 1.run(ContextSwitchingComponent.java:168)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:510)

    at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:171)

    at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:115)

    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)

    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:1074)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:402)

    at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:225)

    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:280)

    to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:254)

    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)

    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)

    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.adf.view.page.editor.webapp.WebCenterComposerFilter.doFilter(WebCenterComposerFilter.java:117)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.adf.share.http.ServletADFFilter.doFilter(ServletADFFilter.java:77)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)

    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:502)

    at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)

    to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:502)

    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:327)

    at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:229)

    at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.help.web.rich.OHWFilter.doFilter(OHWFilter.java:189)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.sysman.eml.app.EMRepLoginFilter.doFilter(EMRepLoginFilter.java:697)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.sysman.emas.fwk.MASConnectionFilter.doFilter(MASConnectionFilter.java:50)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:202)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.sysman.eml.app.ContextInitFilter.doFilter(ContextInitFilter.java:554)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.adfinternal.view.faces.caching.filter.AdfFacesCachingFilterImpl.doFilter(AdfFacesCachingFilterImpl.java:136)

    at oracle.adf.view.rich.webapp.AdfFacesCachingFilter.doFilter(AdfFacesCachingFilter.java:66)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.sysman.core.app.exception.EMRuntimeExceptionFilter.doFilter(EMRuntimeExceptionFilter.java:81)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:137)

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

    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)

    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)

    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:120)

    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:217)

    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:81)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:220)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)

    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:79)

    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3436)

    to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3402)

    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

    at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)

    at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)

    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)

    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)

    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)

    to weblogic.servlet.provider.ContainerSupportProviderImpl$ WlsRequestExecutor.run (ContainerSupportProviderImpl.java:255)

    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)

    at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)

    Ahhh... I found it.

    The wiring of components... Initially, I have this configuration under the standard ports 7001 and 7003 and changed to different ports after installation.

    Which caused the components to be "Out of Sync".

    (Doc ID 1955813.1)

  • Calling functions in DLLS in LabVIEW Real-time

    Hello

    I have LabVIEW Real-time version 8.20 with PXI hardware. This uses Phar Lap ETS RTOS and support DLLs written in Microsoft Visual Studio 6.0 and Visual Studio .NET 2003. My question is if I upgrade to the latest version of LabVIEW Real-time, can I use later versions of Visual Studio to write DLLs?

    Search the OR web site all them I can find is that the version of the FTA has changed.

    Is it possible to use vxWorks on PXI hardware?

    Hello Paul,

    Lets try this again:

    How can I check that my DLL is executable in LabVIEW Real-time?

  • Can I Developer studio (C++ programming language) in my computer when I call a dll through my labview?

    Thanks in advance...

    In other words, the computer that I use for labview doesn't have a C++ program installed... I think it is to convert my C++ code into a dll into another computer and use this dll in the computer that has labview... So is it possible? or the computer with labview installed must have C++ program...

    Kind regards...

  • Python, call DLLs in LabVIEW: Fatal internal error when accessing output String Cluster

    Hello

    We have compiled a DLL in LabVIEW (TestError.dll) and tried to call it from Python.

    TestError.dll includes 2 functions:

    1 testErreur: cluster 1 entry string, 1 channel indicator

    2 TestError2: 1 channel input, 1 bunch of output string

    What we try to do in Python is actually something like this:

    1 provide values to controls in the functions of the DLL.

    2. call the DLL.

    3 get the values of the indicators.

    What we have seen are:

    1 read/write operations on normal data types (string, digital) indicators/controls are OK

    2. write operation on the Cluster string entry is OK

    3. read operation on the Cluster output string is not OK. The following error is still prompted for:

    «Unrecoverable internal error: 'MemoryManager.cpp', line 437.» LabVIEW version 8.6... »

    Also joined the TestError.prj and python code.

    Grateful if someone can help to explain why we get this error and how to overcome?

    Thank you

    howmean

    What we have seen are:

    1 read/write operations on normal data types (string, digital) indicators/controls are OK

    2. write operation on the Cluster string entry is OK

    3. read operation on the Cluster output string is not OK. The following error is still prompted for:

    «Unrecoverable internal error: 'MemoryManager.cpp', line 437.» LabVIEW version 8.6... »

    Also joined the TestError.prj and python code.

    It is very logical that it does not, and the bad news is, it cannot really be implemented reliable of a process not LabVIEW.

    LabVIEW channels (and tables) are very specific species. They are then called handles, which are pointers to a pointer to a block of memory. If you have a control or indicator on its own, the Prototype configuration allows you to configure this setting as a C. LabVIEW data pointer, when creating the DLL, create heels C for each exported function and place the code to do the translation between the past C pointer to and necessary LabVIEW data handle. For strings and arrays within the cluster, there is no configuration option and the DLL is expected to pass a structure with data handles native LabVIEW in there.

    You may say that creating handles data in your calling process enough to trick LabVIEW. For the input variables that actually CAN sometimes work (but is a delicate and dangerous generally to handle this). There is no way to make it work for output variables. LabVIEW will try to resize handle to fill data in that he wants to make. This resizing is done using internal memory manager of LabVIEW. This will work only if it had been allocated by EXACTLY the same instance of the memory manager. Otherwise, it refers to a different memory segment and catastophally fail. The only way to make this work perhaps, with luck, taking your heart and prayer to the gods, is to lvrt.dll to allocate a handle that you must pass to the DLL. Still find the good lvrt.dll, which will execute your DLL LabVIEW is a major challenge.

  • LabVIEW 2010 crash when calling user32.dll

    Interesting LabVIEW 2010 'characteristic', I discovered this morning.

    Attached are two identical screws, a registered in 2010 and a registered in 2009.  These screws have been written specifically to demonstrate the bug, I came across this afternoon.  Each VI when it is run needs you to find a specific program (window) opened in Microsoft Windows and bring it to the foreground.  It is based on 'user32.dll' to perform this operation.  It also allows you to specify the calling convention for the function call.

    LV 2009, calling convention works without error.  However, in LV 2010 the calling convention of the function must be "stdcall (WINAPI)" and not the default value of 'C '.  If the calling convention is 'C' LabVIEW hangs and then closes without warning.

    If you happen to have LV 2009 and 2010 LV on your computer, I would like to hear if this phenomenon is duplicated so that I can identify if the bug is LV 2010 related or is more specific to my personal configuration.

    Thank you

    ~ David

    221113

    Return

    COLD LAKE with the calling convention incorrect siliently crash LabVIEW can.
    LabVIEW 8.5 2009 could adjust the convention to call at run time if the user has selected the wrong option. In 2010, it is no longer a case. More information is located in the 59KB14WI knowledge base

    Workaround: Use the correct calling convention

    Reported Version: 2010 32-bit    Solved Version: N/A    Added the: 2010-07-23

    Release notes for 2010.

  • Dashboard of the LabVIEW data recover indicators of the poll

    Hello

    I have attached my entire project, including the error messages that I receive. I have my labview VI to put in place to have 3 different screws. My entries, my global entries and my "side". I created my web server and all the controls and indicators that I linked. However, when I try and run the dashboard of data project, all my indicators have error signals indicating that he "could not connect to the server. I have no idea what I'm doing wrong. Any ideas?

    The reason why this does not work, it's that your web service code is not quite structured reason. When you call a web method in LabVIEW it does is run the VI related to this method. In your case you have mapped to the URL http://host:8080/FINALCOAST/COAST.vi SIDE, and then you have a poller to web service linked to this URL. When you run your dashboard the poller accesses this URL, which causes the web server of LabVIEW run COAST.vi. If you look at COAST.vi, however, you will notice that what he does is run a loop that runs until the stop button is pressed. Is not supposed for a web method. He has no one to press the stop button. In fact, there is no user interface for anyone to interact with at all. This means that COAST.vi will work forever. Finally, data dashboard gave up and closes the connection because it should not take long for the web server that responds.

    So what is the correct way? It depends on what you're trying to do. In your case, it seems that you take just a bunch of inputs, do some calculcations and producing a bunch of outputs. You could do that in a VI with the method of a web that has just a bunch a bunch of outputs and inputs. In this case, you use just a web service calling (button) connected to one of the methods. Because this method has two inputs and outputs, you will get two entry and exit of Terminal ornaments around the button that you can use to connect to your commands (entered) and indicators (outputs). When you press the button it brings together the current values of the controls and those on the server to use as inputs to call your VI sends, and then he retrieves the results from the server and puts them in your indicators. In my example attached (see the file updated the dashboard) I show you how to do this. Note that I also modified the code of VI to create a Subvi for calculation of Basic code, and it is this VI which is used for the web service. This VI has no loop in him, so he just runs once with data values and returns the results.

    If you want to rather than having a continuous process that is continually measures your system in real time you need another way to access this data from a web service. It seems that that's what you were trying to do here, even if you use data in real time. Suppose that you were, however. In this case, you were a little close, but we need to make some changes. First of all, the running process doesn't have to be part of your web service. It may be, but it's a little more complicated. Instead of this, your process running (COAST.vi) can be just a regular VI running in LabVIEW. You just open and press run as usual. However, you want to only change VI to share its data with other processes. You have tried to do by using globals. Globals allow you to share data between the screws running in the same process, but web services actually run in a process completely separate (in the web server), so you'll need something else. A drop-in substitute would be shared network Variables. You'll see that in annex changed code I replaced your globals with shared variables. Then in your web service if you just use the same shared variables. Network shared Variables allow you to share data between processes (even on machines on the network) so that you can easily access the same data to both your VI running and your web service screw I modified your COAST.vi for this (and he calls the same Subvi from the calculation of the kernel).

    In this case, you could do just a single method "inputs" and only one "exits" method, but it might be better to break up to the less distinct modes which include the strongly bound values just to make things a little neater. It can be tedious to deal with a large number of terminals.

    Alternatively, once you use shared variables you has actually connect your controls and indicators on the dashboard of data directly to these shared variables. This has the disadvantage of requiring more ports to be open through your firewall (and you can not use security as you can do with web services), but for the use of internal network, it is easier to implement. To do this, just run your VI as before, and then as soon as it runs you can select each control or indicator in the dashboard of data, press the small button below, choose 'Shared Variables' and look for your variables on your machine. In this case, each control is directly bound to the variable, and so there is no need of a button. Changes that you make in the dashboard data are immediately placed on the server through the variable sared, and your VI (which is still running until you press stop) will see the new value, update the outputs and then repel these new values to the dashboard of data via other shared variables.

    I did not create a dashboard for the last two approaches, but if you may not know what I'm talking about, then I can create examples for those as well. The screw and the project must be configured to work in any case, if the only difference is in the configuration of the dashboard.

  • Call dll error 1097

    Hello

    I'm reading the data from a capture card in my slot PCIe card. When I call the "Initialize" function from the .dll file that I got with the card, I always get error 1097. 1097 means that the called function threw an error. When I run the program supplied with the acquisition card, the acquisition card still works.

    If I have everything just omit the "initialize" function call and continue with the function that will be called after the "Initialize" function, LabVIEW block (program stops without any warning).

    I also had a LabVIEW program that uses the dll that was supposed to work. But here I get the same error.

    Do you have any idea what normally causes this behavior and how can I solve this problem?

    I have the second post of nathans. 1097 error is almost always an error in the configuration of the right to call library node. And in some cases, there is no right to set up and you need a wrapper DLL to convert between what the library node call allows and what needs your DLL. The reason why it works sometimes and other times not, actually is that it never really works, but sometimes the error that gets caused cannot be detected by the operating system and LabVIEW does not get an exception according to. This can change according to LAbVIEW version, runtime system or development and even recompilation of the code after the small seemingly unrelated changes in demand.

  • The DLL call fails when DLL uses a wide range

    I call a C++ dll in LabVIEW 32-bit on Windows 7. I kept getting error 1097 and finally understood it is because the dll uses two large paintings of 5 MB each. The tables are initialized in the constructor of an object, malloc is not used, or whatever it is. If I do the smaller berries, then everything works fine.

    The problem is not difficult to work around, now that I know what is the cause, but can someone tell me why a dll using a lot of memory would be a problem? I feel that 10 MB is really a lot of memory to use on modern computers.

    OK, you can test the appeal of the DLL in a Visual Studio test harness?

    In addition, in case you haven't seen another 'DLL error 1097' son type, here are a few. The cause of 1097 in your case can be illuminated by a multitude of courses of troubleshooting:

    Call dll error 1097

    Error code coming 1097 in DLL call

    error 1097 after the call dll function that allocates memory inside

    1097 error in the transition from table from C++ DLL for LabView (seems very relevant, although long)

    I know there are a lot of reading, but there is a good chance that the magic trick is in one of these threads already. We will ride on the shoulders of their work.

  • Error-50103 during the VI call for the second time

    I have a main VI who, after the initial installation, called a VI that reads and writes several times to a data acquisition (USB 6356). This VI subroutine is called several times for each of the stages of the program. On the first pass through, there is no problem. During subsequent calls to the sub VI, however, it throws error-50103. I've identified the task that resolves this error. I made sure to do a self-cleaning on the task, create the task outside of loops and stop and clear the task after all the iterations are performed. To check if it is only the following calls may cause the error, I created a simple VI who just ran the sub VI twice now, and there are no errors.

    Any ideas on what is causing my problem or why it does occur during subsequent calls to my VI more complex?

    A picture of the frame and the task which gives me the number is attached.

    Thank you!

    I finally found the problem, although it was not the task that LabVIEW had identified. The problem task was a separate sub - VI who was called from the main VI and the Subvi that threw the error. I got this task stopped and cleared and it's not like he has over the matter.

    Thanks to all who have contributed.

Maybe you are looking for

  • Bug in xml component audio with blocking clips

    I have a timeline / project with a 30 min show that consists of a multicam clip 5 angle edited. Most of the fixtures is the audio components for each of these angles. I am audio editing by creating a selection on the audio components and this area th

  • T500 operating at maximum speed

    My t500 runs at full speed or a little more at 2926 mhz acording to AIDA64 while on battery. This makes the laptop run hot and battery life. I have reset the BIOs to maximize independence and then set as default. I even removed the battery cmos for a

  • Indicators of Type HD in XP?

    XP Pro SP3 My pc has a mixture of IDE and SATA drives. Seen through windows Explorer or disk management, cannot determine which drive is which architecture. Is there any windows XP interface that identifies the type of material for each hard drive mo

  • I wonder to run MSXML 3.0 because they detected worm/virus. Please notify

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: You have problems with programs Error messages Recent changes to your computer What you have already tried to solve the problem

  • Dell xps l502x freezes making buzzz sound during playback of the audio or video file

    I have a two year old dell laptop xps l502x, who recently started producing some strange audio buzzz at regular intervals during playback of audio or video file.le sound is very similar to the sound when games used to freeze with the same anonying bu