Urgent: Please help. how to solve the time delay during buffer read and write using vc++

I need to continuously acquire data from daqmx card, write into a file and at the same time corelate (in terms of time) the data with signals from other instruments. The current problem is that there is time delay during read and write data into buffer,thus causing misalignment of the data from multiple instruments. Is there a way to solve  the delay? or Is there a way to mark the time of the data acquisition in the buffer?  If I know the starting time (e.g. 0) of data acquisition and sampling rate (e.g. 1kHz), can I simply add 1ms to each data sample in the buffer? The current code is shown below.
void DataCollectionWin::ConnectDAQ()
DAQmxErrChk(DAQmxCreateTask ("", &taskHandle));
    DAQmxErrChk(DAQmxCreateAIVoltageChan(taskHandle,"Dev1/ai0,Dev1/ai1,Dev1/ai2,Dev1/ai3,Dev1/ai4,Dev1/ai5,Dev1/ai16,Dev1/ai17,Dev1/ai18,Dev1/ai19,Dev1/ai20,Dev1/ai21,Dev1/ai6,Dev1/ai7,Dev1/ai22","",DAQmx_Val_Cfg_Default,-10.0,10.0,DAQmx_Val_Volts,NULL));
  DAQmxErrChk(DAQmxCfgSampClkTiming(taskHandle,"",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,60000));
  DAQmxErrChk (DAQmxRegisterEveryNSamplesEvent(taskHandle,DAQmx_Val_Acquired_Into_Buffer,50,0,EveryNCallback,NULL));// Every 50 samples the EveryNSamplesEvent will be trigured, to reduce time delay.
  DAQmxErrChk (DAQmxRegisterDoneEvent(taskHandle,0,DoneCallback,NULL));
  DAQmxErrChk (DAQmxStartTask(taskHandle));
int32 CVICALLBACK EveryNCallback(TaskHandle taskHandle, int32 everyNsamplesEventType, uInt32 nSamples, void *callbackData)
 DAQmxErrChk (DAQmxReadAnalogF64(taskHandle,50,10.0,DAQmx_Val_GroupByScanNumber,data,50*15,&read,NULL));
   //memcpy(l_data,data,6000);
  SetEvent(hEvent);
l_usstatus_e[0]=g_usstatus[0];// signals from other instruments that need to be corelated with the data from daq cards.
 l_optstatus_e[0]=g_optstatus[0];
 if( read>0 ) // write data into file
   //indicator=1;
 for (i=0;i<read;i++)
 {  //fprintf(datafile,"%d\t",i);
  fprintf(datafile,"%c\t",l_usstatus_s[0]);
  fprintf(datafile,"%c\t",l_usstatus_e[0]);
        fprintf(datafile,"%c\t",l_optstatus_s[0]);
  fprintf(datafile,"%c\t",l_optstatus_e[0]);
          fprintf(datafile,"%.2f\t",data[15*i]);
 //   sprintf( pszTemp, "%f", data[6*i]);
 // pListCtrl->SetItemText(0, 2, pszTemp);
    //pWnd->m_trackinglist.SetItemText(0, 2, pszTemp);
     fprintf(datafile,"%.2f\t",data[15*i+1]);
     fprintf(datafile,"%.2f\t",data[15*i+2]);

Hello kgy,
It is a bit of a judgment call. You should just choose the board that you think has the most to do with your issue. For example, this issue was much more focused on setting up your data acquisition task than the Measurement Studio environment/tools, so the MultifunctionDAQ board would have been the best place for it. As for moving your post to another board, I do not believe that is possible.
Regards,
Dan King

Similar Messages

  • Please Help::How to display a Map with LIsts as Keys and Values using JSTL

    Hi,
    I need some assistance on how to display a Map in JSP using struts or core JSTL. I have a HashMap which has a List of keys and each key maps to a value of an ArrayList.i.e I have an ArrayList of taxCodes and each taxCode maps to a value of taxDetails which is an ArrayList of details for for that particular taxCode. I have some trouble to display each taxCode then display taxDetails for each taxCode. Here is my code below:
    OrderDetails.java
    package orderitems;
    import java.sql.*;
    import java.util.*;
    public class OrderDetails {
        private LineOder lineOrder;
        private Map lineItems;
        //returns an item number, key_item, from its unique keys
        public int getItemNumber(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            int itmNum = 0;
             * key_item a unique number for an item.
             * key_year,key_office,key_client,key_company unique keys
             * for each order where this key_item is taken
             * from.
            String select = "SELECT key_item FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + key_item +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                if(rst.next()){
                    itmNum = Integer.parseInt(rst.getString("key_item"));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itmNum;
        //get a list of item number(item codes)
        public List getAllItemNumbers(String key_year,
                String key_office,String key_client,String key_company){
            List itemNumbers = new ArrayList();
            LineItem itemNumber = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            String select = "SELECT key_item FROM "+ Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    itemNumber = new LineItem();
                    itemNumber.setKey_item(Integer.parseInt(rst.getString("key_item")));
                    itemNumbers.add(itemNumber);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemNumbers;
        //get a list of tax codes
        public List getAllTaxCodes(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            ItemTax taxCode;
            List taxCodes = new ArrayList();
            int itemNum = getItemNumber(key_item, key_year,
                    key_office,key_client,key_company);
            String select = "SELECT key_tax_code FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + itemNum +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    taxCode = new ItemTax();
                    taxCode.setKey_tax_code(rst.getString("key_tax_code"));
                    taxCodes.add(taxCode);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return taxCodes;
        /////This methode returns a Map which am trying to display in JSP
        //use tax code to get tax details
        public Map getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
                System.out.println();
                System.out.println("*********CONSOLE OUTPUT*************");//display on console
                Set set = itemTaxDetails.keySet();
                Iterator iter = set.iterator();
                System.out.println("Key\t\tValue\r\n");
                while (iter.hasNext()) {
                    Object taxCode=iter.next();
                    Object details=itemTaxDetails.get(taxCode);
                    System.out.println(taxCode +"\t" + details);
                System.out.println("************************************");
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemTaxDetails;
        //details of an item with all its taxes
        public List getAllItemDetails(String key_year,
                String key_office,String key_client,String key_company){
            List lineItems = new ArrayList();
            List itemNumbers = new ArrayList();
            Map taxDetails = new HashMap();
            LineItem item = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //A list of all item numbers in the declaration
            itemNumbers = getAllItemNumbers(key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator itemIter= itemNumbers.iterator(); itemIter.hasNext();){
                    LineItem itemNum = (LineItem)itemIter.next();
                    int itemNumber = itemNum.getKey_item();
                    String select = "SELECT item_description,item_mass," +
                            "item_cost" +
                            " FROM " + Constants.WEB_TABLE +
                            " WHERE key_year = '"+key_year+"'" +
                            " AND key_office = '"+key_office+ "'"+
                            " AND key_client = '"+key_client+ "'"+
                            " AND key_company = '"+key_company+ "'"+
                            " AND key_item = " + itemNumber;
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        item = new LineItem();
                        item.setItem_description(rst.getString("item_description"));
                        item.setItem_mass(Float.parseFloat(rst.getString("item_mass")));
                        item.setKey_item(Integer.parseInt(rst.getString("item_cost")));
                        //////other details records ommited//////////////////////////
                        /* A HashMap of all itemTaxeCodes as its keys and an
                         * ArrayList of itemTaxedetails as its values
                        taxDetails = getItemTaxDetails(item.getKey_year(),item.getKey_office(),
                                item.getKey_client(),item.getKey_company(),item.getKey_item());
                        //item tax details
                        item.setItmTaxes(taxDetails);
                        //list of items with tax details
                        lineItems.add(item);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineItems;
        public Set getOrders(String key_year,String key_office,
                String key_client,String key_company){
            List lineItems = new ArrayList();
            Set lineOrders = new HashSet();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            LineOder lineOrder = null;
            String select = "SELECT * FROM " + Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    lineOrder = new LineOder();
                    lineOrder.setKey_year(rst.getString("key_year"));
                    lineOrder.setKey_office(rst.getString("key_office"));
                    lineOrder.setKey_client(rst.getString("key_client"));
                    lineOrder.setKey_company(rst.getString("key_company"));
                    ////list of items with all their details
                    lineItems = getAllItemDetails(lineOrder.getKey_year(),lineOrder.getKey_office(),
                            lineOrder.getKey_client(),lineOrder.getKey_company());
                    //setting item details
                    lineOrder.setItems(lineItems);
                    //a list of order with all details
                    lineOrders.add(lineOrder);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineOrders;
    Controller.java
    package orderitems;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Controller extends HttpServlet {
        private Map taxDetails = new HashMap();
        private OrderDetails orderDetails = null;
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String key_year = "2007";
            String key_office = "VZX00";
            String key_company = "DG20";
            String key_client =  "ZI001";
            int key_item = 1;
            String nextView = "/taxdetails_list.jsp";
            orderDetails = new OrderDetails();
            taxDetails = orderDetails.getItemTaxDetails(key_year,key_office,
                    key_company,key_client,key_item);
            //Store the collection objects into HTTP Request
            request.setAttribute("taxDetails", taxDetails);
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher(nextView);
            reqstDisp.forward(request,response);
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>Simple Tax Detail Diaplay ::</title>
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <jsp:useBean id="taxDetails" class="java.util.HashMap" scope="request"/>
            <table>
                <c:forEach items="${taxDetails}" var="hMap">
                    <tr>
                        <td><c:out value="${hMap.key}" /></td>
                        <!--td><%--c:out value="${hMap.value}" /--%></td-->
                    </tr>
                </c:forEach>
            </table>
        </body>
    </html>am displaying taxCodes(in this case i have VAT and ICD) fine but cant figure out how to display a list of value for each taxCode.Here is the output am getting
    both in my JSP and on the console:
    *******************************CONSOLE OUTPUT****************************
    Key          Value
    ICD     [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    VAT [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    Edited by: aiEx on Oct 8, 2007 6:54 AM

    hi evnafets,
    yes i need a nested for loop.I have tried your advice but my bean properties are not found.Am getting this error:
    javax.servlet.ServletException: Unable to find a value for "key_item" in object of class "java.lang.String" using operator "."
    I have tried this as stated earlier in the post:I have tried to make the method getItemTaxDetails return a List and get the returned list value as taxDetails. I then tested to display this list on JSP and its displaying fine.
    public List getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            //return itemTaxDetails;
            return taxDetails;
        }And my JSP
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <table>
                <c:forEach var="curRecord" items="${taxDetails}" varStatus="rowCounter">
                        <c:choose>
                            <c:when test="${rowCounter.count % 2 == 0}">
                                <c:set var="rowStyle" scope="page" value="odd" />
                            </c:when>
                            <c:otherwise>
                                <c:set var="rowStyle" scope="page" value="even" />
                            </c:otherwise>
                        </c:choose>
                        <tr class="${rowStyle}">
                            <td>${curRecord.key_item}</td>
                            <td>${curRecord.tax_value}</td>
                            <td>${curRecord.tax_limit_val}</td>
                        </tr>
                    </c:forEach>
            </table>
        </body>
    </html>I can't see where am going wrong even with your advice.Please help.
    Thnx.

  • Hi, when ever I'm using 3G, on my Iphone4 sim stops working and Network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem.

    Hi, when ever I'm using 3G, on my Iphone4 sim stops working and network is lost, this started after I updated my phone with  6.0.1(10A523)version. Please help how to solve this problem. Thanks.

    Photos/videos in the Camera Roll are not synced. Photos/videos in the Camera Roll are not touched with the iTunes sync process. Photos/videos in the Camera Roll can be imported by your computer which is not handled by iTunes. Most importing software includes an option to delete the photos/videos from the Camera Roll after the import process is complete. If is my understanding that some Windows import software supports importing photos from the Camera Roll, but not videos. Regardless, the import software should not delete the photos/videos from the Camera Roll unless you set the app to do so.
    Photos/videos in the Camera Roll are included with your iPhone's backup. If you synced your iPhone with iTunes before the videos on the Camera Roll went missing and you haven't synced your iPhone with iTunes since they went missing, you can try restoring the iPhone with iTunes from the iPhone's backup. Don't sync the iPhone with iTunes again and decline the prompt to update the iPhone's backup after selecting Restore.

  • HT1918 I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    You made a purchase and exhausted the credit on your card before it processed. All purchases are final. Contact iTunes Store support. You need to settle up before you can purchase or download anything else.

  • I have the following Imac and Iphoto 11 in Finder folder I upgrade the iphoto file  and  all the latest event files, can you help how to solve the problem? Thank you  Model Name iMac    Model Identifier:     iMa

    I have the following Imac and Iphoto 11 in Finder folder I upgrade the iphoto file  and I lost all the latest event files, can you help how to solve the problem? Thank you
    Model Name:     iMac
    Model Identifier:     iMac8,1   Processor Name:     Intel Core 2 Duo
    Processor Speed:     2.4 GHz

    http://support.apple.com/kb/HT2638?viewlocale=en_US&locale=en_US

  • Hi guys urgent please help me ASAP my ipod touch 4g reboots/restarts over and over again and i cant enter DFU mode cause my home button is stuck/broken please help guys i cant enter itunes too cause it said it needs my passcode

    hi guys urgent please help me ASAP my ipod touch 4g reboots/restarts over and over again and i cant enter DFU mode cause my home button is stuck/broken please help guys i cant enter itunes too cause it said it needs my passcode the problem is i cant even enter my passcode in my ipod touch cause its rebooting over and over again help please guys

    - See if this program will place it in recovery mode since that erases the iPod and bypasses the passocode.
    RecBoot: Easy Way to Put iPhone into Recovery Mode
    - Next try letting the battery fully drain. The try again.

  • How to remove the time slider from my project and keep only buttons

    How to remove the time slider from my project and keep only buttons to interact with my project .

    If I understand you correctly, go to the skin editor (Project, Skin Editor in Captivate 4), select the Playback Control tab, uncheck the Progressbar check box.  Leave checked the buttons for play/pause, rewind, forward, back, etc.
    I hope this helps.
    Mister C.

  • How to get the query result of improvement (Before and After ) using sql de

    how to get the query result of improvement (Before and After ) using sql developer.

    Check
    http://www.oracle.com/technetwork/articles/sql/exploring-sql-developer-1637307.html

  • Please help me to solve the problem ---it's urgent

    hi everybody
    my application is deployed on the weblogic 9.0. I am using the VB DLL through which i am sending the request to the servlet.
    When i am pressing the "Color" button in VBDLL to retrieve the color information, server takes the long time nearly 10-12 minutes to return back the color information but it throws the following error
    <Error> <WebLogicServer> <BEA-000337> <[STUCK] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' has been busy for "621" seconds working on the request "Http Request: /sales/appFindSize.jsp", which is more than the configured time (StuckThreadMaxTime) of "600" seconds. Stack trace:
    java.lang.Object.wait(Native Method)
    java.lang.Object.wait(Object.java:474)
    javelin.client.JobWaiter.blockUntilFinished(JobWaiter.java:45)
    javelin.client.ClientUtilsImpl.build(ClientUtilsImpl.java:838)
    weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java:244)
    weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:200)
    weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:224)
    weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:383)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:298)
    weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022)
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1925)
    weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1848)
    weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288)
    weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    please help me to solve this error it is urgent.
    Thanks in advance
    Pandurang S. Pokharkar

    Exchange rates can be entered as a direct or indirect quotation. You can maintain two prefixes that
    can be used to differentiate between direct and indirect quotations exchange rates during input and
    display. If you don´t set up a prefix, the standard setting is valid:
    &#159; “” (blank, without a prefix) for direct quotation exchange rates
    &#159; “/” for indirect quotation exchange rates
    n Scenario 1: If you use mainly direct quotation exchange rates and indirect quotation occurs seldom,
    use the default configuration. In this way you can enter direct quotation exchange rates without a
    prefix.
    n Scenario 2: If, in addition to direct quotation exchange rates, the handling of indirect quotation is
    required, you should define a prefix that is not “blank” for both quotation types, e.g.:
    &#159; “*” for direct quotation exchange rates, “/” for indirect quotation exchange rates
    &#159; If you follow this suggestion, the configuration does not allow exchange rates to be entered
    without a prefix, an error message occurs. Thus users are forced to consider which the correct
    quotation is and enter the rate with a valid prefix.
    n Scenario 3: If indirect quotation is the major notation at your company, you can configure the
    settings this way:
    &#159; “*” for direct quotation exchange rates, “ ” (blank) for indirect quotation exchange rates
    &#159; This configuration allows indirect quotation exchange rates to be entered without a prefix whereas
    the less used direct quotation exchange rates have to be entered with a prefix.

  • Please help me to solve the issue in my query.

    Hi All,
    Please help me to understand the mistake what i did in below query and help to resolve that.
    Actually i am trying to create a query to filter the records from db based on my input parameter.
       If my input parameter is 1(@showallrecords) then i need to show all the records which has the IsLatest as 1
       If my input parameter is 0(@showallrecords) then i need to show all the records which has the IsLatest as 0
    select * from tabel1 INNER JOIN tabel2    
    ON tabel1.KeyId = tabel2.KeyId 
    and (@showallrecords = 1 and tabel1.IsLatest = 1 )
    and (@showallrecords = 0 and tabel1.IsLatest = 0 )
    when i am executing the above query with the parameter @showallrecords = 1 ,db is returning 0 rows.If i am executing the above query after removed the last line and (@showallrecords = 0 and tabel1.IsLatest = 0 ) then records are coming.
    i understand that 1=0(last line) and the condition is not true.So its affecting the result.
    Please help me to solve this.

    select * from tabel1 INNER JOIN tabel2
    ON tabel1.KeyId = tabel2.KeyId
    WHERE (tabel1.IsLatest = @showallrecords Or @showallrecords=0)

  • Need help to read and write using UTF-16LE

    Hello,
    I am in need of yr help.
    In my application i am using UTF-16LE to export and import the data when i am doing immediate.
    And sometimes i need to do the import in an scheduled formate..i.e the export and imort will happend in the specified time.
    But in my application when i am doing scheduled import, they used the URL class to build the URL for that file and copy the data to one temp file to do the event later.
    The importing file is in UTF-16LE formate and i need to write the code for that encoding formate.
    The problem is when i am doing scheduled import i need to copy the data of the file into one temp place and they doing the import.
    When copying the data from one file to the temp i cant use the UTF-16LE encoding into the URL .And if i get the path from the URl and creating the reader and writer its giving the FileNotFound exception.
    Here is the excisting code,
    protected void copyFile(String rootURL, String fileName) {
    URL url = null;
    try {
    url = new URL(rootURL);
    } catch(java.net.MalformedURLException ex) {
    if(url != null) {
    BufferedWriter out = null;
    BufferedReader in = null;
    try {
    out = new BufferedWriter(new FileWriter(fileName));
    in = new BufferedReader(new InputStreamReader(url.openStream()));
    String line;
    do {
    line = in.readLine();
    if(line != null) {
    out.write(line, 0, line.length());
    out.newLine();
    } while(line != null);
    in.close();
    out.close();
    } catch(Exception ex) {
    Here String rootURL is the real file name from where i have to get the data and its UTF-16LE formate.And String fileName is the tem filename and it logical one.
    I think i tried to describe the problem.
    Plz anyone help me.
    Thanks in advance.

    Hello,
    thanks for yr reply...
    I did the as per yr words using StreamWriter but the problem is i need a temp file name to create writer to write into that.
    but its an logical one and its not in real so if i create Streamwriten in that its through FileNotFound exception.
    The only problem is the existing code build using URL and i can change all the lines and its very difficult because its vast amount of data.
    Is anyother way to solve this issue?
    Once again thanks..

  • Using the Borland Database Engine to read AND write SHARED Paradox Database Tables

    I need to read and write Paradox database tables with a C# AT THE SAME TIME AS people using the Paradox tables with legacy Paradox programs interactively.
    I think the only way to do that reliably without corrupting the tables is to use the BDE Borland Database Engine.
    Does anyone know how to do that? I found this c++ program... But I don't know how to integrate this into c#
    http://www.codeproject.com/KB/database/bdedatabase.aspx
    Is there another way to do this? Again, most important, I don't want to corrupt the paradox database.
    I can read the paradox records all day long, that is no problem, it is updating at the same time as the legacy program users..
    I also know that the whole thing needs to be updated, but that can not be done overnight.
    Thanks in advance
    Dave

    Being pretty new to programming, I am trying just to read info from Paradox tables with C#. Info is actively being updated from another program at the same time. The program I am trying to write only needs to read data. The other program does use the BDE,
    so it is already present running on the computer.
    I've been looking at code but just haven't found quite the right combination.
    Thanks. Any help is greatly appreciated.

  • Can you improve the speed of my CSV Reader and Writer?

    hi all, i'm trying to develop a CSV Writer and Reader. i have done a good work to implement the special character and quoting it, it's also support multi line value but it's incredibly slow.
    can someone help to make it faster?
    here it's how to use the writer
    char *stringhe_sorgenti[10] = {0};
    out = OpenFile(nfile, VAL_WRITE_ONLY, VAL_TRUNCATE, VAL_ASCII);
    for(i = 0; i < sizeof(stringhe_sorgenti)/sizeof(char*); i++){
    stringhe_sorgenti[i] = (char*)calloc(200, sizeof(char));
    sprintf(stringhe_sorgenti[0], "example1");
    sprintf(stringhe_sorgenti[1], "example2");
    scrivi_riga_csv(out, stringhe_sorgenti, sizeof(stringhe_sorgenti)/sizeof(char*), formato);
    for(i = 0; i < sizeof(stringhe_sorgenti)/sizeof(char*); i++){
    free(stringhe_sorgenti[i]);
    CloseFile(out);
    here is the writer 
    void scrivi_riga_csv(int file_handle, char *stringa_sorgente[], int numero_stringhe, int formato)
    char delimitatore[2][2] = {{',', '\0'}, {';', '\0'}};
    char stringa_destinazione[1024] = {0};
    int index_destinazione = {0};
    int index_start = {0};
    int index_fine = {0};
    int errore = {0};
    int i = {0};
    //int k = {0};
    size_t lunghezza_stringa = {0};
    for(i = 0; i < numero_stringhe; i++){
    if(i != 0){
    stringa_destinazione[index_destinazione++] = delimitatore[formato][0];
    index_start = 0;
    lunghezza_stringa = strlen(stringa_sorgente[i]);
    // se la stringa sorgente
    if( (FindPattern(stringa_sorgente[i], 0, lunghezza_stringa, delimitatore[formato], 0, 0) != -1) // contiene delimitatore
    || (FindPattern(stringa_sorgente[i], 0, lunghezza_stringa, "\"", 0, 0) != -1) // contiene parentesi
    || (FindPattern(stringa_sorgente[i], 0, lunghezza_stringa, "\n", 0, 0) != -1) // contiene a capo
    // apro parentesi all'inizio
    stringa_destinazione[index_destinazione++] = '"';
    // metodo find pattern, piu' complesso ma piu' performante
    do{ index_fine = FindPattern(stringa_sorgente[i], index_start, lunghezza_stringa - index_start, "\"", 0, 0);
    if(index_fine != -1){
    index_fine++;
    // copio dall'inizio fino alle virgolette
    CopyString (stringa_destinazione, index_destinazione, stringa_sorgente[i], index_start, index_fine - index_start);
    index_destinazione += index_fine - index_start;
    // ne aggiungo una dopo
    stringa_destinazione[index_destinazione++] = '"';
    // aggiorno la posizione di start e riparto con il while
    index_start = index_fine;
    }while(index_fine != -1);
    CopyString (stringa_destinazione, index_destinazione, stringa_sorgente[i], index_start, lunghezza_stringa - index_start);
    index_destinazione += strlen(stringa_sorgente[i]) - index_start;
    // alla fine della riga chiudo la parentesi
    stringa_destinazione[index_destinazione++] = '"';
    else{
    // altrimenti la copio semplicemente e shifto l'indice della stringa di destinazione
    CopyString (stringa_destinazione, index_destinazione, stringa_sorgente[i], 0, lunghezza_stringa);
    index_destinazione += strlen(stringa_sorgente[i]);
    memset(stringa_sorgente[i], 0, strlen(stringa_sorgente[i]));
    errore = WriteLine (file_handle, stringa_destinazione, strlen(stringa_destinazione));
    if(errore == -1){
    errore = GetFmtIOError();
    MessagePopup("WriteLine -> WriteLine", GetFmtIOErrorString(errore));
    return;
     here how to read the file
    char *stringhe_sorgenti[10] = {0};
    for(i = 0; i < sizeof(stringhe_sorgenti)/sizeof(char*); i++){
    stringhe_sorgenti[i] = (char*)calloc(200, sizeof(char));
    out = OpenFile(nomearchivio, VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_BINARY);
    leggi_riga_csv(out, stringhe_sorgenti, sizeof(stringhe_sorgenti)/sizeof(char*), formato);
    strcpy(intestazione.data, stringhe_sorgenti[1]);
    for(i = 0; i < sizeof(stringhe_sorgenti)/sizeof(char*); i++){
    free(stringhe_sorgenti[i]);
    CloseFile(out);
     and here the reader
    void leggi_riga_csv(int file_handle, char *stringa_destinazione[], int numero_stringhe, int formato)
    char delimitatore[2][2] = {{',', '\0'},
    {';', '\0'}};
    char stringa_sorgente[1024] = {0};
    int stringa_in_corso = {0};
    int index_inizio_valore = {0};
    int index_doublequote = {0};
    int offset_stringa_destinazione = {0};
    size_t lunghezza_stringa = {0};
    int inquote = {0};
    int errore = {0};
    int i = {0};
    for(i = 0; i < numero_stringhe; i++){
    lunghezza_stringa = strlen(stringa_destinazione[i]);
    memset(stringa_destinazione[i], 0, lunghezza_stringa);
    do{ memset(&stringa_sorgente, 0, sizeof(stringa_sorgente));
    errore = ReadLine(file_handle, stringa_sorgente, sizeof(stringa_sorgente) - 1);
    // If ReadLine reads no bytes because it has already reached the end of the file, it returns –2.
    // If an I/O error occurs, possibly because of a bad file handle, ReadLine returns –1.
    // You can use GetFmtIOError to get more information about the type of error that occurred.
    // A value of 0 indicates that ReadLine read an empty line.
    if(errore == -1){
    errore = GetFmtIOError();
    MessagePopup("leggi_riga_csv -> ReadLine", GetFmtIOErrorString(errore));
    return;
    else if(errore == -2){
    errore = GetFmtIOError();
    MessagePopup("leggi_riga_csv -> ReadLine", "already reached the end of the file");
    return;
    else{
    lunghezza_stringa = errore;
    index_inizio_valore = 0;
    // metodo find pattern, piu' complesso ma piu' performante
    for(i = 0; i <= lunghezza_stringa; i++){
    // se come primo carattere ho una " allora e' una stringa speciale
    if(inquote == 0){
    if(stringa_sorgente[i] == '\"'){
    inquote = 1;
    index_inizio_valore = ++i;
    else{
    // altrimenti cerco il delimitatore senza il ciclo for
    i = FindPattern(stringa_sorgente, i, lunghezza_stringa - index_inizio_valore, delimitatore[formato], 0, 0);
    if(i == -1){
    // se non lo trovo ho finito la riga
    i = lunghezza_stringa;
    if(stringa_sorgente[i - 1] == '\r'){
    i--;
    if(stringa_in_corso < numero_stringhe){
    CopyString (stringa_destinazione[stringa_in_corso], 0, stringa_sorgente, index_inizio_valore, i - index_inizio_valore);
    offset_stringa_destinazione = 0;
    stringa_in_corso++;
    if(stringa_sorgente[i] == '\r'){
    i++;
    index_inizio_valore = i + 1;
    if(inquote == 1){
    // se sono nelle parentesi cerco le virgolette
    i = 1 + FindPattern(stringa_sorgente, i, lunghezza_stringa - index_inizio_valore, "\"", 0, 0);
    if(i == 0){
    if(stringa_sorgente[lunghezza_stringa - 1] == '\r'){
    lunghezza_stringa--;
    // se non le trovo ho finito la riga, esco dal ciclo for
    break;
    // se incontro una doppia parentesi salto avanti
    else if(stringa_sorgente[i] == '\"'){
    continue;
    // !!!! fondamentale non cambiare l'ordine di questi else if !!!!!
    // se incontro una parentesi seguita dal delimitatore
    // o se incontro una parentesi seguita dal terminatore
    // \r = CR = 0x0D = 13
    // \n = LF = 0x0A = 10
    // a capo = CR + LF
    else if( (stringa_sorgente[i] == delimitatore[formato][0])
    || (stringa_sorgente[i] == '\r')
    || (stringa_sorgente[i] == '\0')
    // salvo il valore
    inquote = 0;
    if(stringa_in_corso < numero_stringhe){
    CopyString (stringa_destinazione[stringa_in_corso], offset_stringa_destinazione, stringa_sorgente, index_inizio_valore, i - 1 - index_inizio_valore);
    offset_stringa_destinazione = 0;
    stringa_in_corso++;
    if(stringa_sorgente[i] == '\r'){
    i++;
    index_inizio_valore = i;
    // se sono andato a capo scrivo fino a dove sono e poi procedo con la nuova riga
    if(inquote){
    if(stringa_in_corso < numero_stringhe){
    CopyString (stringa_destinazione[stringa_in_corso], offset_stringa_destinazione, stringa_sorgente, index_inizio_valore, lunghezza_stringa - index_inizio_valore);
    strcat(stringa_destinazione[stringa_in_corso], "\n");
    offset_stringa_destinazione += lunghezza_stringa - index_inizio_valore;
    offset_stringa_destinazione++;
    }while(inquote == 1);
    // elimino le doppie parentesi
    for(i = 0; i < numero_stringhe; i++){
    index_doublequote = 0;
    do{ lunghezza_stringa = strlen(stringa_destinazione[i]);
    index_doublequote = FindPattern(stringa_destinazione[i], index_doublequote, lunghezza_stringa - index_doublequote, "\"\"", 0, 0); // contiene doppia parentesi
    if(index_doublequote != -1){
    index_doublequote++;
    memmove (stringa_destinazione[i] + index_doublequote, stringa_destinazione[i] + index_doublequote + 1, lunghezza_stringa - index_doublequote);
    }while(index_doublequote != -1);
    return;

    the format is CSV, i try to explain better what i'm doing.
    our client asked to save acquisition data with header description in an excel readable format, i've decided to use .CSV and not .TDM because it's a simple txt file and we never used .TMD but i will propose to use it.
    after some research on the internet i've found nothing to handle .CSV in CVI except from this csv_parse but i've found it difficult to be maintained so i've write it by my own hand.
    i've written two example of how to use my function to read or write and i've copyed my function used to read and write.
    in the write function i check with FindPattern if the string to be write contain some special character, if i find this i have to quote the string to respect the standard RFC4180 and if i find a quote i have to double it. aftere i've done this check i write the line in the file.
    in the read function, that is more complicated, i:
    check if the first character is a quote.
    if it's not i copy the string until the delimitier or until the end of the line.
    if it is i have a string with special character inside so:
    i find the first quote in the string. when i've found i check if it's follwed by another quote. this means that in the starting message i was writing a single quote.
    if it's not followed by another quote but it's followed by a delimiter or a carriage return i've finished the special line.
    if i don't find it it means that the special quote have a carriage return inside and i have to check the next line. before checking the next line i save this in my string.
    after this loop i check in every string if i have a double quote and i delete one.
    the main problem is in the speed of this, i'm acquiring data at 1000 S/s with 8 active channel for 60 second so i have 480000 data to be stored, divided in 60.000 row and 8 column. to read a file like that my pc stay "locked" for 15 second or more.
    i've tried to use the arraytofile function and it's extremly fast and i can also put header because the function can start from the last position in the file but the filetoarray function start from the beginning and i cannot read the header correctly. also if i'm using the european CSV with semicolon as delimiter with arraytofile i cannot select the semicolon but only the coma

  • Is there a way to use the FF vi's to read and write complex data types; specifically, clusters?

    I'm trying to interface with a Fieldbus device through LabVIEW.  I need to be able to read and write a variable that consists of a cluster of two unsigned int 32's.  The FF vi's provided with FF Communications Manager 3.2 do not support clusters.  I have tried to use a code interface node to write my own, but the CIN's I was using before to do this function do not give me a device list anymore (they were originally written on Communications Manager 2.3.5).  I have recompiled the .lsb, as well as trying to use the older versions of the header and library files.  Is there another workaround I can use?

    Hello Bryan,
    The BrowseDeviceList VI was released within NI-FBUS 3.2. For NI-FBUS Configurator 3.1, please unzip the attached file and copy the "addon" and "Ff" folders into "\vi.lib" directory. LabVIEW 7.1 or above version is required for using these addons.
    And for your information, there is a free upgrade (version 3.1.1) for NI-FBUS Configurator 3.1 users. Here is the link to the upgrade kit.
    http://digital.ni.com/softlib.nsf/websearch/00A1614EC291219586256F390020671B?opendocument&node=132070_US
    Hope it helps!
    Regards,
    --Josiane
    Attachments:
    locate_fflv_in_labview82.jpg ‏214 KB
    vi.lib.zip ‏391 KB
    locate_fflv_in_labview71.jpg ‏193 KB

  • Cannot download an app from the app store on ipad2, the installing processes all pause with the "waiting....." sign under the app logo.  Anyone please help how to solve this.

    I cannot download any app from the AppStore on my ipad2 v5.1
    The installing processes always stop with the sign "waiting......." and didn't show any progress at all
    Anyone ,please help me solve the problem, thanks

    The ipad question was someone else's.  I have no problem with any other device (laptop, Nook, PS3, Android daughter's phone) at home or work.  Just my iphone.  I tried posting my question a few times and it has yet to show up.  At least this made it online!  I was almost ready to purchase an Ipad3, but this is starting to make a Galaxy Tab look pretty good!
    This problem seems way too common to be a fluke!  My search results yielded- http://search.yahoo.com/search;_ylt=A0oG7hsbdq1PzQMA1N5XNyoA?p=IOS%205%20apps%20 waiting&fr2=sb-top&fr=chr-hp-psg&type=HPNTDF&type_param=HPNTDF
    I performed a sync last night too!

Maybe you are looking for