DAQmx with C JNI Java

Hello

I'm a newbie with a big problem:

I need to write some functions DAQmx ANSI C (e.g. DAQmxCreateTask or DAQmxStopTask) in Java using JNI 'Java Native Interface'.

My problem is the TaskHandler.

How the TaskHandler in Java?

For example: I write two native functions of 'Java_DAQmxCreateTask' and 'Java_DAQmxStopTask' Java OK - but to stop the task I need to know the TaskHandler in Java.

Is it possible to convert the TaskHandler into a joint or a data jdouble or jlong type and use the return value of my "Java_DAQmxCreateTask" function for the parameter in the function "Java_DAQmxStopTask (taskhandler)"? Or is there a way to create a TaskHandler in Java?

Java code example:

taskHandler = Java_DAQmxCreateTask (...)

...

Java_DAQmxStopTask (taskHandler)

Thank you very much for your support

and best regards

Hi again,

I fixed it by myself.

I converted to the (long) TaskHandler.

concerning

Tags: NI Software

Similar Questions

  • Is it possible to use the 32-bit firefox with the plugin java 64 bit?

    Is it possible to use the 32-bit firefox with the plugin java 64 bit?
    I would use 32-bit firefox and I already install the plugin java 64 bit.
    Is this a good choice is not to install the 32-bit java plugin?
    These will cause problems?

    Thanks in advance.
    Kind regards
    Sean

    Nope - you need the 32-bit Java to go with the 32-bit Firefox, if you want that Java run

  • Can we use JNI (Java Native Interface) approach in the Blackberry applications?

    Hello

    Someone help me find if we use the JNI (Java Native Interface) approach in applications Blackberry JDE version 4, 5?

    of course, use logic and rewrite in java. the actual coding usually takes only a small amount of development time, if you have a proper design.

  • Pages with errors of Java Heap

    We run CF 8,0,0,176276 on a 32-bit Windows 2003 server with IIS 6 and Java Runtime version 6 (it's really version 1.06).
    We started getting the java heap error messages two weeks ago. Now, we also receive the "GC overhead limit exceeded" error, which deals with the Java garbage collection. I tried to change the JVM from 1 GB to 2 GB heap size, but the CF would not start upward. I have since discovered that 32-bit Windows servers cannot use 2 GB for Java.
    An article in java, I found said to disable Java cleaning using the - XX:-UseGCOverheadLimit ( http://forums.java.net/jive/message.jspa?messageID=228596). It seems that turn off garbage collection would be the opposite of what I'm trying to do. Are there any ideas on this?
    Are there patches for CF8? and where are they located?
    Scott

    Scott, the error is a symptom, not the cause of your problems. Turning off this option will not "solve" the problem, it's that you are short of memory. More information about this option in a moment.

    Let's talk about first your comment to try to change the 1 to 2 GB max memory. Since you're under Windows (32 bit), as you say, you cannot use more than 2g per process (this isn't really a limit of Java, but rather a Windows).

    But you have found, you cannot assign CF 2 g because the JAVA virtual machine does not start. Again, this is not a question of specific CF. You can see the discussions on the same issue with plain old Java apps, to the http://forums.java.net/jive/message.jspa?messageID=228596.

    So, similar to what they say, the consensus seems to be that you can set it to a between1.3 place and 1.7 GB, before of the JAVA virtual machine does not start. You have to try different values for yourself.

    Now, that extra few hundred meg can be all that you need to get past your problem, but in reality that's often just to prevent the inevitable. You will need to find why CF uses as much memory. You say you use CF8 but do not say if the company or Standard. If the former, then you have the CF8 server monitor (available in the CF Admin and discussed in a several part series that I wrote for the center of Dev Adobe, such as discussed at http://carehart.org/blog/client/index.cfm/2008/7/30/45page_server_monitor_guide). That, as well as tools such as FusionReactor and SeeFusion, can help you to better see how FC uses memory.

    All three offer a GUI to show how the memory usage is likely. You can see if it grows constantly throughout the day, or develops in spikes. People tend to say "I have a memory leak", when in fact, it may just be that they either a few requests that use too much memory (so you will see stairs Ford increase in the use of simultaneous memory with their performance), or it is possible that they are stick stuff in shared scopes (session (, application or server) and those who live well beyond the life of each request.

    The CF8 server monitor has even a follow-up feature memory, but it must be used with caution. If you enable it, you can see that it brings to your server to its knees. I'll do a blog entry soon on how to use it more effectively (something I've learned since the drafting of the articles of the last year).

    One thing the monitor can tell you, without that none of the buttons "start" at the top of the screen, it's how many sessions you have. This can be very informative. You can have thousands of them and not realizing it, because of robots, spiders and other requests for shit. See the page "active sessions" of the monitor server and its graphic icon in particular (discussed more in detail in one of my articles).

    Unfortunately, neither FusionReactor nor SeeFusion can tell you how many sessions are running, so if you're on CF8 Standard (or if others reading of 6 or 7, where they can use EN or SF), you can't easily see how many sessions there is. (Ago undocumented, no supported methods, as discussed at http://rewindlife.com/2003/09/08/undocumented-application-scope-functions/. ) Just be aware that some techniques work differently depending on whether J2EE sessions are enabled in CF admin th.)

    Finally, about your option usegcoverheadlimit observation and recommendation to turn it off: does not the article you point to do so would disable GC. I'm curious to know how you have concluded that. But digging into things, I see that turning off (using the - entry) will be disable a feature (introduced in 6) which limits the share of the virtual time machine happened to the GC before an OutOfMemory error is thrown. This is the error you see, that the JAVA virtual machine has detected much too much time is spent by the GC.

    To disable the option is not "Disable Java cleaning." It changes just so an OOM error will be thrown even before being really out of memory, simply because a lot too much time is spent in GC.

    And even then, how does this option (if enabled, what does default) change depending on if you use a parallel or concurrent collector (as discussed in two places in http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html, if you are looking for this switch).

    Hope some of this aid.

  • I have the latest version of Java and the addin card is not there. I have a mac. I'm not running on 32-bit. I had so many problems with this new java updat

    I have updated java 7 up to 45 (by mistake, this version of java does not work with vpn and according to apple, I can't revert to the previous version). The applet plugin does not appear in my Add ons. I'm not running 32-bit. I have read and tried every article I can find. I uninstalled and reinstalled still no luck. I have an iMac, just put update to maverick.

    See if anything here is useful:

  • Since the recent upgrade, I don't see any of my projects in Shutterfly. Their customer support says that it may be the problem with the application Java and Adobe Flash Player

    See above - there known problems with these applications?

    Your player (if any) Java is not indicated clearly in your list of plugins, and your FlashDrive is several versions behind. If Apple has a site update, you can check that first. Mozilla site is here: http://www.mozilla.org/plugincheck/

  • How is it that Pogo games load fine with an older version of Java (the ones they say I should disable) but does not load with the latest Java?

    Pogo works fine on older versions of Java, but the games not load not on the latest version. I did all the usual things, cleared the cache of the browser and Java cache, uninstalled Java then reinstalled it, done in so that was allowed, blah, blah, blah... I did have problems with the latest version of Firefox.

    Yes, this version is is more updated and can contain security risks, then it will be probably best to disable java plugins in firefox > addons > plugins when you do not use the on game sites in order to stay safe on other sites. This is why I have also suggested to contact the pogo site to update their content so that it can be reused with the java plugin updated.

  • Data acquisition tool NOR-DAQmx with Matlab R2012a

    Hello

    I'm trying to control NI USB-6211 of Matlab 2012 using NOR-DAQmx Data Acquisition tool:

    http://zone.NI.com/DevZone/CDA/tut/p/ID/3005

    I'm working on win7 64 bit. And I see the device AND Measurement & Automation Explorer.

    The tool does not work: DAQ_Demo_Browser do nothing. And I got the error "unexpected or unbalanced parenthesis or support" of AcqNUpdates_nonUI.m

    What is the problem?

    Thank you and best regards,

    Arthur Shulkin

    Hi Arthur,.

    Tools OR DAQmx for Acquisition of data with the Software Inc. MATLAB® from The Mathworks, supports up to the 2008 version of the MATLAB® software.  In order to use our products DAQ Multifunction with MATLAB® software, you could get back to 2008 or earlier, or instead use the Data Acquisition Toolbox provided by The Mathworks, Inc.

    Another option would be to import your ".m" files in a node MathScript in LabVIEW and use the functions of NOR-DAQmx everything in the LabVIEW development environment.  For more information on the Module LabVIEW MathScript, you can consult the information available on this link:

    Inside of the LabVIEW MathScript RT Module

    MATLAB® is a registered trademark of The MathWorks, Inc.

    Katie

  • Synch series AO DAQmx with DIO

    There are not many examples DAQmx for AO series.

    Can someone give me an example of how do I synchronize using outputs analog DAQmx on the digital master with exit/entry table on a Board of the slave?

    I have an AO Series PCI-6723 (Dev1) and a DIO PCIe-6535 b the (Dev4) connected via a RTSI bus.  I've defined the RTSI, using MAX cable and added the two devices.

    Have had no success and cannot find a suitable example.

    I'm on a Windows 7 computer that runs Labview 2012.

    Thank you

    Gretchen

    I found a solution!  It is complex, but it seems to work.

    I used DAQmx export signals VI & DAQmx connect terminals VI.

    See attached VI.

    Gretchen

  • DAQmx: With relaxing break pulse blocking

    I have a NI 9401 module in a chassis 9171 and stand at the door of the output of a counter with the release of another counter. 1 meter (the signal to be blocked) generates a 3 Mhz signal and meter from 0 (the door) generates a 10 Hz signal that is sent outside to door pin of 1 meter. I expect this would be counter 1 door signal to produce the 3 Mhz flashes only when the counter 0 is high, but the wiring had no effect on the output of the 1 meter, it has always generated a continuous pulse train of 3 Mhz.  I found that a code is necessary to get a counter to pay attention to the signal to his door pin (this message was particularly useful) and it can be done with the node property relaxing break. After you have configured the node, however, I fell into this error:

    Error-20124 occurred at DAQmx start Task.vi:2
    Lines 4 to 7 of this port are configured for the entry. Cannot configure these lines for output at this time.

    I'm quite puzzled by the present.  The problem seems to come try it designate 5 PFI ('CTR 1 door' on the 9401) as the source of relaxing break.  If anything, I think the error would be that lines 4-7 are configured for output, since these lines are grouped under CTR 1, which is configured as a channel of CO to generate the 3 Mhz pulse train, and the definition of line 5 as the break source changes the configuration on an entry.  Looking for this error in the forums OR and Google isn't pulling up of troubleshooting information.  I tried to create a task to configure line 5 as a separate digital input channel, but then I get the error saying (error-200125) opposite that lines 4-7 are configured for output and cannot be configured at the entrance, to make things more confusing.

    Any thoughts would be appreciated.  I'm afraid I'm missing something obvious about blocking the impulses or CO channel configuration as I continue to read that one of the benefits of DAQmx on Legacy DAQ, is that it makes easier routing signal.  I'm using LabVIEW 2012 (32 bit) with DAQmx 9.5.5 installed.

    Hi agoncalves,

    I took a glance at your VI and I see two immediate problems:

    1. it is not guaranteed that the two tasks will be reserve before the start of each one.  This explains your error and why it seems confusing.  The 9401 is configurable nibble, but you cannot change the direction while the device is being used (why the reserves are important).  The module starts with two nibbles the input value.  Your first task causes an exit so it switches direction on one of them.  When your task is committed (started), it hangs in this configuration.  The second task then also try an output drive, but on the other nibble that is entered and can not be activated because the first task is currently running.  The solution is to use the thread of the error to force the order of execution (or use a flat sequence structure).

    2. you won't run out of problems with your trigger signal unless that connected you to a separate entrance (and put the two trains of pulses on the nibble even).  You can change that by setting the property of canal CO. Pulse.Term. that's if you want to spend your signal through a few circuits external and back in.  If you use the signal directly, you can just use it internally.  By example/cDAQ1Mod1/ctr0InternalOutput

  • DAQmx task Read DAQmx with sampling frequency of 10 Hz produced much too much data

    I have a simple configuration with a strain of channel 4 OR-9237 amp holds a carrier of series C of WLS - 9163 (wired ethernet mode) - Details probably does not matter.

    I used MAX to create a DAQmx task associated with which all four gauges samples.  The calendar setting is "Scan Loads" is continuous sampling, 2 k buffer (read samples) and 10 Hz rate.  I guess that this task would generate 40 data values per second - 10 for each channel.

    I have a simple loop of reading using DAQmx Read.vi that works always (without any stimulation time).  Playback is set to read all available data and then pump it into a table.
    In the attached example, I also added a few words of debugging to stop the loop after N iterations.

    As the loop is programmed with a 0.2 second period, I expect each pass of the loop to read about 8 samples or 2 samples per sensor.  Instead, I get hundreds each passage.  It's like reading has substituted the sampling frequency specified in the task of the unit.  I absolutely need data to be material to the rhythm.

    Where have I lost?

    Thanks Adnan,

    I changed your example I selected 'Strain gage' entry analog and then lowered the minimum and maximum thresholds to +-1-2.  What happens is that each other in the loop, I 2048 samples or zero samples.  The display flashes a whole line and then it clears any other past.

    In response to your second post, I understand that the loop cannot run quite right that I select.  I think that, but at a sampling frequency of 10 Hz, I have to sleep on the software side for nearly a minute before I built 2 K samples.

    I played with the frequency of sampling, assigning to various values from 0.1 to 10000Hz.  The behavior is the same until I approach the high rates where available samples remains to 2048-4096 sometimes, the display becomes continuous.

    Ahhh, Darn.  Yet another search was this link that points to the root of my confusion.  The 9237 can taste arbitrary rates using its internal clock.  Duoh!  I wish that the pilots are smart enough to warn you if there is a discrepancy between the selected sampling rate and capabilities of the device

  • leak memory using daqmx with c#

    Hello

    I m of the problems using the c# to DAQmx API. I have attached a sample program to demonstrate the way in which I use the API.

    The problem I m facing is that the application needs memory more and more over time. My hypothesis is that leaking memory has occurred somewhere I tried different ways to call the API and read the documentation on methods, but I still didn t manage to get around this problem.

    Any help is the aprechiated!

    PS: A brief description of my program:

    -Create tasks (DI, HAVE, AO)

    -Add channels (DI, DO, HAVE,)

    -StartTasks

    -Start the Thread and cyclical read/write of the current values to/from local variables

    Hi niwaly,

    I recommend that you test the examples. This way you can be sure that the issue is not the driver itself, and you can debug your application. It can also give you a clue on how to proceed.

    If you have any examples in the file that I mentioned, you have not installed the driver with c# additional support during the installation procedure.

    Here are some examples:

    http://www.NI.com/white-paper/6999/en

    Kind regards

    Heinz

  • Is anyone else having problems with execution of Java based applications on Windows 7 RC?

    tried to play Pogo, said that Java is not installed, so I installed Java and restarted the browser, still no action.

    Hi ImpalaManiac,

    Thanks for posting on community forum ' Getting Ready for Windows 7»

    Are you able to play Pogo games with no Add-ons in IE?  Click on start ORB / all PROGRAMS / System Tools / Internet Explorer - no add-on.    Are you able to play Pogo games then?  Are you able to load Java then and that made Java allow the game to play.

    If the steps above helped you, one of the Add-ons that was ongoing is damaged.  You want to add components back one at a time and try to play the POGO game between each add rear Add-ons until the corrupt addon is identified.

    To do this in IE click Tools / Manage Add-ons / you should find on the left side of the window of 4 or 5 categories of modules.  Click on each category and section of the middle right click window an addon at a time, and then select enable you should be able to do this when right-clicking on the add-on status field.

    Please let us know if this helps you to solve this problem, or if assistance is needed.

    Kind regards

    Debbie
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • NOR-DAQmx with Windows7

    What is the oldest version of measurement and Automation Explorer that can be used with Windows7 32 bit?  My USB-6009 is considered by the windows Device Manager, but it will not identify MAX 8.6.  Do I need a later version?

    In this post, Adnan (CLA) says you must use DAQmx 9.0.2.  Have you tried this, or just the most recent version?

  • Foglight v558 - Script fails with ScriptAbortException: script1001968: java.util.ConcurrentModificationException

    I have changed most of our rules through several Wssf and use a number of rule-level Variables. I got these variables through groovy scripts.

    Recently, I had to change a variable that appears in all the rules.

    This is the script that I have written so far:

    com.quest.nitro.service.sl.interfaces.rule import. *;

    def ruleInfo = "";
    def ruleSvc = server.get ("RuleService");
    def ruleList = ["DBSS - ADH Service status"];
    def varExp = "INST_NAME;
    def varText = "scope.parent_node.mon_instance_name";

    allRules = ruleSvc.getAllRules ();

    for (rule allRules) {}
    ruleName def = rule.getName ();
    def ruleCart = rule.getCartridgeName ();

    If (ruleList.contains (ruleName))
    If (ruleCart.equals ("DB_SQL_Server_UI")) {}
    def ExpressionSet = rule.getExpressions ();
    for (expression in ExpressionSet) {}
    If (expression.getName () .equals ("INST_NAME")) {}
    ExpressionSet.remove (expression);
    ruleInfo += "Removed variable $varExp of $ruleName \n";
    }

    }
    Add a new term
    ExpressionSet.add (rule.createExpression ("INST_NAME", varText));

    rule.setExpressions (ExpressionSet);
    ruleSvc.saveRule (rule);
    ruleInfo += "added $varExp variable $ruleName \n";
    }
    }

    Return ruleInfo;

    The part of the script that adds the variable work consistantly.  The part of the script removes it expresion of level rule fails most of the time with the following error:

    com.quest.nitro.service.sl.interfaces.scripting.ScriptAbortException: script1001968: java.util.ConcurrentModificationException

    I'm still fairly new to groovy and java script, but I gather that when I have to iterate over a collection that is changed in another thread, the iterator survey a java.util.ConcurrentModificationException.  I read that I should look somehow collection synchronization.  Before we go down this rabbit hole, I thought I would just ask here, how should I write this code then it work consistantly?

    This is due to brakes on an object. You can try to break your code into pieces. First of all try and get all the rules in a list that matches your criteria. Call it a refinedRuleList, and then iterate through this refinedRuleList for Expressions and remove them. This gives a try!

    Thank you

    #AJ Aslam

Maybe you are looking for