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

Tags: NI Software

Similar Questions

  • Can someone tell me how do you remove or change the name of a library on the opening?

    Can someone tell me how do you remove or change the name of a library on the opening?

    You remove an Aperture library by selecting it in the Finder and delete it like any other file.

    To rename an opening, library, use the Finder-click on the name of the library and enter a differnet name.  You can also select the library in the Finder, then enter the ⌘I key combination to open the information panel. Then change the name in the Info Panel.

  • Adobe Photoshop CS5.1 reinstalled because the help functions gives an error message (7).

    Hello

    When I tried to use the help function Adobe Prhotoshop CS5.1 a pop-up message shows errorcode (7) advise to reinstall the product. So I did, but it did not work. What can I do more? Mind you, the help in bridge function works as it should and the two products are installed at the same time.

    Kind regards

    AAD

    Thanks, I found a few topics on the error. I reinstalled and now it works.

    AAD

  • Is the fopen() function works in labview?

    Hi gentlemen...

    I used the fopen() function in labview, it does not work. Is that I can use the fopen() function works in labview?

    Please help me as I'm new to labview.

    Thanks in advance

    Can you give us a description of how you try to do this?

    You realize that LabVIEW is not based on text, no?

    Looking just for another equivalent method? http://zone.NI.com/reference/en-XX/help/371361J-01/lvprop/vi_open_front_panel/

  • How to implement enter and execute the query in the ADF

    I'm new to ADF and I'm trying to create a simple data entry in ADF 11 g based on a database table. I'm looking to implement the equivalent of the request function enter and execute the query in Oracle Forms. I tried the default operations that are available with the data controls. But they don't seem to have this feature. Can someone help / tell me how this can be implemented.

    Thank you
    Srini.

    How to add a query Panel? Who has the most benefits that the use of Find.

    More info on af:query

    http://docs.Oracle.com/CD/E28389_01/apirefs.1111/e12419/tagdoc/af_query.html

    Arun-

  • How Automation plug-ins appears under the Help menu?

    Hello

    My Automation plug-ins appear in the controller menu, and it works.

    Here too the menu and submenu. Find and select my plug-in is boring.

    How does appear under Help menu?

    change pipl file may resolve this problem. code is below

    resource "PiPL" (XXXID, "AutomationFilter," purgeable)

    {

    {

    Like {action},

    Name {plugInName'... »},

    Category {' * Help * '}, //Use category {' * Help * '} plugin automation will be under the Help menu

    {"Another string"} category, category {"another string"} //Use plugin automation will be under file | Automation menu.

    Thank you.

  • ADF BC: how to implement actions object of the entity polymorfic

    Hello

    It is possible that this question seems complicated, but the answer might be a simple 'yes' (or a complex ' no, because... ") »).

    The use case is to have a list of tasks and a number of actions to perform these tasks.
    There are different types of tasks, and they all implement their actions differently.
    These different implementations (action) require different resources to work with (for example unrelated database tables).

    Using JDeveloper 10 g (10.1.3.4.0), I created a sample application that implements this:
    http://verveja.footsteps.be/~verveja/files/Oracle/PolymorphicResourceTaskApp-v0.01.zip

    He has a ResourceTask of entity object that has 'actions' (methods) reviewStatus(), executePreferredAction(), executeFallbackAction() which is substituted in different subclasses, for example:
    public class ResetRedTypeTaskImpl
         extends ResourceTaskImpl
    {
         // ...
         public void executePreferredAction(ApplicationModule pApplicationModule)
         {
              System.out.println("ResetRedTypeTaskImpl.executePreferredAction() : begin");
              RedResourceServiceImpl vRedResourceServiceAMI =
                   getRedResourceServiceAMI(pApplicationModule);
              vRedResourceServiceAMI.resetRedTypePreferred(this);
              super.executePreferredAction(pApplicationModule);
         }
         // ...
    }
    or
    public class NewGreenForEachRedTypeTaskImpl
         extends ResourceTaskImpl
    {
         // ...
         public void executePreferredAction(ApplicationModule pApplicationModule)
         {
              System.out.println("NewGreenForEachRedTypeTaskImpl.executePreferredAction() : begin");
              GreenResourceServiceImpl vGreenResourceServiceImpl =
                   getGreenResourceServiceAMI(pApplicationModule);
              vGreenResourceServiceImpl.newGreenForEachRedType(this);
              super.executePreferredAction(pApplicationModule);
         }
         // ...
    }
    Maybe this screenshot can illustrate the use cases, see PRTApp-overviewResourceTasks - v0.01.png .

    questions
    (q1) Is it acceptable to pass an instance of Application Module as a parameter to a method of object (overridden) entity?
    (q2) If the answer to (q1) is no, what alternative approach should be used to implement the same functionality?

    Thank you very much
    Jan Vervecken

    To better understand your use case, what role is the module of past enforcement playing, compared with the request for the root module any object that can access already?

    Different polymorphic subtypes may have separate associations who do not have supertypes and that the do not share with other subtypes of 'peers', so that might help your use case.

  • How can I find answers uysing the help section?

    Cannot finance all of right answers than after 90 responses sound nothing like what I asked. So why do we get bad service from the help section? Why Micrtosoft not won't find us abnswers on our own? In all formats associated previous if xp or office 2003 - why could find answers with new p-plus but nopt tyhose?

    I do not know what help you are referring to with the words 'article' but I found that I get better results from the following site http://windows.microsoft.com/en-US/windows7/help I do using "Windows Help and Support" on my computer.

  • How to raise an event during the double click on a tree node

    I have this code that creates the new tab in a remote Java class.

    treeView.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<TreeItem<String>>()
       {
       @Override
       public void changed(ObservableValue<? extends TreeItem<String>> observable, TreeItem<String> oldValue, TreeItem<String> newValue)
       {
       System.out.println("Selected Text : " + newValue.getValue());
       // Create New Tab
       Tab tabdata = new Tab();
       Label tabALabel = new Label("Test");
      tabdata.setGraphic(tabALabel);
    
       DataStage.addNewTab(tabdata);
       }
       });
    

    Can you tell me how I can change the code to open a new tab when I double click a tree node. In my code, the tab opens when I click once. What event handler do I need?

    import java.util.Arrays;
    
    import javafx.application.Application;
    import javafx.event.EventHandler;
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.input.MouseEvent;
    import javafx.scene.layout.StackPane;
    import javafx.scene.control.TreeCell;
    import javafx.scene.control.TreeView;
    import javafx.scene.control.TreeItem;
    import javafx.scene.control.SelectionMode;
    import javafx.util.Callback;
    
    public class TreeTest extends Application {
    
      public static void main(String[] args) {
        launch(args);
      }
    
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("TreeView Test");
        primaryStage.setScene(createScene());
        primaryStage.show();
      }
    
      private Scene createScene() {
        final StackPane stackPane = new StackPane();
        final TreeView treeView = new TreeView();
        treeView.setRoot(createModel());
        treeView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
    
        treeView.setCellFactory(new Callback, TreeCell>() {
          @Override
          public TreeCell call(TreeView treeView) {
            return new ClickableTreeCell();
          }
        });
        stackPane.getChildren().add(treeView);
        return new Scene(stackPane);
      }
    
      private TreeItem createModel() {
        TreeItem root = new TreeItem("RootNode");
        TreeItem packageA = new TreeItem("package A");
        packageA.getChildren().addAll(
            Arrays.asList(new TreeItem("A1"), new TreeItem("A2"), new TreeItem("A3"))
        );
        TreeItem packageB = new TreeItem("package B");
        packageB.getChildren().addAll(
            Arrays.asList(new TreeItem("B1"), new TreeItem("B2"), new TreeItem("B3"))
        );
        root.getChildren().addAll(Arrays.asList(packageA, packageB));
        return root;
      }
    
      private class ClickableTreeCell extends TreeCell {
        ClickableTreeCell() {
          setOnMouseClicked(new EventHandler() {
            @Override
            public void handle(MouseEvent event) {
              // Handle double-clicks on non-empty cells:
              if (event.getClickCount()==2 && ! isEmpty()) {
                System.out.println("Mouse double-clicked on: " + getItem());
              }
            }
          });
        }
    
        @Override
        protected void updateItem(String item, boolean empty) {
          super.updateItem(item, empty);
          if (empty) {
            setText(null);
          } else {
            setText(item);
          }
        }
      }
    }
    
  • Decode the help function

    Hello

    I'm new to the development of Oracle.

    MY requirement:

    I need to fill a column "ISMSG" by YES / NO based on the following condition

    When the code = the of ' or 'O'... the 'ISMSG' column should display any other YES no.

    That is, output should be like

    CODE ISMSG

    A NO
    S YES
    S YES
    O YES

    My code for the Decode function:

    CASE
    WHEN s = c.code ' THEN decode (c.code, the of ',' YES, 'NO')
    WHEN c.code = 'o' THEN decode (c.code, 'O', 'YES', 'NO')
    END ISMSG

    My code is correct? If Yes is the best way to do it?
    If this is not the case, correct the code.

    Is there an effective way to do it?

    Thanks in advance.

    Hello

    You can use CASES or DECODE for this; There is no need to use both.
    With the help of CASE:

    SELECT  c.code
    ,     CASE
             WHEN  c.code  IN  ('S', '0')  THEN  'YES'
                                               ELSE  'NO'
         END     AS ismsg
    FROM    table_x   c;
    

    Using DECODE:

    SELECT  c.code
    ,     DECODE ( c.code
                , 'S'      , 'YES'
                , '0'      , 'YES'
                              'NO'
                )          AS ismsg
    FROM    table_x   c;
    

    I suggest that you forget to DECODE and use always the CASE, at least while you are beginner.

    CASE may do everything they can to DECODE. There is a little bit simple, situations where DECODE is a little shorter than the CASE and therefore a bit clearer, but only a little and, as I said, these are just simple situations, and CASE is clear enough in them.
    DECODE is never much shorter or clearer than the CASE. The reverse is not true: there are many situations where the CASE is much, much shorter and lighter than DECODE.

  • How to share a variable between the Mathscript Windows and a Mathscript node

    Hello

    I'm trying to share (just) a variable between the Mathscript Windows and a Mathscript node. I don't know why, but the use of the "global" Matlab function makes the mathscript node output formats change.

    I'm looking for a "Mathscript RT V9.0.1 module" as it may seem, there is. French technical support have some difficulty to find...

    Hi patrick33,.

    The code that you have attached should not report an error, so it seems that something has gone wrong with your installation of MathScript. My best guess is that it is the problem that is described in this knowledge base article. Your signature says that you use f3 patch, which is a good start. But the KB lists some other steps to take when you see errors about MathScript, impossible to compile. Can you try the procedure described in the article and let us know if that fixes the problem?

    Thank you

    jattas

    LabVIEW MathScript R & D

  • An array of LStrHandles to the breast to call library node grave Functio Resizeing down Subvi.

    Hello

    I try to resize a table of LStrHandles in a shared library. Here the code C - attached a picture of the appellant Subvi:

    / * Call library source file * /.

    #include
    #include "extcode.h".

    / * Typedefs * /.

    typedef struct {}
    long dimSize;
    LStrHandle elt [1];
    } TD1;
    typedef TD1 * TD1Hdl;

    long strArray (TD1Hdl arg1);
    long strArray (TD1Hdl arg1)
    {
    long err = 0, count = 2;

    ERR = DSSetHandleSize (arg1 (UHandle), count + (long) sizeof * sizeof (LStrHandle));
    {if (Err)}
    printf ("ERROR: 'DSSetHandleSize()': %ld\n", err);
    return err;
    };

    (* arg1)-> dimSize = (* arg1)-> dimSize;

    return noErr;

    }

    I know there is a lot of discussion, I read some and also tried the source code provided but somehow LabVIEW crashes. I don't know if it's valuable, but when I change the next line it don't crash:

    (* arg1)-> dimSize = (* arg1)-> dimSize;

    Thanks for any help,

    Johannes

    OS: RedHat

    LV: 8.2 teacher

    To be honest I'm not entirely sure why that would break but good process is much more complicated than what you have done. The crash probably can't function of C, but the return of the function such as LabVIEW tries to display data. DSSetHandleSize() doesn't boot the zone allocations in addition it of probably garbage that LabVIEW then tries to interpret as string handles and therefore crashes.

    You should also use NumericArrayResize() where possible because it supports various complications that can be difficult to deal with cross-platform programs. NumericArrayResize() use internal DSSetHSzClr() which initializes additional memory to 0. That would avoid the accident since LabVIEW interprets handles NULL as the default value for the data type, which would here be a string empty.

    #include "extcode.h".

    #if IsOpSystem64Bit

    uPtr uQ #define

    #else

    uPtr uL #define

    #endif

    typedef struct {}

    dimSize of Int32;

    LStrHandle Elm [1];

    } TDStrArr, * TDStrArrHdl;

    MgErr MyArrayFunc (TDStrArrHdl stop)

    {

    Int32 count = 4;

    LStrHandle p;

    MgErr err = noErr;

    / * Table could be non-empty, so have all of the items there are larger than we need * /.

    for (i = (* arr)-> dimSize - 1; i > = count; i--)

    {

    p = (* arr)-> Elm [i];

    If (p)

    DSDisposeHandle (p)

    }

    (* arr)-> dimSize = i + 1;

    / * resize the table handle to get enough space * /.

    ERR = NumericArrayResize (uPtr, 1, (UHandle *) & arr, count);

    If (err)

    return err;

    / * Fill in the data as desired * /.

    for (i = 0;! err & I)< count;="">

    {

    p = (* arr)-> Elm [i];

    #if! complicated

    ERR = NumericArrayResize (uB, 1, (UHandle *) & p, 1);)

    #else

    If (p)

    {

    ERR = DSSetHSzClr (p, sizeof (int32));

    }

    on the other

    {

    p = DSNewHClr (sizeof (int32));

    If (p)

    (* arr)-> Elm [i] = p;

    on the other

    ERR = mFullErr;

    }

    #endif

    If (! err)

    ERR = LStrPrintf (p, "% ld", i);

    }

    (* arr)-> dimSize = i;

    return err;

    }

    Rolf Kalbermatter

  • help with call library function node

    I have problem with node function call library that I try to use velleman k8061 dll file to get this working labview

    all I'm trying to get the same problem

    but I chose one to explain it

    SetDigitalChannel
    Syntax
    PROCEDURE SetDigitalChannel (CardAddress: Longint;) Channel: Longint);
    Parameters
    CardAddress: The address of the previously opened card.
    Channel: Value between 1 and 8, which corresponds to the output channel to be resolved.
    Description
    The selected digital output channel is activated.
    Example of
    BEGIN
    SetDigitalChannel (0, 1);

    now, when I try to call the function of library in k8061.dll node and set up 2 a card address and one for the channel

    address of card type: type numeric & statistics: signed 32 bit intger

    channel type: numeric type & data: signed 32 bit intger

    function prototype

    void setdigitalchannel (int32_t, intg32_t channel address);

    I also configure error call library function node checking up

    now that I run it, I get error 1517 produced and tell me this mismatch between the calling conventions?

    problem solved

    thanx

  • How to copy DAQmx task without the help of MAX?

    Howdy-

    I hit a bit of trouble here I think points to a fundamental misunderstanding I can have on DAQmx channels and tasks.  I can hack together a workaround, but I would like to know how to do these things, common sense.

    In a Word, I prefer to do everything in the code and not use MAX.  For my application, I would like to create a single channel/task initialized with all the scaling, the physical channel parameters and units (it is what is, in my case, a 'channel').  I would then like to create copies of this channel/task and configure each with parameters of specific task of sampling... corresponding to what I would call the "tasks" to use "Channel".

    I'll have no chance, so of course, I do not understand what I do.  Any reading/posts I've met use MAX.  Here's what I've tried so far:

    Even when you try to use MAX, I am the breath.  Any help straightening on my confusion here is very appreciated.

    Thanks in advance and have a nice day.

    -Brad

    In fact, you're not confused.  In this instance of National Instruments is perhaps...

    See the links ofthese ideas in the link.

    But a 'task' is really just a section in an XML file.  If this file is named *.lvproj the project has access to tasks.  If this file is *.nce any labview application has access to tasks.  If this file is created by the RTE that vi has access to the task.  In short, the "tasks" are never really defined by 'Code' but by the XML code to the file than declairs them and teir properties.  Tasks need to be defined a time-preference during design - project

    Yes, it's a bit simplistic but a good analogy!

    Go ahead and kiss MAX to set your tasks... use DAQmx property nodes if you need to programmatically determine a task property.   "do everything in code" as you say is just not really the way it is... the way I think you hear it...  'S really not 'made it in the code"but rather how LabVIEW is inherintly multithreaded.  The IDE just handles it for you "So easy that could encode a cave man!  Relax and let it work the way it does work for you.

  • How to implement toolkit blurred on the myRio?

    Hello

    We are trying to implement the logic fuzzy toolkit on Myrio. but are not successes. one has experience to implement the control of fuzzy logic on MyRio?
    I tried on PC, it works fine but when I tried on MyRio, it's not that I was expecting.

    can someone help me solve this problem?

    Thank you

    the error may display set

    The best

    Santo

    Hi Santo,

    have you checked the path to the file you want to load when you start your VI?

    Err7 means generally: "file not found!"

    Have you copied the file from your PC to the myRIO? The myRIO can't access hard disk of your PC!

Maybe you are looking for

  • Satellite 1130-Z25: where can I get a first recovery CD disc

    Hello Just wondering if someone can help or provide information, I have the Toshiba above and some how the software has been altered, so I inserted the recovery cd (because there are 2) who returned after about 33% with an error. After checking the f

  • Missing system Base Unit

    I 4540 probook s and I installed windows 7 (X 64) prof. I have the following problems in Device Manager: 1 base system device (location: PCI Slot 2 (bus PCI 3, device 0, function 0)) device base-2 system (location: PCI Slot 2 (bus PCI 3, device 0, fu

  • Rundll32

    Means - This is a foro Público para as nunca publicar information privada como el correo electronico o phone numbers! Ideas: Como puedo solucionarlo? of roudll32 dejo funcionar. Error messages Los recent changes made in su equipo What is han intentad

  • Are not allowed to run a few commands on ESXi

    I see the permission denied error when I try to runstop to spendstopping VMware-fdmPlease let me how can know I run these commands in vmware HOL

  • something going wrong - CC library

    Everytime I open Illustrator I get this message in libraries that "something went wrong" and will not load. I tried leaving the CC libraries as file suggests, tried to reboot, tried everything, but still does not work... I'm on 2015.1.0 suggestions..