Calling supply function

Hi
Can we call supply function explicitly in any other method of the view using wd_this->supply function name( ) ?.
In case the supply function is local to the view and when it is defined in component controller ?

hi vishal........
      you cannot call supply function explicitly.......
      what you can do is.... invalidate the node that has the supply function. so the supply function will be called again.
---regards,
   alex b justin

Similar Messages

  • Window doesn't close wheh Call Library Function Node set to Run in Any Thread

    This is a problem regarding Call Library Function Nodes running in the UI thread or any thread.
    I have a camera which has its own API supplied as a dll. I have created a set of VI wrappers which each call a function in the dll through a Call Library Function Node.
    Initially each CLFN was set to 'Run in the UI thread' (the default).
    To start the camera streaming images I call (through a CLFN)
    ICubeSDK_Start(int CamIndex, Hwnd, ImgHandle, bool Preview, bool callback);
    If Preview = True then the image is displayed in a preview window.
    If ImgHandle = NULL a default preview window
    is used.
    In the CLFN definition I define:
    ImgHandle as a U32
    Preview as a I32
    To stop the camera streaming images I call
        ICubeSDK_Stop(int CamIndex)
    In the actual implementation I set ImgHandle = 0 (NULL) and Preview = 1 (true).
    This all works fine, and a preview window is opened and images displayed. When I call ICubeSDK_Stop the preview window is closed.
    However, I would prefer to set the CLFN to 'Run in any thread' because
    a) when run in the UI thread the preview window randomly gets sent to the back when I switch focus between open VI windows (presumably because it is in the same thread as the VIs)
    b) I don't want to put unnecessary stuff in the UI thread
    c) my (naive?) understanding is that it is safer to run in any thread
    So I have set all CLFNs to 'Run in any thread'
    When I do this the preview window opens OK, and behaves like any other non LabVIEW controlled window in terms of focus. But when I call ICubeSDK_Stop() the preview window does not get closed properly, it just shows a blank image. I can't close it manually, there is no X in the corner and no option to close it from the taskbar. To get rid of it I have to close the LabVIEW project it is spawned from, which often results in a crash. It does appear as a separate item in task manager but if I 'end process' it, LabVIEW closes (and often crashes) as well.
    If I change only the CLFNs that call the Start and Stop functions back to 'Run in the UI thread' then it all works fine again, except that the preview window gets sent to the back randomly as before.
    So, what do I have to do to get the preview window to close properly if I set the CLFN to 'Run in any thread'.
    Alternatively, is there a way to close the window programmatically (ie force it to close) after I have called ICube_Stop.
    Thanks
    DAve

    Hi Dave,
    The "Run In UI Thread"  switches from the thread the VIs currently executing in to the user interface thread. If you select "Run in Any Thread", the Call Library Function Node continues in the currently executing thread. By default, all Call Library Function Nodes run in the User Interface thread.
    Before you configure the Call Library Function Node to run in any thread, you have to make sure that the code is thread safe. Code is thread safe when it does not store any global data (e.g. global variables, files on disks, etc.), does not access any hardware, does not make calls to any functions, libraries or drivers that are not thread safe.
    Unfortunately, since you said that your DLL accesses hardware, it is not recommended to use "Run in Any Thread." This is probably why you are seeing the crash.
    If your preview window gets sent to the back you can programmatically bring it forward. Here is an example of how this can be done: http://decibel.ni.com/content/docs/DOC-4551
    If you want to completely close the window down you can do so as described in this link: http://digital.ni.com/public.nsf/allkb/81E9C144190​0FFCE8625748F0055DBB0?OpenDocument
    I also thought you might find this useful: http://zone.ni.com/devzone/cda/tut/p/id/3009
    I hope this helps.
    Regards,
    Mahdieh G
    Applications Engineer
    National Instruments UK&Ireland

  • How to call external functions without a .DLL (just using a .H and .LIB file)?

    Hello everyone,
    actually I'm facing little difficulties on how to get an external function getting called from within CVI (Version 2009).
    I was supplied with a .H file and a .LIB file to call an external function from within my CVI project. The .H file looks like this:
    void exportedFunction(double *parameter);
    As far as I know, the external function was written with MS Visual C++ 6.
    So I tried to statically link to the extern al function like this:
    - Add the .H file and the .LIB file to the CVI project
    - #include the .H file where I needed to call the external function
    - do the external function call
    When building I get an unresolved external function call error from CVI so this seems not to be working.
    I made some searches around and got up with two possible issues. Maybe one of you can help me get a bit further and get things working.
    1) The "real" function code is located in the DLL file which was not delivered to me. Or is there a way to get things done (call external functions) just with a .H and a .LIB file (without any .DLL file included)?
    2) The external function does not export according to "C-Style" rules. The function signature in the .H file shows no things like
    extern "C" __declspec(dllexport) void __stdcall ...
     Or maybe it's a combination of both issues (missing .DLL + wrong export style of function)?
    I guess I could get around the wrong export style of the function when I manage to write a wrapper around the original function that actually uses C-Style exporting. But I guess I need the .DLL file for this try as well.
    Thank you for your answers.
    Best regards,
    Bernd
    Solved!
    Go to Solution.

    There is no need  for the dllexport stuff. There is also the option for a static library without any DLL.  But the 'extern "C"' is essential, because it forces the C++  compiler, which was probably used to compile the library , to use C calling convention.
    If you can't ask the provider of the library to provide a version which was compiled using C calling convention the way to go is to write a wrapper with VC++6 around that library which reexports the functions using C calling convertion. Something like
    extern "C" type0 myfunc1(type1 arg1, ...) {
           return func1( arg1,...);
    for every function , you need to use.
    BTW. "unresolved symbol" is the linker error message, you can expect if you try to link C code against a library build with C++ calling convention.

  • SUpply function in Web Dynpro ABAP

    I have 2 views - an INPUTVIEW and a DISPLAYVIEW.  I created 2 nodes in the component controller - INPUTNODE and TABLENODE.  In the INPUTVIEW, I mapped INPUTNODE of the component controller and in the DISPLAYVIEW, I mapped both the nodes of the component controller. I need to enter a value in the first view and the corresponding result should be displayed in the second view. I wrote the code in the supply function of the TABLENODE of the component controller. When i enter a value for the first time, the result is being displayed fine in the 2nd view.  But even if i go back and select another value in the INPUTNODE, the result is still the same.  Only if i refresh the 1st view, the result is changing.
    This is the code i wrote in the supply function of the TABLENODE of the component controller.
    data:   inputnode type ref to if_wd_context_node,
            tablenode type ref to if_wd_context_node,
            covalue   type string,
            itab_st  type standard table of zstate.
    inputnode = wd_context->get_child_node( name = 'INPUT_COUNTRY').
    inputnode->get_attribute( exporting name = 'zzco' importing value = covalue ).
    select * from zstate into table itab_st
    where zzco = covalue.
    tablenode = wd_context->get_child_node( name = 'DISPLAY_STATE' ).
    tablenode->bind_elements( itab_St ).
    Any ideas appreciated.  Thanks in advance.

    Hello,
    the supply method runs only when the node is invalid
    this is the case when you start your application.
    solution
    1. You can make the node invalid with the   method "INVALIDATE" in the method which is triggered by your back button.
    2.Don't use the supply method use the method which belongs to the inbount-plug called handle......
    3. You can change th lifetime in property of the view from
    "framworkcontrolled" to "when visible"
    Klaus
    Message was edited by: Klaus Helfrich
    Message was edited by: Klaus Helfrich

  • Calling C Functions in existing DLL's from Java

    Hi Guys ,
    The tutorial in this site talks about creating ur own DLL's and then calling them from Java . I need to call C functions in existing DLL's from Java . How do I go about doing this ? . Any help on this would be much appreciated.
    regards
    murali

    What you are interested in can be done with what's called "shared stubs", from the JNI book (http://java.sun.com/products/jdk/faq/jnifaq.html), although you don't need the book to do it (I didn't).
    The example code will call functions with any number and kind of parameters, but doing that requires some assembly language. They supply working examples for Win32 (Intel architecture) and Solaris (Sparc).
    If you can limit yourself to functions to a single function signature (number and types of parameters), or at least a small set that you know you'll call at compile time, you can modify the example so that the assembly language part isn't needed, just straight C code.
    Then you'll have one C library that you compile and a set of Java classes and you can load arbitrary functions out of arbitrary dynamic libraries. In my case you don't even have to know what the libraries and functions are ahead of time, the user can set that up in a config file.
    You mentioned doing this with Delphi. One thing to watch out for is C versus Pascal (Win32) function calling convention. A good rule of thumb; if it crashes hard, you probably picked the wrong one, try the other. :-)

  • Java Webservice calling C function through JNI

    I have a java class that is using the JNI to call native interface written in C. The called C function has dependencies in vendor supplied c function library in .lib (CAUEVT.LIB) format. I compiled the C function as .DLL file and put the .DLL file in the -Djava.library.path and same thing I put in the opmn.xml file for the Java option.
    Now, when I run the Java class from command line it works fine and makes call to the external system everything works fine.
    However, when I deploy the same as web service and try to test the web service, Java expects the external library also in .DLL format (The error message is "This application has failed to start because CAUEVT.dll was not found. Re-installing the application may fix this problem")
    If I look the application log file, I see the following error.
    java.lang.UnsatisfiedLinkError: D:\lib\CAEventLoggerImp.dll: Can't find dependent libraries
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
    I am wondering if the java class can run without any problem, why is the webservice execution fails....?

    The problem was that when Java loads the shared DLL we create from the java.library.path setting, but if the loaded DLL refers to any other DLL, it expects it from the System path. And for some reason, OC4J, doesn't expose all the system path unless entered in the Evnironment Variable explicitly in the Administration tab in OEM., server properties in the OEM. (opmn.xml)
    IT works fine after these changes.

  • Use Of SUPPLY Function & Singletone Class?

    Hi,
    What is the Use of Supply Function & What is Sigletone Class?
    Thanks
    Ranveer

    Hi Ranveer,
    Each context node of a controller can be assigned a supply function. This supply
    function is called by the runtime when the data of the context node is used. This is the case
    when a UI element is to be displayed for the first time with the data of the corresponding
    context.
    In general, the supply function is called when one or more elements of a context node are
    accessed and when
    ● the context node is not filled yet or is initial, or
    ● the context node has been invalidated in a previous step.
    Supply Functions of Singleton Nodes
    The supply function is especially useful in combination with singleton nodes.The
    values of subnode elements of the type Singleton depend on the element of the parent node
    to which the lead selection is currently assigned. If the lead selection is changed by the user,
    the supply function can access the new lead selection element and recalculate the values of
    the subnode elements accordingly.
    You can only create such a view when the lead selection element of the node
    CARRIER_NODE is read in the supply function of the node CONNECTION_NODE:
    For eg:
    method GET_CONNECTIONS .
    data: CARR_ATTR type IF_MAINVIEW=>ELEMENT_CARRIER_NODE,
    FLIGHTS type SPFLI_TAB.
    get filled structure for parent node
    PARENT_ELEMENT->GET_STATIC_ATTRIBUTES( importing
    STATIC_ATTRIBUTES = CARR_ATTR ).
    get connections from help class
    FLIGHTS = CL_WD_GET_SPFLI=>GET_FLIGHTS_BY_CARRID(
    CARRID = CARR_ATTR-CARRID ).
    NODE->BIND_ELEMENTS( FLIGHTS ).
    endmethod.
    Explanation:
    An internal variable of the type of a context element of the parent node
    CARRIER_NODE and another internal variable of the Dictionary type SPFLI_TAB are
    declared.
    ● The attribute values of the lead selection element of the parent node CARRIER_NODE
    are then passed to the internal variable CARR_ATTR.
    For this transfer, each supply function uses the parameter
    PARENT_ELEMENT of the reference type IF_WD_CONTEXT_ELEMENT.
    PARENT_ELEMENT is a reference to the lead selection element of the parent node of
    the current node. The parameter is automatically displayed in the signature of the
    supply function.
    Each time the user selects another table element as the lead selection in the table Carrier,
    the value of the parameter PARENT_ELEMENT changes. The supply function of the context
    node CONNECTION_NODE is called and the values of its attributes are newly filled
    according to the selected table line in the table Carrier.
    Supply functions can only access context data that
    ■ is contained in the corresponding parent node or
    ■ is contained in another node that is on a next-highest level compared to
    the node filled by the corresponding supply function.
    Cheers,
    Mary

  • Specialty of supply function and  how can we use it efficiently?

    Hi Experts,
    I have one question.
    What exactly the function of “Supply function” for a node.
    Some says when ever lead change happens the “Supply function” triggers.
    I put a break point in Supply function say “ZSupply” written code to populate the table.
    It triggered only once to populate the table. If this is the functionality then I can write code in method and call it in modify view my checking it for first time why “supply function”.   I want to know what is its specialty, how can we use it efficiently?
    Thanks
    Gopal

    Hi Gopal,
    You are correct even without supply function you can achieve the same functionality i.e when ever there is a change in HEADER the corresponding ITEM for the HEADER can be displayed.
    But the idea of using SUPPLY Function is - the code written in the node i.e assume HEADER and ITEM relation gets executed as and when the node is instantiated in the run time where in there is no need us to handle it explicitly.
    If not used SUPPLY Function then we need to handle the complete HEADER and ITEM relation explicitly.
    Regards,
    Mohammed

  • Bind allowed if a node has a supply function or a supplying relation role

    Hello Context-exports,
    I am using NetWeaver CE 7.1 and have implemented a WebService TRCROOF with the following method:
    public void assign(List<TRPartDTO> trparts);
    The class TRPartDTO is defined as follows:
    public class TRPartDTO implements Serializable {
        BigDecimal idProject;
        BigDecimal idSynth;
        String traceIndex;
        String serialNo;
    I have imported the WebService into WebDynpro as Adaptive WS-Model.
    The wizard has built this context:
    Request_Assign
    ---Assign
    Trparts
    IdProject
    IdSynth
    TraceIndex
    SerialNo
    ---Response_Assign
    In wdDoInit I call the following sequence, which works fine:
    TRCROOF_MODEL trcRoofModel = new TRCROOF_MODEL();
    Request_Assign request_Assign = new Request_Assign(trcRoofModel);
    Assign assign = new Assign(trcRoofModel);
    request_Assign.setAssign(assign);
    wdContext.nodeRequest_Assign().bind(request_Assign);
    Now I try to call the WebService-Method and to deliver a list to it:
    ITrparts_Assign_TRPartsElement newPart;
    Vector<ITrparts_AssignElement> partList = new Vector<ITrparts_AssignElement>();
    for (int ix = 0; ix < cnt; ix++) {
       newPart = wdContext.nodeTrparts()
                  .createTrparts_Element(
                       new TrPartDTO(trcRoofModel);
       newPart.setIdProject(...);
       newPart.setIdSynth(...);
       newPart.setSerialNo(...);
       newPart.setTraceIndex(...);
       partList.add(newPart);
    wdContext.nodeTrparts_Assign_TRParts().bind(partList);
    But when calling bind() I get an exception that essentially tells me:
    "calling bind is not allowed if a node has a supply function or a supplying relation role"
    Background info:
    My EJB defining the WebService implements another DTO-class named RoofDTO, which includes a List of TRPartDTO:
    public class RoofDTO implements Serializable {
        private List<TRPartDTO> trparts;
    But this class is not used in conjunction with the method assign().
    Nevertheless the wizard that imported the WebService-Model of course has
    defined a relation betweeen these classes.
    Could anybody explain the situation or even tell me how to fix my problem?
    Thanks for each hint,
    Christoph

    Oops,
    forget this silly question. In case that anybody else has such cranky trains of thoughts as me: Do it like this:
    Vector<TrPartDTO> partList = new Vector<TrPartDTO>();
    trcRoofModel = new TRCROOF_MODEL();
    for (int ix = 0; ix < ...; ix++) {
       partList.add(new TrPartDTO(trcRoofModel));
    wdContext.currentAssignTRPartsElement().modelObject().setTrparts(partList);
    Kind regards,
    Christoph

  • What is Supply Function, use of Supply function?

    Hi Guru's,
    Can you give a definition or description of Supply Function, and what is the use?
    Thanks,
    Pradeep.

    Hi Pradeep,
    Okay, conceptually you have understood it, that is good
    Hope you have also, visited this link
    Supply function with singleton concept | Webdynpro ABAP
    Then let us have a simple example to understand how it works.
    Let us say we have  parent node PNODE & child node CNODE
    PNODE node has 2 records and for each record CNODE has 3 records
    Whenever the data of PNODE is bound/changed, the supply function of CNODE executes. Hence, you are able to get the control during initialization.
    Now, if you have set the lead selection at line 2, i.e.  there is change to context PNODE, hence the supply function of CNODE triggers and it gets the reference of 2nd record in PARENT_ELEMENT inside supply function and based on this the child node data can be populated.
    Even, if you refresh node PNODE using method lo_pnode->INVALIDATE( ), the supply function of CNODE triggers.
    Hence, whenever there is change at PARENT'S context node, the supply function of its child node(s) gets called.
    Hope it gives little light on the supply function's  practical usage.
    Regards,
    Rama

  • Difference between method,event handler,supply function.

    hi,
    i wants to know what is the difference between
    method.
    event handler.
    supply funciton.
    Regards:
    Pankaj Aggarwal

    Hi Pankaj,
    These are few lines from the F1 help documentation given,
    Web Dynpro: Method Type :The type of a method defines whether you have an event handler, a supply
                                                function, or a (normal) method.
      Event Handler : Handlers of an event, a controller, an action, or an inbound plug of a view.
       Method : Modularization unit within a view or a controller.Methods of a view can only be called locally
                       within this view.Methods of a controller (component or custom controller) can also be called from
                       a view or another controller, provided the controller is entered as controller used .
       Supply Function : Method for filling a context node.
    For more information refer to the Thomas post
    Regards,
    Sravanthi

  • Call Library Function Running slow

    Hi
    I’m using a third party IO board for DAQ experiment. To create a real-time DAQ VI I used the DLL file which’s supplied by the manufacture, I managed to get the VI working to read from the board by using the Call Library function. But the vi running slow, it takes about 10s to get the reading or spot any change, while using Visual basic application any changes are spotted instantly
    Any help will be appreciated
    Marwan
    http://www.geocities.com/marwan_m13/weemee8080.jpg
    Attachments:
    Project[2].vi ‏42 KB

    Just for analysing, where the timeleakage occurs:
    Try to measure the execution time of the library function(s). It whould
    be interesting, if they realy produce the timeleakage or not.
    I modified your project for this (see attachment).
    Attachments:
    Project[2].vi ‏53 KB

  • Call Library Function Node

    When using a call library function node and program is exited, I get a "has encountered a problem and needs to close" error having to do with ntdll.  It doesn't stop the program from running correctly, but it is annoying.  Any ideas?
    Solved!
    Go to Solution.

    Sorry about the missing information.  This is my first post.  I am using Labview 2010 on Windows XP SP3.  I am including a stripped down version of my application that will produce the same error along with the project file.  This only happens when the application is built into an executable.  It will also occur if the application is closed before FindWindowA is called.  I'm also including a file containing the error that comes up.  I appreciate all the help.
    As to why I'm doing this myself?  Ignorance would be the best explanation.  A machine supplier gave me a VB program to communicate with his application.  I used the same functions in Labview to do the communication and it worked great.  I thought that was pretty cool. 
    Attachments:
    FindWindowA Test.vi ‏25 KB
    FindWindowA Test.lvproj ‏7 KB
    FindWindowA Error.JPG ‏28 KB

  • Executable created in LabVIEW 7.1 containing Call Library Function Node runs but creates error when Call Library Function Node is executed

    I have created a simplee application that controls a piece of equipment with all control via a supplied dll.  Hence, there are a number of Call Library Function Nodes within the code and a modicum of other LabVIEW code.  Everything works fine as a LabVIEW application, but when converted to an executable, although the application runs and functions, as soon as any Call Library Function Node is executed, calling from the dll, I get the C++ debug error in the attachment.
    Is this something that I can solve from within LabVIEW, or is the problem likely buried in the dll?
    Damian
    Attachments:
    CLFN error.JPG ‏22 KB

    Hi Wise,
    Try building an executable from a very simple VI that makes one call to the dll. Have you also try using the Call Library Function node on other simple dlls that you know will work?
    Regards,
    Stanley Hu
    National Instruments
    Applications Engineering
    http://www.ni.com/support

  • Breifly xplain  wht lead selection ,cardinality &singleton&supply function

    Hi Friends ...
                 Let plz xpalin in breif   wht is lead selection ,cardinality &singleton&supply function and how these all helpfull whtz the relation ship between while creating a table...
    itz bit urgent for me am working with dynamic tables and am in confuse...plz make it out this query...

    Lead selection
         Leadselection is the property which is used to get the index of the selected row of the table
    "OnLeadSelect" is the method used to fire an action when a row is selected
         The Method wdContext.<node>().getLeadSelection() can be used to
    find out the index of the selected element.
    Cardinality
    Any node or attribute that has the context root node as its immediate parent, is known as an independent node or attribute.
    Any node or attribute that has some other node as its immediate parent, is known as a dependent node or attribute.
    All context nodes are collections.
    A node collection is composed of elements, where an element is an aggregation of the node’s immediate children (attributes and/or other nodes).
    The cardinality property controls the number of elements a node collection may hold at runtime.
    Every context node has a property called Cardinality. This property is composed of two values that
    taken together, describe the maximum and minimum number of elements the node collection may hold
    at runtime.
    Cardinality Minimum: 0 or 1
    Cardinality Maximum: 1 or n
    Therefore, there are four possible cardinality values (specified as <Min>..<Max>)
    0..1 Zero or one elements permitted
    0..n Zero or more elements permitted
    1..1 One and only one element permitted
    1..n One or more elements permitted
    Singleton
    All independent nodes are forced to be singletons. This is because the context root node has one and only one element.
    Singleton is  boolean
    TRUE : One instance will be created for all te nodes
    FALSE : Every Element in the parent node collection,there will be a distinct instance of the child node.
    Why Singleton
         -Efficiency
         -Less Memory
         -Lazy Data Access(Creates instance only when needed,till then it will remain unprocessed)
    Supply functions
         Supply functions are the mechanism to repopulate child nodes when the lead selection in the parent node
    changes. When a singleton child node is declared, you must also write an accompanying supply function.
    The Web Dynpro Framework will then automatically call your supply function when the lead selection
    in the parent node changes.
    Regards
    Chaitanya.A

Maybe you are looking for