Calling structure in dll

I am trying to call a dll that contains a nested structure. I am not a c-programmer so therefore I
would lik to use the call library function but I do not know how to handle the union structure shown below??
Function Name:
cnc_rdparam
Declaration:
FWLIBAPI short WINAPI cnc_rdparam(unsigned short FlibHndl,short number,short axis,short length,IODBPSD *param);
typedef struct iodbpsd {
short datano ; /* data number */
short type ; /* axis number */
union {
char cdata ;/* parameter / setting data */
short idata ;
long ldata ;
char cdatas[MAX_AXIS] ;
short idatas[MAX_AXIS] ;
long ldatas[MAX_AXIS] ;
} u ;

I'm not sure, but I think that you have to wire the "param" output of "Call library function" to the cluster which consists of
1. datano - I16
2. type - I16
3. the variable with type depending on the type of union - I8 for cdata, 116 for idata, I32 - for ldata, array of I8 for cdatas, array of I16 for idatas, array of I32 for ldatas.
In other words you must know the type of cluster before calling of this function. May be this type depends on values of other parameters.
I think that you have to organize the case structure in your diagram which calls this function and returns the appropriate cluster depending on other parameters.
Oleg Chutko.

Similar Messages

  • How can i avoid a pop-up window when calling the avi.dll?

    Ok, here another try!
    My problem is as followed:
    My program calls the avi.dll to initialize, write into and close an
    avi-file.
    Now, when initializing it, a pop-up window is shown so you can choose the
    codec to use.
    My question is, can I pre-define the codec, so the pop-up window won't show
    up?
    The program is meant to write several files, some starting without the user
    having to control them, so the pop-up window really isn't helping.
    Any ideas?
    I attached the avi.dll in case you need it to look at the problem.
    Also helpful would be, if someone could tell me, how I can take a closer
    look at the structure of the dll. Is there a program I can do that with?
    Thanx!
    regar
    ds,
    Martin

    Hello Martin,
    I have used this DLL before and wasn't asked to choose a codec. Maybe if you use all three functions (init, write, close), it works without problems. Here's a example that uses IMAQ hardware to acquire an 8-bit image at 30fps and writes each image to an avi file.
    There are utilities to examine dlls (see what functions are exported and what the dependencies are, but you can't see source code since it is compiles.) Check out QuickView or DependencyWalker.
    Attachments:
    avigrab.zip ‏66 KB

  • Cluster array to c structure in DLL

    Hello,
    I have a problem which I am stuck at so I would really appreciate any help.
    I have this function that i need to access in Labview.
    ViStatus _VI_FUNC Ki_GetSystemInfo (ViSession instrumentHandle,
    void *systemInfo);
    Now the structure for systeminfo is as follows:
    typedef struct _SYSTEM_INFO
    char pchModelNum[MODEL_NUM_LEN];
    char pchSerialNum[SERIAL_NUM_LEN];
    char pchSysSoftwareVer[SOFTVER_LEN];
    char pchPlatformVer[PLATVER_LEN];
    char pchOpSystemVer[SYSTVER_LEN];
    int bCardType[MAX_SLOTS]; // Enum slot_types
    } systeminfo;
    When i use the call Library Node function to access the above function what
    should be mine
    input and out paramteres. I tries making cluster of 5 st
    rings and an array
    of integers
    It doesnt seem to work. Any help shall be appreciated.
    Premal

    Hi Premal,
    Try to use arrays of [U8] instead of strings. Also, pay attention to INT - is OS dependent (assuming that you are using win9x/NT/2000, use [I32]). If you try with strings, be sure that the input string contains enough characters to store the result.
    Hope this helps
    p.s.: take a look on those articles mentioned in "cluster array to c structure in DLL" [http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=506500000005000000C05C0000&HTHREAD=000023744&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0]

  • How to auto-recognize the function parameters called from a DLL built by VC6.0

    Hi,
    I use Teststand 3.5 with C/C++ Adapter, and the DLL is built by VC6.0.
    While I specify module for an action, the parameters of a function called from the DLL are not recognized.
    Since I have the DLL source, I know I can select the source file and verify prototype in the "Source Code" Tab.
    Under the way, almost parameters can be recognized, but some parameters, e.g. HANDLE or I definded, can not ( shows error message "The function definition cannot be found in the source file...").
    How to recognise these parameters?
    Thanks.

    The problem isn't that TestStand doesn't have enough native types. A handle can be represented in a TestStand numeric variable just fine. Instead, the issue is that when you select Verify Prototype, TestStand doesn't fully pre process your headers and compile your code to determine the types. To do so would require TestStand not only to be a full C/C++ compiler but it would also have to be able to read your compiler's projects and settings to resolve include paths, macros, etc.
    Since TestStand is not a C/C++ compiler, it just looks for the standard basic data types plus a few more that are common in test code.  Other data types will not be automatically recognized even if they can be mapped to TestStand types.
    Another option it to create a type library for your dll so that TestStand can automatically read the data type information from it. However, I don't know if that works for struct parameters and I looked for the document on devzone that explains how to do that in VC++ and it has been moved or deleted
    Maybe an AE would know of a link to a current document that describes how to do this?

  • External Catalog Call Structures

    We are on SRM 4.0 and integrated ITS.  We are using the standard call structure for external catalogs which opens in a new window.  However, this is causing grief with our users because they tend to stay in the catalogs too long and eventually timeout of SRM.  Our current timeout is set to 30 minutes.  Therefore, when they go to the catalogs, SRM sits idle.  When they checkout of the catalog to bring the items over into SRM, they will get a timeout message.
    I would like to have the catalog open in the same window as SRM.  I understand this is done through integrated call structure.
    However, when I select my items from the catalog and check out, I'm not brought back into my shopping cart.  Another window opens with the look of external ITS.
    Is there something I need to do with the call structure so that the items are added back to my shopping cart?
    Are there other options so that users do not timeout of SRM?  If SRM is sitting idle, can a message popup letting the user know their session will timeout soon unless they check out of the catalogs?

    Hi Monique,
    Last document i have in for ebp 3.0 !
    It is a configuration guide for setting up inframe catalogue.
    Extract :
    Prerequisites
    You have:
    installed an SAP Markets Enterprise Buyer Professional Edition 3.0 system
    installed the Requisite catalog (BugsEye 3.0)
    installed a Java Runtime Environment (for example Java 2 SDK Standard
    Edition)
    installed a servlet engine
    Activities
    Checking BugsEye_Config
    Copying of the WAR (Web Archive) file
    Deployment of the Application
    Changing the WEB.XML
    Defining the Internal Call Structure in EBP
    I can send you the document.
    However i do not know if it is still compliant...
    Kind regards,
    Yann

  • Recupérer les valeur d'un Control via un .obj appelé depuis une DLL- Getting a Control value from an .obj file called from a dll

    Bonjour,
    Suite au passage à la version CVI 2013, il faut passer par un fichier .obj au lieu du .c quand on veut utiiser la LoadExternalModule.
    Le pb qui en résulte impossibilité de récupérer la valeur des control dans l'uir géré par le .obj qui est appelé par une dll.
    Autrement, il m'est impossible de faire parvenir à la dll les valeur des control ( dll qui appelle le .obj).
    Quelqu'un a eu le même soucis amigos?
    Merci
    Hi,
    When using the LoadExternalModule function in CVI 2013, we can no longer use a .c file. Instead we have to use an .obj file.
    My issue is that' impossible for me to get a control value from an .iur managed by the .obj witchi is called by a dll. 
    Otherwise it's impossible for me to get the control vale when calling the .obj from a dll.
    Any suggestions Amigos
    Thanks

    For people who could be interested in, here the code I provided to the customer. This code demonstrates that calling a function defined in a .obj file from a DLL which is called itself by a program can be realized without throwing any error.
    In order to use this example, you will have to :
    1) Open "main.cws"
    2) Define "Madll" as Active Project (right clic on the project and click on "Set Active Project")
    3) Build the DLL (CTRL+M)
    4) Define "Main" as Active Project
    5) Click on "Debug Project" in order to build the executable and run it
    This example has been built with CVI 2013.
    Jérémy C.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    Travaux Pratiques d'initiation à LabVIEW et à la mesure
    Du 2 au 23 octobre, partout en France
    Attachments:
    main.zip ‏70 KB

  • Call Structure in SRM

    Hi Friends,
    Can anyone tell me, where are the settings for the Call structure and its importance.
    Incase I have Product category which is there with a some Third party search engine.
    when we choose a Product categorypfrom that search enginee then Product is transferred from that search enginee to our SRM system by poping up an additional window,  where in allowing us to change the basic data ,cost assignment , etc.and then when we click on Order It gets saved and SHC is created.
    So now I dont want that additional window to be called up when I transfer the product category from that third party  search enginee to my Shopping basket.
    where exactly I need to do the settings.can anyone help me?
    Regards,
    Sairam

    Hi,
    The call to web services is defined here:
    SRM IMG-> SRM -> SRM SERVER -> Master data -> define external web services
    Please check the settings there.
    BR,
    Disha.
    Do reward points for useful answers.

  • How to call a c++ dll from oracle

    plz can someone help me how to call a c++ dll (not ocx coz 10g cant see ocx) from oracle 10g ?
    Edited by: jihad jag on Apr 23, 2009 1:40 AM

    I guess your request is timed out but to call shared libraries look for 'External Procedure Call' in Oracle documentation.

  • OCI Punchout - Standard Call Structure - Creates new session each request

    Hello all,
      I am having trouble with a customer attempting to do OCI Punchout with the Standard Call Structure.  I have other customers successfully punching out in this same system.  Here is a breakdown of what is happening.  Our catalog is a combination of classic ASP with VB6 Com objects
    1 - The user POSTs their call structure to our /ocilogin.asp page and we set a session variable after successfully log in
    2 - The user is then redirected to our /MainFrameLoad.asp page which houses our catalog.
    3 - The problem occurs here because the Session_OnStart method in the global.asa file is called again, which should not happen because session has already been established.  The logic in this method checks for the session variable created in /ocilogin.asp but it does not exist. 
    4 - It looks for a username/password via querystring and does another login, which then redirects them again to /MainFrameLoad.asp and the infinite loop begins.
    I'm convinced that their system is creating new unique requests each time which is causing the session variable to disappear.  I've tested their ability to accept cookies, which would also effect session variables, but that seems to be fine on their end. 
    My question is how can I tell if their system is properly handling cookies/requests?  I have plenty of example of people punching out with the exact same call structure, but its just their system that seems to have the issue.

    Hi,
    SRM 7.0 catalog integration differs from previous releases, the reliance on OCI 4.0 compliance is much stricter, please see the note [1287412 |https://service.sap.com/sap/support/notes/1287412]for more details on the required settings in the SRM system, perhaps let your customer also know about this note.
    Regards,
    Jason

  • Calling a c++ dll that contains a dialog.

    Hi,
    I have a c++ dll that contains a dialog. When I try to display the dialog (ShowDialog(SW_SHOW);) the dialog is popped up but the dialog window is frozen and do not display its controls. The Java application is call an intermediate dll create by JNI that is calling the c++ dll.
    Any Suggestions?
    Thanks in advance,
    Udi Raz

    It should be discernable (by looking at the C# code) whether the C DLL needs to be registered.
    If the DLL is serving COM objects it may need to be registered at a command-prompt with
    regsvr32 <your_DLL_File_path>
    If it's supplying .NET assemblies, I think it needs to be registered with
    regasm <your_DLL_File_path>
    Although I've written a few C DLLs, none were called from a C# DLL and I can't advise what subtle things to watch-out for in this scenario.
    Do you have a way to validate/exercise the C DLL's functionality? Is it possible to through-together a C# application (not a C# DLL) that successfully uses the C DLL?
    Luck/Cheers!
    Message Edited by tbd on 12-03-2008 02:36 AM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Can a call to a DLL be aborted?

    Hi all,
    I've got a rather huge project stat starts to cause bad problems now communicating with an USB device. There's a home-made DLL that calls some chip-specific DLL functions. From time to time a call that finally should simply close the handle to that device takes far too long, from seconds to hours. It will finally return and everything is done, but I cant affort to wait more than some few seconds.
    Now my Q is, is there any way to abort a call to that DLL whenever it takes more than a specified period? I thought of dynamically call a VI that calls the DLL, but I am not sure if this would really help, as LV is really lazy when it hangs in the DLL call _now_! The system monitor shows no CPU usage (~1%) and does not show LV hanging, but LV does react to any clicks with long delayes, if at all. Would not like to set that up just to find out that it could not have worked.
    Any C programme here that has an idea to change the home-made dll?
    Greetings from Germany!
    Uwe

    After re-thinking the whole thing, I conclude this is impossibel, at least in the way I asked for.
    To abort a process, it must be a separate process. As LabVIEW itself is a single process, I would have to bring this DLL-stuff into another process, which could just be another LV runtime engine. This might work in the devellopment system, but no way when compiling the main app into an exe itself. OR I had to use an older runtime engine.
    AND, I would need to create a LabVIEW daemon that accepts the jobs with the DLL as it needs to stay in memory when being active.
    AND I'd need a whole bunch of communication between both processes, exchanging different data like handles, errors, commands and communication packets.
    Conclusion: I will not try going this way unless someone proofs me wrong.
    Greetings from Germany!
    Uwe

  • Has anyone called the Solver dll in Labview?

    I have developed a non-linear mathematical model in Excel that uses it's Solver routine. I am currently trying to convert this over into the Labview environment because the equations are more manageable and the front panel interface is more marketable. However, I need the power of the Solver dll.
    Frontline Systems (www.solver.com) provides an evaluation version of the dll but I am new to this and I was wondering if anyone has done it and could provide a VI which calls this dll or has any suggestions, please?
    I think it would be pretty nifty if Labview could provide this sort of optimisation power. (It's current optimisation routines in the Mathematics toolbox are pretty limited and are not nearly as powerful as Solver)
    . But I'm sure a labview guru could configure a simple VI which calls the Solver dll for a multi-dimensional non-linear problems similar to Excel....
    Many thanks in anticipation!!!

    Hello �
    You might want to consider using a Call Library Function Node. This node supports a large number of data types and calling conventions. You can use it to call functions in most standard and custom-made DLLs and shared libraries.
    Refer to the Configuring the Call Library Function Node section of Chapter 2, Shared Libraries (DLLs), of the Using External Code in LabVIEW manual (attached) for more information about using the Call Library Node to call code from text-based programming languages.
    Hope this helps!
    S Vences
    Applications Engineer
    National Instruments
    Attachments:
    Call_Library_Function.pdf ‏2030 KB

  • Calling LV created DLL from LV

    Howdy-
    I'm trying to call a LV DLL from within LV (seperate project).  Once the DLL has been comppiled I'm using the Import Shared Library to create the node.
    However when I try this I get an error message with the import that appears to have trouble with LVBoolean and int32_t.
    I've created a simple DLL (adds a DBL to an INT 32 and creates a Bool when the sum is > 0). 
    Compiling this DLL and trying to import it has the same issue.
    Any clues?
    Attachments:
    Import Shared Lib.png ‏49 KB
    My DLL.zip ‏34 KB

    nathand wrote:
    This does mean LabVIEW will create the datatypes with U8 instead of booleans, which you can replace yourself with a boolean after importing.
    Except that the Call Library Node doesn't allow for configuration of an explicit boolean type (for obvious reasons as there is no standardized boolean datatype in C before C11 and even then the standard says nothing about if it should be a byte or the prefered integer size for the current platform or anything else). LabVIEW then uses Adapt to Type instead, which forces the skalar parameter to be always passed by pointer!
    Most simple solution is to still use an explicit integer that is properly sized and convert between the LV Boolean and the integer on the diagram.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to call LabVIEW ActiveX dlls into VB6

    I'm jumping in on a project written primarily in VB6. I'd much rather wirte code in LabVIEW so what I am looking for is some example code for calling LabVIEW activeX dlls into VB6. Does anyone have example code? I need to see how the LabVIEW libraries and classes are called and used in VB6.

    Hi Drewdafis,
    Refer to this link for example code on calling a LabVIEW DLL from Visual Basic.
    Hope this helps!
    Best Regards,
    Jonathan N.
    National Instruments

  • Calling a VC++  DLL from a java code!!!!  Urgent!!!

    Hi,
    I need a Java code which will call a VC++ dll .(similarly the viceversa also.....from vc++ calling a java application)
    If any one have the code Please send it...
    Thankx,
    Donam.

    There is also some details in here which might save you some of the hassle I had.
    http://forum.java.sun.com/thread.jsp?forum=52&thread=210212

Maybe you are looking for

  • Slow going from Login to full loading of desktop in main user account

    Lately my beloved Macbook Pro has developed a problem in the main user account. It is taking too long to load the desktop & menu bar after Login. I don't know quite how to approach troubleshooting this, because my alternate user loads fine. I am goin

  • Random test questions quiz results not working

    I have a project with random test questions. It's published in HTML5...Each time I play the project in preview, the test results are accurate and correct at the end...However after I have published the project to my site, all the random test question

  • Combine year + period as one dimension for data input

    Existing Hyperion Planning has 2 dimension to keep the year and period. Our users would like to have the data entry web form title to show the year+period e.g. Jan 2009 instead of two rows. Is it very difficult to build such a label or a dimension fo

  • Pros/Cons of replicating to files versus staging tables

    I am new to GoldenGate and am trying to figure out pros/cons of replicating to flatfiles to be processed by an ETL tool versus replicating directly to staging tables. We are using GoldenGate to source data from multiple transaction systems to flatfil

  • Why is there a network timing

    why does my ipod always say network timed out? when i tried logining in to facetime it would say network timed out why is this