How to pass a struct to LabView

I have a LabVIEW application that reads data from SCRAMNet card and process/display data to front panels. 
NI provides SCRAMNET.llb (a set of VIs using Call Library Function Node) to call read/write functions in a vendor provided DLL that supports SCRAMNET card.  But the problem is that every time to get the data from the card in LabVIEW, you have to provide specific memory offset to call the read/write VIs in SCRAMNET.llb.  Dealing with offset values to get data seems cumbersome.  
We have struct data type defined in a header file for the program that writes data to the SCRAMNET card.  I am just wondering if there is something I can do in LabView that the DLL returns the struct as a pointer and load it to a cluster so that I can access the SCRAMNET struct data via accessing each element of the cluster.  If it is possible, is it an easy thing to do or not. 
Thanks for your advice in advance!

Sorry, that's my signature and no reffering for this topic. But I think there is no problem to pass a structure from DLL to LV and back. I did it more than once.
And how I sad, you can unflatten your structure in LabVIEW to a cluster. There may be some problems in unflattening if you have arrays in your structure. So you have to unflatten the peace of structure before array, than unflatten the array and then the rest of the structure.
LabVIEW Portal

Similar Messages

  • How to pass native struct to java

    Hey guys,
    I've got a legacy C++ prog that outputs structs to a binary file & I've got a header file defining that struct.
    I want to read the file and get the structs via java but I've never used any interface between the languages.
    All I've managed to come up in my searches is "how to pass java objects to c", well how do I do the opposite?
    Help appreciated

    I hear you calling me :)
    If this interests you I'll explain the problem from the beginning-
    I already have a C prog which outputs a HUGE binary file (therefore text is probably not a good idea),
    this file consists of a header followed by some number (defined in the header) of a certain struct (consisting of ~20 fields ints, longs, strings...)
    Another C program exists that reads this file. I am currently building some sort of visual interpretation of the data using java.
    As all C code is quite heavy duty [and works like it should :)], and a few other reasons, I do not want to change it.
    That leaves me with an existing file containing binary data I need to read into the Java UI.
    sztejkat > Why use native code?
    I would have really wished I could do this entirely in Java, as for portability - it doesn't have much consideration, just in terms of "clean" programming.
    As you said struct packing is something unpredictable, therefore I do not see a way of reading one without using C.
    bschauwejava > I suggest you try to be less vague about the results you are getting.
    Sorry :)
    This is the structure: File (package) -> File.java, InsInfo.java (classes)
    I'm using "javac File.java"
    And I'm getting:
    File.java:3: cannot resolve symbol
    symbol : class InsInfo
    location: package File
    import File.InsInfo;
    ^
    File.java:20: cannot resolve symbol
    symbol : class InsInfo
    location: class File.File
    public native InsInfo readIns();
    ^
    2 errors
    (the arrows actually point to the first letter in the class name)
    If I use "Object" instead of "InsInfo" javac compiles the .class without problems.
    I'm using Jbuilder and inside it the import is OK. When I compile it with Jbuilder everything is OK.
    I actually haven't thought of this until now, I'll try to use the .class Jbuilder produces to generate the header.
    btw- Thanks for getting so involved!!

  • How to pass a struct to a DLL function and accessing it in another VI

    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM

    aajjf wrote:
    Hi friends,
                       I am new to labview. I need to create a demo program in labview ,for displaying image from our own image capturing system. We have a  DLL ( build in VC++) containing functions for capturing image from our system. Now I need to create a VI library for some of functions in DLL and Create a Demo program using those created subvi library . I used "Call Function node" and created some of subvi's.
     Some of our DLL functions need to pass struct pointers.  Our function prototype will be similar to the following function.
    __declspec(dllexport) int __stdcall Initialize( unsigned char *imagebuffer,struct config *Configuration);
    The passed struct is similar to
    struct config
      double                val1[3];
      unsigned short   val2;
      bool                    val3;
      bool                    val4[3];    
      unsigned char    val5;    
      unsigned char   val6[3];
      bool                    val7[26];
    For passing "unsigned char *imagebuffer"  I initialized array with "Numeric constant " and set the size of the array and send to the function.
    The problem here is, I used this array in one of the subvi. 
    How can I use the returned imagebuffer array  in my main demo program. How to connect the image array to subvi "Connecter Pane"
    And  which control  can I use to display the image. The image data I get is form of 1-D Array .
    The second problem is,
                                 For passing the structure,  I used "Bundle " and filled the bundle with all the datatypes as in my struct and passed to the function. Is it correct ?  How to access this bundle after returned from function  in another Vi. ie.) How to connect this bundle to the connter pane ?
    Thanks for your valuable suggestions.
    aajjf.
    Message Edited by aajjf on 04-19-2007 05:34 AM
    You say nothing about how your cluster looks but I'm afraid you did the standard error here and placed arrays in it. That is not what the C structure is representing for several reasons.
    First fixed size arrays in C are inlined inside a structure, so are not a pointer but for the case of your val1 element three doubles.
    Second although not relevant here because of above point: LabVIEW arrays are not the same as C arrays. LabVIEW uses a pointer to a pointer and has the size of the array in elements prepended to the array data. C simply uses a pointer and all the rest is the programmers sorrow. The Call Library Node does convert the top level element of variables you pass according to the type configuration of that parameter but does no conversion of internal elements at all. So passing clusters with anything like arrays or strings is always wrong unless the DLL is aware of the specific datatypes LabVIEW uses.
    Last but not least you can end up with alignment issues. Elements in structures are aligned by every C compiler to a certain value. This value can be defined by the programmer in the project settings or for Visual C through #pragma pack() statements in the C code. The alignment rule says that an variable is aligned to the smaller of the two values that are either a multiple of the variable element size or the alignment setting. Most 32bit code nowadays uses 8 bit default alignment but LabVIEW always uses 1 byte. In your case there is nothing to observe since the large variables are at the beginning. Otherwise you might have had to insert filler elements in the LabVIEW cluster.
    One last thing bool is a C++ type only. Its size is 1 byte and incidentially this is the same LabVIEW uses for Booleans.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to pass a pointer in labview library call function by using dll programmed in Labwindows​?

    Hi,
    I'm trying to interface a camera with Labview.  However, the camera can only be programmed by C, so I'm using Labwindow CVI.
    I need to pass a camera handle from one function to another, eg. from a opencamera function to setparameter function.  
    /* Load the Qcam driver and Open the First Camera */
    void DLLEXPORT LoadDriverAndOpenCamera()
    QCam_CamListItem cameraList[10];
    unsigned long cameraListLength=sizeof(cameraList)/sizeof(cameraL​ist[0]);
    //load the driver
    QCam_LoadDriver();
    //get a list of the cameras
    QCam_ListCameras(cameraList,&cameraListLength);
    //listLength is now the number of cameras available
    QCam_Handle hCam;
    //Open the first camera in the list
    QCam_OpenCamera(cameraList[0].cameraId, &hCam);
    Apparently, caemraId is an unsigned long (unsigned 32-bit in Labview 2012 32-bit? ) and QCam_Handle is defined as void*, so it's a pointer that points to an unsigned 32-bit.
    When I only use C for programming, I can pass hCam variable to other functions as long as it's declared as global variable.  Ex, the next function can be void SetParameter(QCam_Handle hCam).  However, here I'm trying to make a dll by Labwindows/CVI and then call LoadDriverAndOpenCamera() function through library call in Labview.  
    My question is:  How can I pass hCam to other functions in the same dll?  Do I have to add paramter to the function? For example:
    void DLLEXPORT LoadDriverAndOpenCamera(unsigned long cameraId, QCam_Handle* cameraHandle)
    And then add two lines:
    cameraId=cameraList[0].cameraId;
    cameraHandle=hCam;
    into the function?  Then I can pass cameraHandle out?  However, hCam will still have void* type.
    Even if that's the case, how can I set up library call node on Labview?  In the arg parameter set up, I don't see pointers?  It seems I cannot set up an output node to be a pointer that points to a unsigned long.
    Thank you very much for your help!
    Best,
    Charles
    Solved!
    Go to Solution.

    Hello Charles, 
    I noticed you posted a similar question here. do you have any further questions about using the call library function node? 
    Haley N
    Applications Engineer
    National Instruments

  • How to pass Visa Resoure Name parameter to labview dll in labwindows​​/cvi

    Hi, everyone
    I build a dll from labview, the prototype is : double  getchannelpower(double f, uintptr_t *VISAResourceName);
    I don't know how to pass VISAResourceName to this function.How can I get the VISAResourceName of this type(uintptr_t *)?
    Is it related to the paremeter ViPSession in function viOpen(ViSession sesn,ViRsrc rn,ViAccessMode am,ViUInt32 ti,ViPSession vi)?
    BRs,
    lotusky

    1. uintptr_t *VISAResourceName in the labview dll is connected to viOpen function as input parameter internally.
    2.I can call the labview dll in labview via CLF Node, when the VISAResourceName parameter is set  to Numeric(32-bit int or 32-bit usigned int) OR Adapt to data(Handle by Value). And I got the value of the VISAResourceName parameter, which is 0; When I directly connect 0 to the dll, it still works. But in labwindows, when  I pass 0 to the VISAResourceName parameter of the dll function, I got a FATAL RUN-TIME ERROR: The program has caused a 'General Protection' fault.
    mkossmann 已写:
    Could you check what exactly uintptr_t *VISAResourceName in your labview dll does.Might it be that it is connected to the labviews Dll internal ViOpen() ViSession output parameter ?.   And the name VISAResourceName is misleading.
    Another idea would be that Labview uses 32bit Unicode for the ResourceName. And you have to convert the C String to that Unicode first.

  • How to pass a structure in PL/SQL external proc.

    This is for educational purpose only. I am trying to implement kernel32.dll and shell32.dll in PL/SQL using external proc. Everything is working fine, except When there is a structure in OUT parameter.
    My database version.
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - ProductionI have set up the listner.ora and tnsnames.ora and written a package called dbms_kernel32sb.
    There are 9 program units.
    1. CreateFile -- working fine
    2. CloseFile -- working fine
    3. GetSize -- working fine
    4. FindFirstFile -- NOT working, because one OUT parameter has the structure type WIN32_FIND_DATA.
    5. GetFileTime -- NOT working, because one OUT parameter has the structure type FILETIME
    6. GetDiskFreeSpace -- working fine
    7. GetDriveType -- working fine.
    8. GetLastError -- working fine
    9. ExecuteCommand -- working fine.
    Here is the package specification:
    CREATE OR REPLACE PACKAGE dbms_kernel32sb AS
        Name: dbms_kernel32sb.pks
        Author: Saubhik Banerjee
        Date: 24th Jan 2011
        Version: 1.0
        Comment: This package is to implement some functionality from kernel32.dll.
                 Usng extproc
    OPEN_EXISTING_FILE CONSTANT PLS_INTEGER :=3;
    FILE_ATTRIBUTE_NORMAL CONSTANT PLS_INTEGER :=128;
    DISABLE_FILE_SHARE_MODE CONSTANT PLS_INTEGER :=0;
    NO_FILE_SECURITY_ATTRIBUTE CONSTANT PLS_INTEGER :=0;
    NO_TEMPLATE_FILE CONSTANT PLS_INTEGER :=0;
    GENERIC_FILE_ACCESS CONSTANT PLS_INTEGER :=0;
    FILE_SIZE_HIGH CONSTANT PLS_INTEGER :=400000000;
    EXECUTE_FILE CONSTANT VARCHAR2(4):='open';
    PRINT_FILE CONSTANT VARCHAR2(5):='print';
    NO_PARAMATER CONSTANT VARCHAR2(2):=' ';
    FUNCTION CreateFile(pi_FileName VARCHAR2 --1, File name
                ,pi_DesiredAccess BINARY_INTEGER --2, Type of access required (read/write ect)
                ,pi_ShareMode BINARY_INTEGER --3,  share mode
                ,pi_SecurityAttributes BINARY_INTEGER --4, securoty attribute
                ,pi_CreationDisposition BINARY_INTEGER --5, open existing, create new etc
                ,pi_FlagsAndAttributes BINARY_INTEGER --6, File attribute- normal
                ,pi_TemplateFile BINARY_INTEGER) --Not required.
        Return BINARY_INTEGER;
    FUNCTION CloseFile (pi_FileHandle BINARY_INTEGER)
                         Return BINARY_INTEGER;
    FUNCTION GetSize (pi_FileHandle BINARY_INTEGER,
                       pio_FileSizeHigh IN OUT BINARY_INTEGER)
                   RETURN BINARY_INTEGER;
    FUNCTION FindFirstFile ( pi_FileName VARCHAR2
                             ,pio_Win32_Find_data OUT 
                                 WIN32_FIND_DATA
    RETURN BINARY_INTEGER;                                             
    FUNCTION GetFileTime ( pi_FileHandle BINARY_INTEGER
                           ,pio_FileCreationTime IN OUT FILETIME
                           ,pio_LastAccessTime   IN OUT FILETIME
                           ,pio_LastWriteTime    IN OUT FILETIME
    RETURN BINARY_INTEGER;
    FUNCTION GetDiskFreeSpace ( pi_RootPathName VARCHAR2
                                ,pio_SectorsPerCluster  OUT BINARY_INTEGER
                                ,pio_BytesPerSector   OUT BINARY_INTEGER
                                ,pio_NumberOfFreeClusters  OUT BINARY_INTEGER
                                ,pio_TotalNumberOfClusters  OUT BINARY_INTEGER
    RETURN BINARY_INTEGER;    
    FUNCTION GetDriveType( pi_driveLetter VARCHAR2) RETURN VARCHAR2;
    FUNCTION GetLastError RETURN BINARY_INTEGER;   
    FUNCTION ExecuteCommand ( pi_OperationType VARCHAR2
                              ,pi_FileName VARCHAR2
                              ,pi_Parameters VARCHAR2
                              ,pi_DefaultDirectory VARCHAR2
    RETURN VARCHAR2;
    END dbms_kernel32sb;
    Here is the package body:
    CREATE OR REPLACE PACKAGE BODY dbms_kernel32sb AS
    /* Name: dbms_kernel32sb.pkb
        Author: Saubhik Banerjee
        Date: 24th Jan 2011
        Version: 1.0
        Comment: This package is to implement some functionality from kernel32.dll.
                 Usng extproc
      FUNCTION
      CreateFile( pi_FileName VARCHAR2 --1
                , pi_DesiredAccess BINARY_INTEGER --2
                , pi_ShareMode BINARY_INTEGER --3
                , pi_SecurityAttributes BINARY_INTEGER --4
                , pi_CreationDisposition BINARY_INTEGER --5
                , pi_FlagsAndAttributes BINARY_INTEGER --6
                , pi_TemplateFile BINARY_INTEGER) --7
        Return BINARY_INTEGER IS EXTERNAL LIBRARY kernel32 Name "CreateFileA"
        PARAMETERS(  pi_FileName STRING
                   , pi_DesiredAccess long
                   , pi_ShareMode long
                   , pi_SecurityAttributes long
                   , pi_CreationDisposition long
                   , pi_FlagsAndAttributes long
                   , pi_TemplateFile long
                   , return long);
    FUNCTION CloseFile (pi_FileHandle BINARY_INTEGER)
                         Return BINARY_INTEGER
         IS EXTERNAL
         LIBRARY kernel32 Name "CloseHandle"
         PARAMETERS (pi_FileHandle long, return long);
    FUNCTION GetSize (pi_FileHandle BINARY_INTEGER,
                       pio_FileSizeHigh IN OUT BINARY_INTEGER)
                   RETURN BINARY_INTEGER
         IS EXTERNAL
        LIBRARY kernel32 NAME "GetFileSize"
        PARAMETERS (pi_FileHandle long, pio_FileSizeHigh long, return long );
      FUNCTION GetFileTime ( pi_FileHandle BINARY_INTEGER
                           ,pio_FileCreationTime IN OUT FILETIME
                           ,pio_LastAccessTime   IN OUT FILETIME
                           ,pio_LastWriteTime    IN OUT FILETIME
       RETURN BINARY_INTEGER
         IS EXTERNAL
        LIBRARY kernel32 NAME "GetFileTime"
        WITH CONTEXT
        PARAMETERS ( CONTEXT,
                      pi_FileHandle long
                    , pio_FileCreationTime  OCIColl
                    , pio_FileCreationTime INDICATOR SHORT
                    , pio_LastAccessTime  OCIColl
                   , pio_LastAccessTime INDICATOR SHORT
                    , pio_LastWriteTime OCIColl
                    , pio_LastWriteTime INDICATOR SHORT
                    , return long );                  
    FUNCTION FindFirstFile ( pi_FileName VARCHAR2
                             ,pio_Win32_Find_data OUT 
                                 WIN32_FIND_DATA
    RETURN BINARY_INTEGER
    IS EXTERNAL
        LIBRARY kernel32 NAME "FindFirstFileA"
        --WITH CONTEXT
        PARAMETERS
                    ( --CONTEXT,
                     pi_FileName STRING--, pi_FileName INDICATOR SHORT
                    , pio_Win32_Find_data  BY REFERENCE OCIColl--,pio_Win32_Find_data INDICATOR long
                    , return long );
    FUNCTION GetDiskFreeSpace ( pi_RootPathName VARCHAR2
                                ,pio_SectorsPerCluster  OUT BINARY_INTEGER
                                ,pio_BytesPerSector   OUT BINARY_INTEGER
                                ,pio_NumberOfFreeClusters  OUT BINARY_INTEGER
                                ,pio_TotalNumberOfClusters  OUT BINARY_INTEGER
    RETURN BINARY_INTEGER
      IS EXTERNAL
        LIBRARY kernel32 NAME "GetDiskFreeSpaceA"
        PARAMETERS (  pi_RootPathName STRING
                    , pio_SectorsPerCluster BY REFERENCE long
                    , pio_BytesPerSector BY REFERENCE long
                    , pio_NumberOfFreeClusters BY REFERENCE long
                    , pio_TotalNumberOfClusters BY REFERENCE long
                    , return long );   
      FUNCTION GetDriveTypeA( pi_driveLetter VARCHAR2) RETURN BINARY_INTEGER   
      IS EXTERNAL
      LIBRARY kernel32 NAME "GetDriveTypeA"
      PARAMETERS (pi_driveLetter STRING, RETURN long);
    FUNCTION GetDriveType( pi_driveLetter VARCHAR2) RETURN VARCHAR2 IS
    BEGIN
      CASE  GetDriveTypeA(pi_driveLetter) 
       WHEN 2 THEN RETURN 'Removable';
       WHEN 3 THEN RETURN 'Drive Fixed';
       WHEN 4 THEN RETURN 'Remote';
       WHEN 5 THEN RETURN 'Cd-Rom';
       WHEN 6 THEN RETURN 'Ram disk';
       ELSE RETURN 'Unrecognized';
    END CASE;                              
    END;
    FUNCTION GetLastError  RETURN BINARY_INTEGER
    IS EXTERNAL
    LIBRARY kernel32 NAME "GetLastError"
    PARAMETERS (return long);
    FUNCTION ShellExecute( pi_Hwnd BINARY_INTEGER
                          ,pi_Operation VARCHAR2
                          ,pi_FileName VARCHAR2
                          ,pi_Parameters VARCHAR2
                          ,pi_DefaultDirectory  VARCHAR2
                          ,pi_ShowCmd BINARY_INTEGER
                          ) RETURN BINARY_INTEGER
    IS EXTERNAL
    LIBRARY SHELL32 NAME "ShellExecuteA"
    PARAMETERS (pi_Hwnd long,pi_Operation STRING,pi_FileName STRING
                 ,pi_Parameters STRING,pi_DefaultDirectory STRING
                 ,pi_ShowCmd long, return long
    FUNCTION ExecuteCommand ( pi_OperationType VARCHAR2
                              ,pi_FileName VARCHAR2
                              ,pi_Parameters VARCHAR2
                              ,pi_DefaultDirectory VARCHAR2
    RETURN VARCHAR2 IS
      v_return_val BINARY_INTEGER;
    BEGIN
      v_return_val:= ShellExecute(0,pi_OperationType
                                 ,pi_FileName,pi_Parameters
                                 ,pi_DefaultDirectory,0
      IF v_return_val <=32 THEN
       RETURN 'Error!';
      ELSE RETURN 'Success!';
      END IF;
    END;
    END dbms_kernel32sb;
    Now the working demos:
    SQL> SET SERVEROUT ON
    SQL> /* Demo I:- How to obtain file size */
    SQL> DECLARE
      2    v_FileSize BINARY_INTEGER;
      3    v_FileSizeHigh PLS_INTEGER;
      4    v_FileHandle BINARY_INTEGER;
      5    v_filename VARCHAR2(500) :='C:\test2.csv';
      6    v_dummy BINARY_INTEGER;
      7  BEGIN
      8    v_FileSizeHigh := DBMS_KERNEL32SB.FILE_SIZE_HIGH;
      9    v_FileHandle:=DBMS_KERNEL32SB.CreateFile(v_filename -- File name
    10                            ,DBMS_KERNEL32SB.GENERIC_FILE_ACCESS
    11                            ,DBMS_KERNEL32SB.DISABLE_FILE_SHARE_MODE
    12                            ,DBMS_KERNEL32SB.NO_FILE_SECURITY_ATTRIBUT
    13                            ,DBMS_KERNEL32SB.OPEN_EXISTING_FILE
    14                            ,DBMS_KERNEL32SB.FILE_ATTRIBUTE_NORMAL
    15                            ,DBMS_KERNEL32SB.NO_TEMPLATE_FILE);
    16   v_FileSize := DBMS_KERNEL32SB.Getsize(v_FileHandle, v_FileSizeHigh)
    17   DBMS_OUTPUT.put_line('File Size in Bytes: ' ||v_FileSize);
    18   v_dummy:=DBMS_KERNEL32SB.CloseFile(v_FileHandle);
    19  END;
    20  /
    File Size in Bytes: 61
    PL/SQL procedure successfully completed.
    SQL>
    SQL> /* Demo II:- How to find free disk space  */
    SQL> DECLARE
      2    v_rootpath VARCHAR2(500) :='C:\';
      3    v_dummy BINARY_INTEGER;
      4    v_sectorspercluster BINARY_INTEGER;
      5    v_bytespersector BINARY_INTEGER;
      6    v_numberoffreeclusters BINARY_INTEGER;
      7    v_totalnumberofclusters BINARY_INTEGER;
      8    v_freespace NUMBER;
      9    v_totalspace NUMBER;
    10  BEGIN
    11    v_dummy:=DBMS_KERNEL32SB.GetDiskFreeSpace(v_rootpath
    12                                              ,v_sectorspercluster
    13                                              ,v_bytespersector
    14                                              ,v_numberoffreeclusters
    15                                              ,v_totalnumberofclusters
    16                                              );
    17                                              
    18    DBMS_OUTPUT.put_line('Sector pre Cluster: ' ||v_sectorspercluster);
    19    DBMS_OUTPUT.put_line('Bytes per sector: ' ||v_bytespersector);
    20    DBMS_OUTPUT.put_line('Number Of Free Clusters: ' ||v_numberoffreeclusters);
    21    DBMS_OUTPUT.put_line('Total Number Of Clusters: ' ||v_totalnumberofclusters);
    22    v_freespace:=v_numberoffreeclusters/1024/1024/1024;
    23    v_freespace:=ROUND(v_freespace*v_sectorspercluster*v_bytespersector,3);
    24    v_totalspace:=v_totalnumberofclusters/1024/1024/1024;
    25    v_totalspace:=ROUND(v_totalspace*v_sectorspercluster*v_bytespersector,3);
    26    DBMS_OUTPUT.put_line('Total Space (GB):' ||v_totalspace);
    27    DBMS_OUTPUT.put_line('Total number of Free space (GB): '||v_freespace );
    28  END;
    29  /
    Sector pre Cluster: 8
    Bytes per sector: 512
    Number Of Free Clusters: 739477
    Total Number Of Clusters: 9765622
    Total Space (GB):37.253
    Total number of Free space (GB): 2.821
    PL/SQL procedure successfully completed.
    SQL>
    SQL> /* Demo IV:- How to get drive type*/
    SQL> SELECT dbms_kernel32sb.GetDriveType('C:\') FROM dual;
    DBMS_KERNEL32SB.GETDRIVETYPE('C:\')
    Drive Fixed
    SQL> SELECT dbms_kernel32sb.GetDriveType('D:\') FROM dual;
    DBMS_KERNEL32SB.GETDRIVETYPE('D:\')
    Cd-Rom
    SQL> SELECT dbms_kernel32sb.GetDriveType('E:\') FROM dual;
    DBMS_KERNEL32SB.GETDRIVETYPE('E:\')
    Unrecognized
    SQL>
    SQL> /* Demo V:- How to execute an Operating System Command*/
    SQL> DECLARE
      2   v_FileToExecute VARCHAR2(20):='test.bat';
      3   v_Parameter VARCHAR2(20):='test1.csv';--dbms_kernel32sb.NO_PARAMATER
      4   v_DefaultDirectory VARCHAR2(20):='C:\';
      5   v_ReturnValue VARCHAR2(20);
      6  BEGIN
      7    v_ReturnValue:=dbms_kernel32sb.ExecuteCommand(dbms_kernel32sb.EXECUTE_FILE
      8                                                  ,v_FileToExecute
      9                                                  ,v_Parameter
    10                                                  ,v_DefaultDirectory
    11                                                  );
    12   DBMS_OUTPUT.put_line('Status: '||v_ReturnValue);                               
    13  END;
    14  /
    Status: Success!
    PL/SQL procedure successfully completed.
    SQL> Now the sub programs with structures are NOT getting called successfully.
    SQL> /* Demo III:- How to obtain file time */
    SQL> DECLARE
      2    v_FileHandle BINARY_INTEGER;
      3    v_filename VARCHAR2(500) :='C:\test2.csv';
      4    v_dummy BINARY_INTEGER;
      5    v_filecreationtime FILETIME;
      6    v_lastaccesstime FILETIME;
      7    v_lastwritetime FILETIME;
      8    v_err BINARY_INTEGER;
      9  BEGIN
    10    v_FileHandle:=DBMS_KERNEL32SB.CreateFile(v_filename -- File name
    11                            ,DBMS_KERNEL32SB.GENERIC_FILE_ACCESS
    12                            ,DBMS_KERNEL32SB.DISABLE_FILE_SHARE_MODE
    13                            ,DBMS_KERNEL32SB.NO_FILE_SECURITY_ATTRIBUTE
    14                            ,DBMS_KERNEL32SB.OPEN_EXISTING_FILE
    15                            ,DBMS_KERNEL32SB.FILE_ATTRIBUTE_NORMAL
    16                            ,DBMS_KERNEL32SB.NO_TEMPLATE_FILE);
    17   v_dummy := DBMS_KERNEL32SB.GetFileTime( v_FileHandle
    18                                          ,v_filecreationtime
    19                                          ,v_lastaccesstime
    20                                          ,v_lastwritetime
    21                                          );
    22   v_err:=DBMS_KERNEL32SB.GetLastError;                                
    23   DBMS_OUTPUT.put_line('File Size in Bytes: ' ||v_dummy);
    24   DBMS_OUTPUT.put_line('Error:'||v_err);
    25   v_dummy:=DBMS_KERNEL32SB.CloseFile(v_FileHandle);
    26  END;
    27  /
    File Size in Bytes: 0
    Error:203
    PL/SQL procedure successfully completed.
    SQL> So, I have noticed that, Where ever a STRUCTURE is involved in external routine, there is a problem. I want to know, How to implement functions with STRUCTURE as OUT parameter.
    Forgot to mention: This is my FILETIME object which corresponds to FILETIME structure of win32.
    CREATE OR REPLACE TYPE FILETIME_rec IS OBJECT
                              ( LowDateTime NUMBER
                               ,HighDateTime NUMBER
    CREATE OR REPLACE TYPE FILETIME IS TABLE OF  FILETIME_rec;Edited by: Saubhik on Feb 1, 2011 4:15 PM

    Saubhik wrote:
    This is for educational purpose only. I am trying to implement kernel32.dll and shell32.dll in PL/SQL using external proc. Interesting. Familiar with the Wn32 API, but do not run Oracle on Windows and never looked at this aspect of integration.
    So, I have noticed that, Where ever a STRUCTURE is involved in external routine, there is a problem. I want to know, How to implement functions with STRUCTURE as OUT parameter.
    Forgot to mention: This is my FILETIME object which corresponds to FILETIME structure of win32.The problem is that this passes the parameter by reference and not value. In a vanilla C/C++/Delphi program, you will create a variable of that struct and then pass a long pointer to that variable when making the API call. That pointer will be dereferenced and the memory it points to, populated. This is not a problem as the underlying DLL you call that does this, uses your process's data segment.
    Extproc is different. In order to protect the integrity of the database server process, an external call is done by a "proxy" process. It acts as the interface between your PL/SQL code and the actual external call.
    In this case, this "proxy" process will be doing the implicit LoadLibrary() call to load kernel32.dll interface - and the DLL will expect to dereference and access this process's memory struct to populate it. This "proxy" process in turn needs to know that despite it calling the interface by reference, it needs to return that parameter to PL/SQL by value - as your PL/SQL code cannot dereference a pointer passed back by that "proxy" process and access its memory to gain access to that struct.
    In basic terms - that argument is a 32 bit number containing a pointer. That is what the "proxy" process needs to pass to the interface call. Your code is passing a struct and not a pointer, right?
    And that is the basic problem I believe. How to address this.. not sure. You can have your own DLL as interface that does not use pointers but expect arguments to be passed by value. But this will suck as you then need to include a custom DLL to deploy and have PL/SQL call that, instead of simply accessing and calling the native kernel interface.
    Doubt that many Win32 programmers with OCI (Oracle Call Interface) frequents this forum. So perhaps this is not the best place to ask. I would be hitting Metalink (support.oracle.com) search function in your sho3s though as there should be support notes dealing with this subject matter.

  • How Do I set up a LabView ActiveX server?

    Are there any documenation or sample program which is about how to setup a LabView ActiveX server? my C++ program will dynamically call VI and then pass the integer to Labview program via ActiveX and then perform some control of digital oscillscope. Do anyone help me? thanks for help so much......It is in hurry......please help..............
    CowCow

    From the NI knowledge base...
    Problem: How do I enable LabVIEW as an ActiveX Server?
    Solution: Under Edit >> Preferences >> Server: Configuration, select ActiveX as a protocol and enable all server resources. Under Edit >> Preferences >> Server: Exported VIs, list the name of all VIs that can be accessed remotely. You can include the full path to the VI, or just list its name. Wildcard characters are valid. You can explicitly deny access to certain VIs by clicking the Deny Access button. Note that changes to the Server will not take effect until LabVIEW is relaunched.

  • Who knows how to output some text once labview detects something I want using pattern matching(V​ision assistant)​?

    who knows how to output some text once labview detects something I want using pattern matching(Vision assistant)?
    The text is something like"Yes, this is a coin"
    Thanks!

    I attached a SubVI which I used to place an overlay next to a Pattern, found by a Pattern Match before:
    As you can see, you simply pass the image reference and the Array of Matches to the VI along with the String you want to have as an overlay next to the Match.
    I also modified your VI a bit, but didn't test it. I created an Array of clusters, each elment containing the template path along with the respective text.
    Please note that this is just a hint!
    Christian
    Attachments:
    suggestion.vi ‏146 KB
    Overlay_Txt.vi ‏24 KB

  • Passing a struct from TestStand to LabWindows/CVI

    I am passing a struct to a dll written in CVI.
    Here is the problem: The code is written in CVI (c code) if I use "struct MyStruct *MyData" as the parameter definition in the dll TestStand works fine. But if I define my struct using a typedef (i.e. typdef struct MyStruct) then use MyStruct *MyData as the parameter TestStand throws a warning. 
    I an using the C\C++ adaptor.
    It is too late in the programming effort to go back and remove the typedef.
    So, how do I get TestStand to accept the typedef?
    Thanks
    Carmine
    Solved!
    Go to Solution.

    In ANSI C, the struct names and type names belong to separate namespaces. You can declare structs several different ways:
    1) struct structName { int x; };
    2) typedef struct { int x; } typedefName;
    3) typedef struct structName { int x; } typedefName; // Note: structName can be same as typedefName.
    I'm assuming you are using the 2nd example above in which case LabWindows/CVI automatically generates a struct name (something like __unknown_1) that Testand uses.
    Although you said it is too late to remove the typedef, can you add a struct name as in example 3 above? You can use the same name as the typedefName and TestStand will recognize it.

  • Pass 2D array from LabVIEW to C# problem

    Hi , I have made a dll using .net assembly to use my labview code in c# . I can easily pass string , numerical and 1D arrays from labview to c# and vice versa, but when I want to read back 2D U16 array from Labview in c# I get the following exception although they have exactly the same type (ushort)
    Cannot widen from source type to target type either because the source type is a not a primitive type or the conversion cannot be accomplished.
    Could you please let me know how should I pass 2d array from labview to c#
    Thanks

    If all else fails, you could pass n 1D arrays across and then put the original 2D array back together. That's probably how the computer would do it behind the scenes, anyway.
    Cameron
    To err is human, but to really foul it up requires a computer.
    The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
    Profanity is the one language all programmers know best.
    An expert is someone who has made all the possible mistakes.
    To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
    LabVIEW Unit 1 - Getting Started
    Learn to Use LabVIEW with MyDAQ

  • How to pass IMAQ session to subVI

    Hi,
    My experience with LabView is neither very good nor extensive. I am a scientist and I am acquiring data with IMAQ.My current problem is that the people who wrote the script in the beginning made it neither versatile, nor modular nor clear structured. So I am trying to reduce the ridiculous numbers of execution controls in a single flowchart to a level that people can actually understand it... and to make the script more versatile for future experiments.
    I am introducing quite a few subVIs to be executed repetitively. However, I can't find out how to pass the IMAQ session on to the subVI. I always get error messages. In this case I want to acquire frames with OIDE_CollectFrame.vi controlled by OIDE_TrialPhaseCollect.vi. I couldn't figure out how to assign the IMAQ session refnum class, either.
    It's probably a newbie question but I usually don't program with LabView.
    Dennis
    P.S. I use LabView 2009
    Solved!
    Go to Solution.
    Attachments:
    OIDE_CollectFrame.vi ‏19 KB
    OIDE_TrialPhaseCollect.vi ‏15 KB

    Hi,
    See the attached example.  It passes the IMAQ session created in the main VI on to the subVI and then passses it again from the SubVI to the main VI.
    Regards,
    Greg H.
    Applications Engineer
    National Instruments
    Attachments:
    Snap.vi ‏14 KB
    Snap_Main.vi ‏38 KB

  • How to Communicate a string between LabView 7.0 and VB using TCP/IP

    HI
    I want to know how to communicate , " by passing a string  "  between LabView 7.1  and VB 6.0  using tcp/ip . Please if anyone couild help me on this..
    Regards
    Ashish Doshi

    Ashish,
    I've got great news for you! LabVIEW has built in TCP functions. They are located in Data Communication>>Protocols>>TCP. From the LabVIEW side, I think you'll find everything you need in there. Good luck!
    Chris C
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect

  • How to pass the data from a input table to RFC data service?

    Hi,
    I am doing a prototype with VC, I'm wondering how VC pass the data from a table view to a backend data service? For example, I have one RFC in the backend system with a tabel type importing parameter, now I want to pass all the data from an input table view to the RFC, I guess it's possible but I don't know how to do it.
    I try to create some events between the input table and data service, but seems there is no a system event can export the whole table to the backend data service.
    Thanks for your answer.

    Thanks for your answer, I tried the solution 2, I create "Submit" button, and ser the mapping scope to  be "All data rows", it only works when I select at least one row, otherwise the data would not be passed.
    Another question is I have serveral imported table parameter, for each table I have one "submit" event, I want these tables to be submitted at the same time, but if I click the submit button in one table toolbar, I can only submit the table data which has a submit button clicked, for other tables, the data is not passed, how can I achieve it?
    Thanks.

  • How to pass credentials/saml token access sharepoint web service ex:lists.asmx when sharepoint has single sign on with claims based authentication

    How to pass credentials/saml token exchange to the sharepoint web service ex:lists.asmx when sharepoint has single sign on with claims based authentication 
    Identity provider here is Oracle identity provider 
    harika kakkireni

    Hi,
    The following materials for your reference:
    Consuming List.asmx on a claims based sharepoint site
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/f965c1ee-4017-4066-ad0f-a4f56cd0e8da/consuming-listasmx-on-a-claims-based-sharepoint-site?forum=sharepointcustomizationprevious
    Sharepoint Claims based authentication and Single Sign on
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/2dfc1fdc-abc0-4fad-a414-302f52c1178b/sharepoint-claims-based-authentication-and-single-sign-on?forum=sharepointadminprevious
    Sharepoint Claim Based Authentication Web Service issuehttp://social.msdn.microsoft.com/Forums/office/en-US/dd4cc581-863c-439f-938f-948809dd18db/sharepoint-claim-based-authentication-web-service-issue?forum=sharepointgeneralprevious
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to pass a list of parameters to a query?

    Hi,
    I use OracleXE 10 Database with JDeveloper 11g.
    In my project I use a Toplink mapping to get access to the database (Toplink Object Map file). This mapping xml file is called crmMap.xml.
    In the crmMap.xml file I define a mapping to a "User table" which has the four columns id (number), title (varchar2), firstName (varchar2) and lastName (varchar2). A title can have the four values Bachelor, Master, Doctor and Professor.
    I do define a query in crmMap.xml which has to find all the users that have a special title. I do give the query one parameter called "title" which has the type "java.util.ArrayList". The parameter "title" is a list that has for example the two values "Bachelor" and "Doctor", if I want to find all the users that are Bachelor or Doctor. The query looks like this ...
    Select * from User where title in(?title)I do use an EJB Session Bean to call the query. The code looks like this ...
    public List<User> findUserByStatus() {
        Session session = getSessionFactory().acquireSession();
        Vector params = new Vector(1);
        List stati = new ArrayList();
        stati.add("Doctor");
        stati.add("Bachelor");
        params.add(stati);
        List<User> result = (List<User>)session.executeQuery("findUserByStatus", User.class, params);
        session.release();
        return result;
    }Doing this I get an error, in the line
    List<User> result = (List<User>)session.executeQuery("findUserByStatus", User.class, params);while the app is trying to execute the query.
    Part of my log
    WARNING: ADFc: Invalid column type
    java.sql.SQLException: Invalid column type
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:116)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:177)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:233)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:407)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7931)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7511)
         at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:8168)
         at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:8149)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:229)
         at oracle.toplink.internal.databaseaccess.DatabasePlatform.setPrimitiveParameterValue(DatabasePlatform.java:1694)
         at oracle.toplink.internal.databaseaccess.DatabasePlatform.setParameterValueInDatabaseCall(DatabasePlatform.java:1684)
         at oracle.toplink.platform.database.oracle.Oracle9Platform.setParameterValueInDatabaseCall(Oracle9Platform.java:339)
         at oracle.toplink.internal.databaseaccess.DatabasePlatform.setParameterValuesInDatabaseCall(DatabasePlatform.java:1669)
         at oracle.toplink.internal.databaseaccess.DatabaseCall.prepareStatement(DatabaseCall.java:649)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:517)
         at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:467)
         at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:447)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:250)
         at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:583)
         at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:467)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:874)
         at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:674)
         at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:835)
         at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:445)
         at oracle.toplink.internal.sessions.AbstractSession.internalExecuteQuery(AbstractSession.java:2260)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1074)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1058)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1032)
         at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:945)
         at de.virtual7.crmTL.model.crmFacadeBean.findUserByStatus(crmFacadeBean.java:720)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:15)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:30)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
         at $Proxy90.findUserByStatus(Unknown Source)
         at de.virtual7.crmTL.model.crmFacade_etlagg_crmFacadeLocalImpl.findUserByStatus(crmFacade_etlagg_crmFacadeLocalImpl.java:838)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:563)
         at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2119)
         at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:2929)
         at oracle.adf.model.bean.DCBeanDataControl.invokeMethod(DCBeanDataControl.java:396)
         at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:258)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1441)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2126)
         at oracle.adf.model.bean.DCBeanDataControl.invokeOperation(DCBeanDataControl.java:414)
         at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:311)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:697)
         at oracle.adf.model.binding.DCInvokeAction.refreshInternal(DCInvokeAction.java:46)
         at oracle.adf.model.binding.DCInvokeAction.refresh(DCInvokeAction.java:32)
         at oracle.adf.model.binding.DCBindingContainer.internalRefreshControl(DCBindingContainer.java:2970)
         at oracle.adf.model.binding.DCBindingContainer.refresh(DCBindingContainer.java:2639)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.prepareModel(PageLifecycleImpl.java:110)
         at oracle.adf.controller.faces.lifecycle.FacesPageLifecycle.prepareModel(FacesPageLifecycle.java:77)
         at oracle.adf.controller.v2.lifecycle.Lifecycle$2.execute(Lifecycle.java:135)
         at oracle.adfinternal.controller.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:190)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.mav$executePhase(ADFPhaseListener.java:19)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$PhaseInvokerImpl.startPageLifecycle(ADFPhaseListener.java:229)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener$1.after(ADFPhaseListener.java:265)
         at oracle.adfinternal.controller.faces.lifecycle.ADFPhaseListener.afterPhase(ADFPhaseListener.java:69)
         at oracle.adfinternal.controller.faces.lifecycle.ADFLifecyclePhaseListener.afterPhase(ADFLifecyclePhaseListener.java:51)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:354)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:181)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:85)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:279)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:239)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:196)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:139)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at oracle.security.jps.wls.JpsWlsFilter$1.run(JpsWlsFilter.java:85)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:257)
         at oracle.security.jps.wls.JpsWlsSubjectResolver.runJaasMode(JpsWlsSubjectResolver.java:250)
         at oracle.security.jps.wls.JpsWlsFilter.doFilter(JpsWlsFilter.java:100)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:65)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    07.09.2009 11:50:16 oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNUNG: ADFc: EJB Exception: : Lokaler Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink - 11g (11.1.1.0.1) (Build 081030)): oracle.toplink.exceptions.DatabaseException
    Interne Exception: java.sql.SQLException: Ungültiger Spaltentyp
    Fehlercode:17004
    Aufruf:Select * from User where title in(?title)
         bind => [[Doctor,Bachelor]]Does anyone know a way how to pass a list of parameters
    Thanks Bodhy

    Hi,
    One alternative way is to create String with , sepearted as pass the string to in clause.For example ,create a string ('Bachelor','Doctor') and pass this string to in clause.
    Session session = getSessionFactory().acquireSession();
    String params=( 'Bachelor','Doctor);
    List<User> result = (List<User>)session.executeQuery("findUserByStatus", User.class, params);
    session.release();
    This is an alternative way and workaround which can work for Strings .
    Or you can use EXpression to build the query to pass the collection as example given below.
    Expression addressExpression;
    ReadObjectQuery query = new ReadObjectQuery(Employee.class);
    ExpressionBuilder emp = query.getExpressionBuilder();
    addressExpression =
    emp.get("address").get("city").equal(
    emp.getParameter("employee").get("address").get("city"));
    query.setName("findByCity");
    query.setSelectionCriteria(addressExpression);
    query.addArgument("employee");
    Vector v = new Vector();
    v.addElement(employee);
    Employee e = (Employee) session.executeQuery(query, v);
    Hope this helps.
    Regards,
    Vinay Kumar

Maybe you are looking for

  • Internal table in badi

    Hello friends, I am working with Badi's and my requirement is i need to fetch the data from database in badi method and have to use that data in my abap program. So, is there any way i can declare internal table as export parameter of badi method or

  • Bluetooth N73 and N78 problem

    Hi, all. I have very special problem with connection N73 and N78 with my BT HF Pioneer radio, there is firmware problem. I dont need the stock answares like "reset your phone" etc. I want to disscous the problem with some real nokia technical support

  • I entered my redemption code for Elements 13 and get : The code you entered is invalid. Please try again.

    I don't know what is going on. I entered the code 3 times and still get the same message.

  • Restoring backed-up iweb

    Hi guys, I need some advice! I recently bought a 1TB firewire drive to back up all my big files to. I used it to make a clean copy of my internal HD using super duper, then installed the OS and wiped my internal HD so I could start afresh. Rather unw

  • Back to mac and broadband issues

    Hi all. I have a problem with back to mac on mountain lion on my MacBook. I am trying to access my iMac. However looking in the control panel for iCloud it is saying that I need to turn on unp? Which I have in my router settings. It is now saying bac