DAQmxReadCounterF64() timeouts blocking program runtime

Hi,
I have a PCI-7342 board connected to a MID-7652 box that is being used to control a servo motor on a rotary axis with an encoder. I also have a PCIe-6323 board that is used to read a quadrature linear encoder on the counter using DAQmx and I am programming in C. As the axis rotates, it passes breakpoints and sends a trigger signal in order for the counter to latch a reading from the quadrature encoder.
The DAQmx is set up using the following functions:
     DAQmxCreateTask(, &thHandle);
     DAQmxCreateCILinEncoderChan(thHandle, "Dev1/ctr0", , , , , , , , , );
     DAQmxCfgSampClkTiming(thHandle, "/Dev1/PFI0", , , , );
     DAQmxStartTask(thHandle);
This sets up the counter to be latched every time a signal arrives at the PFI0 terminal. I have connected the breakpoint output from the MID-7652 box to PFI0.
The rotary axis is configured with modulo breakpoints using the following functions:
     flex_configure_breakpoint(, , NIMC_MODULO_BREAKPOINT, NIMC_RESET_BREAKPOINT, );
     flex_load_bp_modulus(, , 250, );
     flex_load_pos_bp(, , 0, );
     flex_enable_breakpoint(, , NIMC_TRUE);
Due to modulo breakpoints, I have to call flex_enable_breakpoint(, , NIMC_TRUE); every time a breakpoint occurs in order for the next breakpoint to be able to trigger.
The problem I have lies in the next stage. I want to call the read function which will wait for incoming trigger on PFI0. So I call the function:
     DAQmxReadCounterF64(thHandle, -1, dTimeOut, , , , );
Next in my code I start the motion of the rotary axis
     flex_start(, , );
     do
          flex_read_axis_status_rtn(, , &usAxisStatus);
          usBPStatus = !((usAxisStatus & NIMC_POS_BREAKPOINT_BIT)==0);
          if (usBPStatus)
               flex_enable_breakpoint(, , NIMC_TRUE);
     } while ( !(usAxisStatus & (NIMC_MOVE_COMPLETE_BIT | NIMC_AXIS_OFF_BIT )));
But this line is never reached because the DAQmxReadCounterF64() function keeps waiting for an input at the PFI0 terminal and blocks the program from running and times out, returning an error.
I have tried rearranging the order of the functions by calling flex_start(); first and then DAQmxReadCounterF64() before the do-while loop.
The problem with this method is that the DAQmxReadCounterF64() function blocks the runtime and so the second breakpoint is never enabled. The function again times out and returns an error.
I don't want to set it to indefinite or my program will wait forever and not do anything. Is there a way around the DAQmxReadCounterF64() timeout? Or a way to re-enable the breakpoints?

Duplicate
John Passiak

Similar Messages

  • Gracefully terminating a blocked program that uses getRuntime().exec()

    I am executing a command line program using Runtime.getRuntime().exec()
    I am using two separate threads to read the standard and error output streams.
    I am using process.waitFor() to wait for the streams to be fully read.
    Some command line programs block when being read so I have a timer that calls process.destroy() after a timeout period, which seems to be working.
    I tried a few other techniques, such as closing the streams when the timout was up, but this did not work.
    Using destroy() feels like a heavy handed approach and I am wondering if this is the best way to terminate a program in this situation?
    Thanks

    Yes, we have no control over the external app (other than what the CLI provides).
    I am wondering how others are handling this and want to confirm that destroy() is the correct technique in this scenario.
    Thanks

  • How to set "Maximum Lenght" column property for database block at RUNTIME?

    Hi folks,
    Is it possible to somehow set a "Maximum Length" property for database block column at runtime?
    I have a dynamic form, which maintains mostly "STATIC DATA" within all application which are stored in different static data tables (which have similar structure). But now, description column in some of those tables was extended (not in all at this stage). I would like to avoid truncating form error while reading data from those extended tables, so I would like to set an MAXIMUM SIZE to accurate value at the time when I'm specifying TABLE NAME for that database block.
    What property should I use to set it?
       -- before executing query in "MAIN_BLOCK" I always set QUERY_DATA_SOURCE_NAME to user defined value => STATIC DATA TABLE name
       Set_block_Property('MAIN_BLOCK',QUERY_DATA_SOURCE_NAME,:control.table_name);
       Set_block_Property('MAIN_BLOCK',DML_DATA_TARGET_NAME,:control.table_name);
       -- here I would like to set also MAXIMUM LENGHT for particular column (based on some condition, etc.. correct value I can get from ALL_TAB_COLS dictionary
       SET_ITEM_PROPERTY('MAIN_BLOCK.DESCRIPTION', <<XXXXXXX>>, 300);What should I use instead of "<<XXXXXXX>>" if I want to overwrite MAIN_BLOCK.DESCRIPTION column's maximum length to 300?
    Thanks,
    Tomas

    Hi Magoo, thanks for reply.
    Yes, but then user can get other errors while trying to set description with value longer than in database (for all not extended tables).
    Aby idea how to implement SET_CUSTOM_PROPERTY like mentioned here?
    Oracle Forms - "maximum length" property.
    Thanks,
    Tomas

  • Java programming - Runtime class

    hi
    I am not able to copy a file using Runtime class in java.lang
    i have used
    Runtime rt = Runtime.getRuntime();
    Process pr = rt.exec("copy c:/venk1/pmrpay.jar F:/");
    pr.waitFor();
    when running the program i am getting this error message:
    create process: copy c:/venk1/pmrpay.jar F:/ error = 2
    kindly help me
    venkat

    There is no copy.exe on your system. Copy is command interpreted with command.com. So you need to try something like
    Process pr = rt.exec("cmd /c copy c:/venk1/pmrpay.jar F:/");
    See
    cmd /?
    for details... Hope this will help you!

  • Does Firefox have a spam blocking program

    I am getting murdered with spam. I see technology programs that block spam, but I dont trust them. Does Firefox have a spam blocker that I can use or buy? Thanks.

    Are you talking about in Firefox, or your e-mail?
    Go here and register for protection for your e-mail and phones;
    '''[https://www.donotcall.gov/ The National Do Not Call Registry]'''
    '''[https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/ Adblock Plus]''' {web link}
    Blocks annoying video ads on YouTube, Facebook ads, banners
    and much more. Adblock Plus blocks all annoying ads, and
    supports websites by not blocking unobtrusive ads by default (configurable).
    '''[https://addons.mozilla.org/en-US/firefox/addon/adblock-plus-pop-up-addon/ Adblock Plus Pop-up Addon]''' {web link}
    Adblock Plus Pop-up Addon extends the blocking functionality of
    Adblock Plus to those annoying pop-up windows that open on mouse
    clicks and other user actions.
    Forum; '''[https://adblockplus.org/forum/ Adblock Plus Homepage]''' {web link}

  • I need to unlock a blocked program that I did not mean to block. Shutterfly is the site I blocked that shares family photo's. I need to unlock.....

    I need to unlock the block I did not mean to do.....

    How is it blocked. Is it not letting you access that site or is it the photos that are not loading?
    If it is the photos not loading, with Shutterfly on display, click on the site identity button (for details on what that is see the [[site identity button]] article) and then on More Information. This will open up the page info dialog.
    First select the Permissions panel, make sure that "Load Images" is set to allow (selecting Use Default should also work)
    Next select the Media panel, then click on the first item in the list. Use the down arrow key to scroll through the list. If any item has the option "Block images from (domain name)" selected, de-select the option.
    This should hopefully resolve your issue, but also see [[Images or animations do not show]].
    Some add-ons can also block images, for example if you have AdBlock Plus installed, make sure that you have not accidentally created a filter to block the images.
    If you can not access the site at all, do you get any error message, if so what is the error message?

  • C program: Runtime error from GetStaticMethodId()

    I am new to Java and need help with .....
    I want to call a java method (native) from legacy C code.
    The java code has to return a Hashtable to the C code.
    My java works and I wrote another java file to call it. That
    also works fine and I can display my new Hashtable in
    the calling java code.
    However in my calling C code I get a runtime error when
    executing mid2 = GetStaticMethodId() // mid2 returns 0
    I believe the problem is in the method signature. If I
    make it an int method, it runs and returns an int
    but I want a hashtable to be returned.
    Using javah RMHash, produces RMHashData.h with nothing useful in it.
    My environment is: NT, jdk1.3, VIsual Studio cl.
    I hope someone can help me.
    Sample java code: This runs OK stand alone or called
    from another piece of java code.
    import java.util.Hashtable;
    import java.io.*;
    import java.util.*;
    public class RMHashData
    public RMHashData()
    public static Object getMasterData()
    Hashtable hash = new Hashtable(20);
    int rtnInt = 6;
    hash.put ("1050", new String("AAAAAA"));
    hash.put ("1051", new String("BBBBB"));
    hash.put ("1052", new String("CCCCCCCCC"));
    return hash;
    public static void main(String[] args)
    int RtnInt;
    Hashtable RtnHash;
    RtnHash = (Hashtable)RMHashData.getMasterData();
    Sample C code: (I had to retype this so cut out superfluous code)
    #include <stdio.h>
    #include <jni.h>
    main()
    JNIEnv *env;
    JavaVM *jvm;
    JavaVMOption options[4];
    JavaVMInitArgs vm_args;
    jint res;
    jclass cls;
    jmethodID mid, mid2;
    jstring jstr;
    jvalue result;
    jobjectArray args;
    char classPath[256];
    char libraryPath[256];
    vm_args.version = JNI_VERSION_1_2;
    /* set the options to pass to the VM */
    sprintf(classPath, "%s", "-Djava.class.path=c:\\data\\java_dev\\src");
    sprintf(libraryPath, "%s", "-Djava.library.path=c:\\jdk131\\lib");
    options[0].optionString = classPath;
    options[1].optionString = libraryPath;
    vm_args.options = options;
    vm_args.nOptions = 2;
    vm_args.ignoreUnrecognized = JNI_FALSE;
    /* Create the Java VM */
    res = JNI_CreateJavaVM(&jvm, (void **) &env, &vm_args);
    cls = (*env)->FindClass(env, "RMHashData");
    // *** Getting the main method works
    mid = (*env)->GetStaticMethodID(env, cls, "main", "([Ljava/lang/String;)V");
    // *** Getting this method FAILS
    mid2 = (*env)->GetStaticMethodID(env, cls, "getMasterData", "()[Ljava/lang/Object;");
    if (mid2 == 0) // ***** mid2 is 0
    fprintf(stderr, "Can't find Prog.getMasterData\n");
    return 1;
    result.l = (*env)->CallStaticObjectMethod (env,cls, mid, args);
    // Then comes more fun to pull apart the hashtable...

    Bill, Thank you very much - that was it!!!!!
    Not sure about your comment...
    Comment: Why don't you just return a Hashtable?The line: return hash;
    in getMasterData() does exactly that.
    If you mean my declaration of the method:
    public static Object getMasterData()
    where Object should be Hashtable.
    I thought the type in the declaration had to match the
    JNI call - CallStaticObjectMethod(). I notice there is no
    CallStaticHashtableMethod(). Well that is my guess and I only started looking at Java a few days ago and have lots to learn. Thank you again.
    Ron...

  • Installing program runtime error

    I am trying to install updated driver for HP printer photo smart c7200 series. I get a runtime error. I have downloaded the driver several times and it gets the same error every time. When I try to activate the printer and fax app it says it can't find
    the printer but gives no setup function. HELP  

    That's your DISCover Drop & Play System Executable.
    What make and model of PC do you have? (It often comes preinstalled on PCs, anddifferent PC manufacturers may be running slightly different versions of the DISCover engine. Want to check at your manufacturer's webdite to see if there are any updates available for your variation.)

  • BT Net protect blocking program

    Hi
    I have BT net protect plus Mcafee and i am having issues with a program installed
    I have given it full access in Mcafee,and even opened the port in both TCP/IP and UDP but i am still getting a connection error
    any clues?

    Hi Fatboyhurst,
    What program are you having problems with?
    Thanks
    PaddyB
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • NSPOSIXerrordomain1 - Internet blocking program help.

    My friend put Bsecure on his computer for his little brother. However, he forgot the password and couldn't get rid of it. So we tried deleting the App, the startup daemon and all the preference files we could find. But that caused a bigger problem. All web traffic is blocked and gives a NSPOSIXerrordomain:1 . What files are blocking the internet? There is no process running so we don't know what to do.
    It's a MacBook Pro 13" running SL.

    You didn't uninstall the whole thing. A kernel extension is still loaded. The product should have come with an uninstaller; if not, you'll have to ask the developer for instructions. Trying to find the files yourself probably won't work, as you've already discovered.

  • RMI program runtime error

    hi
    iam trying to Design an RMI service emulating subset of Retailer Service of Supply Chain Management (SCM) architecture as described below:
    The service will have single function of getting the catalog listing of available products at retailer. the method signature will be CatalogItem[] getCatlaog(String Product)
    could someone help me in knowing the possible error in code ,iam getting the following error.i did bind server to rmi registry and when i try to run client ,this error occurs.
    RetailerClient exception: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: RetailerImpl_Stub (no security manager
    : RMI class loader disabled)
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: RetailerImpl_Stub (no security manager
    : RMI class loader disabled)
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at RetailerClient.main(RetailerClient.java:21)
    Caused by: java.lang.ClassNotFoundException: RetailerImpl_Stub (no security mana
    ger: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.jav
    a:200)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:151
    3)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
    626)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    ... 3 more
    thanks
    g1

    Looks like client is trying to use some classes that the server does not have. So the server RMIClassLoader is trying to load it from the client. But you did not use any security manager in your application and RMIClassLoader doesn't like it. Call System.setSecurityManager(someManager) at the beginning at your application.
    I got around without setting secutity manager like this:
    In my application I have a URL classloader (from a HTTP server) at both the client and the server. So all classes client uses are available to server as well (but not the other way). Client is not allowed to define new classes other than the ones on the HTTP server.
    hi
    iam trying to Design an RMI service emulating
    ing subset of Retailer Service of Supply Chain
    Management (SCM) architecture as described below:
    The service will have single function of getting the
    catalog listing of available products at retailer. the
    method signature will be CatalogItem[]
    getCatlaog(String Product)
    could someone help me in knowing the possible error in
    code ,iam getting the following error.i did bind
    server to rmi registry and when i try to run client
    ,this error occurs.
    RetailerClient exception: error unmarshalling return;
    nested exception is:
    java.lang.ClassNotFoundException:
    eption: RetailerImpl_Stub (no security manager
    : RMI class loader disabled)
    java.rmi.UnmarshalException: error unmarshalling
    return; nested exception is:
    java.lang.ClassNotFoundException:
    eption: RetailerImpl_Stub (no security manager
    : RMI class loader disabled)
    at
    at
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown
    n Source)
    at java.rmi.Naming.lookup(Naming.java:84)
    at
    at RetailerClient.main(RetailerClient.java:21)
    Caused by: java.lang.ClassNotFoundException:
    RetailerImpl_Stub (no security mana
    ger: RMI class loader disabled)
    at
    at
    at
    t
    sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.ja
    a:371)
    at
    at
    at
    t
    sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.ja
    a:165)
    at
    at
    at
    t
    java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoad
    r.java:631)
    at
    at
    at
    t
    java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader
    java:257)
    at
    at
    at
    t
    sun.rmi.server.MarshalInputStream.resolveClass(MarshalI
    putStream.jav
    a:200)
    at
    at
    at
    t
    java.io.ObjectInputStream.readNonProxyDesc(ObjectInputS
    ream.java:151
    3)
    at
    at
    at
    t
    java.io.ObjectInputStream.readClassDesc(ObjectInputStre
    m.java:1435)
    at
    at
    at
    t
    java.io.ObjectInputStream.readOrdinaryObject(ObjectInpu
    Stream.java:1
    626)
    at
    at
    at
    t
    java.io.ObjectInputStream.readObject0(ObjectInputStream
    java:1274)
    at
    at
    at
    t
    java.io.ObjectInputStream.readObject(ObjectInputStream.
    ava:324)
    ... 3 more
    thanks
    g1

  • Program runtime information

    Is there a way to (from inside the own class) know amount of memory and cpu usage the class is consuming ?
    thanks

    In Java, as far as I know , No.
    But, in transact SQL Server 2000, yes there are.

  • Problem with the last payment of CC. What should I do to activate the payment and not to block programs?

    What I have to do to pay from my account now?
    Thanks!

    This is an open forum, not Adobe support... you need Adobe support to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • Modulo breakpoint automatic re-enabling

    Hi,
    I have a PCI-7342 board connected to a MID-7652 box that is being used to control a servo motor on a rotary axis with an encoder. I also have a PCIe-6323 board that is used to read a quadrature linear encoder on the counter using DAQmx and I am programming in C. As the axis rotates, it passes breakpoints and sends a trigger signal in order for the counter to latch a reading from the quadrature encoder.
    The DAQmx is set up using the following functions:
         DAQmxCreateTask(, &thHandle);
         DAQmxCreateCILinEncoderChan(thHandle, "Dev1/ctr0", , , , , , , , , );
         DAQmxCfgSampClkTiming(thHandle, "/Dev1/PFI0", , , , );
         DAQmxStartTask(thHandle);
    This sets up the counter to be latched every time a signal arrives at the PFI0 terminal. I have connected the breakpoint output from the MID-7652 box to PFI0.
    The rotary axis is configured with modulo breakpoints using the following functions:
         flex_configure_breakpoint(, , NIMC_MODULO_BREAKPOINT, NIMC_RESET_BREAKPOINT, );
         flex_load_bp_modulus(, , 250, );
         flex_load_pos_bp(, , 0, );
         flex_enable_breakpoint(, , NIMC_TRUE);
    Due to modulo breakpoints, I have to call flex_enable_breakpoint(, , NIMC_TRUE); every time a breakpoint occurs in order for the next breakpoint to be able to trigger.
    The problem I have lies in the next stage. I want to call the read function which will wait for incoming trigger on PFI0. So I call the function:
         DAQmxReadCounterF64(thHandle, -1, dTimeOut, , , , );
    Next in my code I start the motion of the rotary axis
         flex_start(, , );
         do
              flex_read_axis_status_rtn(, , &usAxisStatus);
              usBPStatus = !((usAxisStatus & NIMC_POS_BREAKPOINT_BIT)==0);
              if (usBPStatus)
                   flex_enable_breakpoint(, , NIMC_TRUE);
    } while ( !(usAxisStatus & (NIMC_MOVE_COMPLETE_BIT | NIMC_AXIS_OFF_BIT )));
    But this line is never reached because the DAQmxReadCounterF64() function keeps waiting for an input at the PFI0 terminal and blocks the program from running and times out, returning an error.
    I have tried rearranging the order of the functions by calling flex_start(); first and then DAQmxReadCounterF64() before the do-while loop.
    The problem with this method is that the DAQmxReadCounterF64() function blocks the runtime and so the second breakpoint is never enabled. The function again times out and returns an error.
    I have already asked about a way around the DAQmxReadCounterF64() timeout in the other message boards. Is there a way around the re-enabling of the breakpoints? Can it be done automatically or internally on the PCI-7342?

    Hi,
    Please keep this question to 1 thread
    Original thread: http://forums.ni.com/t5/Multifunction-DAQ/DAQmxReadCounterF64-timeouts-blocking-program-runtime/td-p...

  • How can I block a particular program and not the whole channel?

    I want to block a particular program. When I am trying to that, it blocks whole channel. How can I do that?
    Second Q is: can I have two parental control pins to block programs?

    Then there is no point to use it for me. Some channels require parental control for some programs, so this option should be available.Someone can argue that then "why don't you lock whole channel and unlock whenever you want to use it." I want to avoid locking-unlocking by locking specific programs.
    Comcast has this option of locking specific program as well locking channel!

Maybe you are looking for