Digital line input from a Jennic zigbee kit to data acquisition BNC 2432

I am working on a project involving data acquisiton of data from a Jennic zigbee microcontroller . I am getting burst of data form a line of the kit which tells about the temperature and light signal. How do i give as an input to labview. I tried with the normal data acquisiton it always shows a hight and i dont see any transition. When i try t sample  in different frequency i am not able to do it. i get an error.. How do i get the data out in the form of 8 bit codes so i can represent in the corresponding temp-erature./ light intensity///

Hi saty,
Thank you for posting to the NI forums.  Which data acquisition (DAQ) device are you using – or are you using serial communications?  The 2432 is not (at least currently) made by NI, but Tektronix has a product with that model number – is this what you’re using?  Also, what is the error that you are receiving?
If you are using a DAQ device, are you using the Traditional DAQ drivers or DAQmx.  There are numerous examples for each in the LabVIEW Example Finder.  Browse to Hardware Input and Output and then select your driver.  There will be digital I/O examples for both driver versions.
Please post back, and with more information, I can give you some better recommendations for the architecture of your program. 
Ed W.
Applications Engineer
National Instruments

Similar Messages

  • Can anyone help me keep wifi off on my S5?  Since the last update my wifi keeps turning on without input from me.  I have unlimited data and don't use the wifi much to extend the battery but this is killing it now.

    Can anyone help me keep wifi off on my S5?  Since the last update my wifi keeps turning on without input from me.  I have unlimited data and don't use the wifi much to extend the battery but this is killing it now.

    Help is here to resolve this issue with your wifi connection 88DaveS. Lets try disabling your "Smart Network Switch". Select Settings> Wifi. The 'smart network switch' is in the advanced settings. Locate the Menu icon in the upper right hand corner > Tap Menu > Tap Advanced > Locate and ensure the check box is Unchecked next to Smart network switch. Let us know if this helps.
    KinquanaH_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the �Correct Answer� button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • Audigy 2 ZS: Keeping line input from playing on speak

    I recently installed an Audigy 2 ZS in a Win2k machine. In the mixer, I've selected "Analog mix" for recording. So "What-U-Hear" should be off, right? And I have disabled "Monitor during recording." So, while recording, I don't hear what is coming in the line input. But if I turn recording off, suddenly what's coming into Line-In blasts out the speakers. Is there a way to permanently disable passing Line-Input to the speakers when I'm not recording or even running a recording program?
    Bob

    The mixer device list for the Audigy 2 ZS shows a separate Line-in for record and play. So it appears that the ability to keep Line-In from playing on speakers is there. However, unfortunately the Creative Mixer implements this as a record option and an option to "Do not monitor while recording." With this option checked, Line-In isn't passed through to the speakers but only during recording. At other times you'll hear what is coming into the Line-in. By comparison, the Audigy 2 LS has an option to "Do not monitor," which blocks Line-in pass-through under all conditions (unless an api enables it). The Line-In pass-through was a particular problem for me for a C++ program I've written. So I solved the problem by selecting "Do not monitor while recording," muting the global volume, and un-muting the global volume with a call to the mixer functions when I turn on recording from within my program. This prevents pass-through even when my program isn't running, which was important for my particular application. Unfortunately, this isn't a viable option for someone using an off-the-shelf recorder-player. Other mixers might implement this differently.
    BigZed wrote:
    Sorry to bump this but...
    I happen to have a very similar proble to Katman's
    W2k machine, recording from the line input, i got
    either no sound to record (if line input is not
    checked in the mixer - both windows' or creative's)
    or i got sound to record AND this sound also
    goes to the line out (when i check the line input
    in the mixer), which defies my purposes.
    Line in was always selected as input in the recording
    panel.
    I tried to uncheck the "record without monitoring"
    option but it does absolutely nothing to me.
    I have updated the drivers just a few weeks ago.
    Hints?

  • Optical Audio Line In from HDTV and Digital Noise

    I have been trying to connect my HDTV to my PowerPC G5. The only audio output on the TV is a Optical Line Out which requires a standard TOSlink connector. This is my first time trying to connect to this connection on my Mac. I am using the LineIn utility to pass the volume through, but the audio is clipping (shows audio as maxed out on line in indicator) and producing a horrible sound - probably best described as a digital pulsing static. As far as I can tell, I cannot hear any of sound that should be coming out of the TV.
    There is the red light coming out from the cable indicating that the connection is set on the other end... Is there a setting or a conversion that needs to be done in order to get the sound to work? Do I have a bad Line In on my Mac?
    I tried unplugging and replugging both sides... could it be dust?
    I'm coming up empty on all the searches and discussion pages - thanks for any help!!!

    The [Audio Spec's for the Late 2007|http://developer.apple.com/documentation/Hardware/Conceptual/HWTechAudio/Articles/Audio_implementation.html#//apple_ref/doc/uid/TP40003978-SW281200331167] iMac:
    *Line Input*
    Jack type: 3.5 mm (1/8”) stereo
    _Maximum input voltage: 3 VRMS (+11.8 dBu)_ ☜
    _Minimum voltage input for full scale output: 63 mVRMS (-21.5 dBu) at input gain = +30 dB_ ☜
    Input impedance: > 20 kΩ
    Frequency response: 20 Hz to 20 kHz, +0.5 dB/-3 dB
    Signal-to-noise ratio (SNR): > 90 dB
    Total harmonic distortion + noise (THD+N): < -85 dB (0.006%)
    Channel separation: > 85 dB
    The [Denon DNX500 DJ Mixer|http://www.americanmusical.com/Item--i-DEN-DNX500--P-On] Output Spec's:
    *Output Level and Impedance*
    Balanced: 4 dBm (1.23 V) 600 Ohms
    Unbalanced: 0 dBV (1.0V) 1 kOhms
    Booth (Balanced): 4 dBm (1.23 V) 600 Ohms load
    Rec (RCA): -10 dBV (316 mV) 1 kOhms
    Effect (Send): -14 dBV (200 mV) 1 kOhms
    Subwoofer/Lighting: 2 dBm (975 mV) 600 Ohms
    _Headphone: 0 dBV (1.0 V) 32 Ohms_ ☜
    I'm not the audio expert here, but it should work using the mixers headphone output is (1.0 V) to the iMac's (Minimum 63 mVRMS/ Maximum 3 VRMS) Line In port!

  • Digital audio input via mini jack/toslink from ADA, monitored via USB audio output... is this do-able? I know digital audio input should be okay but how do I monitor it, apart from using the internal speakers?

    Digital audio input via mini jack/toslink from ADA converter, monitored via USB audio output to amplifier... is this do-able? I know digital audio input should be okay but how do I monitor it, apart from using the internal speakers?

    You can output audio thru HDMI, with appropriate adapter.
    You can use additional cheap external usb audio for monitoring.

  • Comparing input from command line to a String token problem

    Hi,
    I want to compare my input from the command line to a token.
    my command line looks like "java myProgram george bush president washington"
    The next command could be "java myProgram geoge president washington"
    Basically I have a text file which has a name, job and location field. The text file looks as follows
    jim, farmer, chicago
    paul, builder, texas,
    george bush, president, washington
    I am using string tokenizer with a "," as my field delimiter.
    My lecturer wants me to take the input from the command line so applets are out of the question. However even though there are 3 fields, args.length() could equal 4 because "george bush" is only the name but george is args[0] and bush is args[1]. Is there a way to have a delimiter on the command line instead of a space such a ",". Can anyone see any other way around this?
    Thanks

    1982. The year of.....wait for it.....
    Jack And Diane
    Tainted Love
    Key Largo
    Open Arms
    Do You Believe In Love
    Gloria
    Working For the Weekend and of course the GREATEST song of 1982...
    drum roll please......
    Heat Of The Moment.

  • Problem with tokenized  input from command line

    I am trying to take an input from the command line, parse it to tokens and perform whatever operation is needed depending on the name of the token, on a binary tree of stacks for example, if i type 1 2 1 3 printLevelOrder, then the root of the tree should have 3, 2,1 in the stack, the left child should have 1 and the right child should be empty. and then a level order print of the tree should be performed.
    however what is happening when i run this code is the numbers are being put into the right stacks of the tree, but any commands such as printLevelOrder or PrintPopRoot are entering the code that is for placing numbers onto the stack instead of executing that command and skipping past this piece of code.
    so my question is, why is the if statement if (word =="printLevelOrder") not being executed when thats whats in the word ?
    example input and output shown below code fragment.
              try {
                  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                 String line = "";
                 while (line != "***") {
                      System.out.print("> prompt ");
                      line = in.readLine();
                      StringTokenizer tokenizer = new StringTokenizer(line," ");
                      String word = new String();
                      while (tokenizer.hasMoreTokens()) {
                             word = tokenizer.nextToken();
                             boolean notCommand = true;
                             if (word =="printLevelOrder") {
                                  theTree.printLevelOrder();
                                  System.out.println("(word ==printLevelOrder)");
                                  notCommand=false;
                             if (word == "printPopLevelOrder") {
                                  theTree.printPopLevelOrder();
                                  notCommand=false;
                             if (word == "printPopInorder") {
                                  theTree.printPopInorder();
                                  notCommand=false;
                             if (word == "printPopPreorder") {
                                  theTree.printPopPreorder();
                                  notCommand=false;
                             if (word == "printPopRoot") {
                                  theTree.printPopRoot();
                                  notCommand=false;
                             if (word == "***") {
                                  notCommand=false;
                             if (notCommand == true) {
                                  System.out.println("(notCommand == true)");
                                  boolean notPlaced = true;
                                  int v = 1;
                                  while ((notPlaced==true) && (v < theTree.size())) {
                                       if (theTree.element(v).isEmpty()) {
                                            theTree.element(v).push(Integer.valueOf(word));
                                            System.out.println("Inserting"+word);
                                            System.out.println("in empty stack at location: "+v);
                                            notPlaced=false;
                                       if (notPlaced==true) {
                                            if (  Integer.valueOf(word) >= Integer.valueOf( theTree.element(v).top().toString() )  ) {
                                                 theTree.element(v).push(Integer.valueOf(word));
                                                 System.out.println("Inserting"+word);
                                                 System.out.println("in stack at location: "+v);
                                                 notPlaced=false;
                                       v++;
              }valid inputs: int value, printLevelOrder, printPopLevelOrder, printPopInorder, p
    rintPopPreorder, printPopRoot, *** to quit
    prompt 1 3 2 4 2 printLevelOrder(notCommand == true)
    Inserting1
    in empty stack at location: 1
    (notCommand == true)
    Inserting3
    in stack at location: 1
    (notCommand == true)
    Inserting2
    in empty stack at location: 2
    (notCommand == true)
    Inserting4
    in stack at location: 1
    (notCommand == true)
    Inserting2
    in stack at location: 2
    (notCommand == true)
    Exception in thread "main" java.lang.NumberFormatException: For input string: "printLevelOrder"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:447)
    at java.lang.Integer.valueOf(Integer.java:553)
    at TreeStack.main(TreeStack.java:73)
    Press any key to continue . . .

    lol aww, shame that you forgot to do that. i had 10 / 10 for mine, and seing as the deadline is now well and trully over,
    here is the entire source for anybody who was following the discussion or whatever and wanted to experiment.
    additional files needed >
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/Stack.java
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/ArrayStack.java
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/StackEmptyException.java
    http://users.cs.cf.ac.uk/Paul.Rosin/CM0212/StackFullException.java
    /*TreeStack.java - reads command line input of values and assigns them to stacks in a  binary tree and performs
    operations on the ADT. valid inputs: <int>,   printLevelOrder,   printPopLevelOrder,
    printPopInorder,   printPopPreOrder,   printPopRoot.         Terminates on invalid input.
    Written by George St. Clair.
    S/N:0208456         22/11/2005
    import java.util.Vector;
    import java.io.*;
    import java.util.StringTokenizer;
    public class TreeStack {
         private final int TREE_CAPACITY = 7 + 1;
         private final int STACK_CAPACITY = 10;
         Vector tree = new Vector(TREE_CAPACITY) ;
         //collect input from command line, add values to stacks at nodes of the teee
         //and perform required operations on the treestack
         public static void main (String [] args) {
              //create a tree of stacks
              TreeStack theTree = new TreeStack ();
              try {
                   //collect standard input
                  BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
                 String line = "";
                 while (line != null) {
                        System.out.print("");
                      line = in.readLine();
                      //tokenise input
                      StringTokenizer tokenizer = new StringTokenizer(line," ");
                      String word = new String();
                      while (tokenizer.hasMoreTokens()) {
                             //assign word to the token
                             word = tokenizer.nextToken();
                             boolean notCommand = true;
                             //perform operation on treestack depending on what word is
                             if (word.equals("printLevelOrder"))  {
                                  System.out.println("printLevelOrder");
                                  theTree.printLevelOrder();
                                  notCommand=false;
                             if (word.equals("printPopLevelOrder"))  {
                                  System.out.println("printPopLevelOrder");
                                  theTree.printPopLevelOrder();
                                  notCommand=false;
                             if (word.equals("printPopInorder"))  {
                                  System.out.println("printPopInorder");
                                  theTree.printPopInorder();
                                  notCommand=false;
                             if (word.equals("printPopPreorder"))  {
                                  System.out.println("printPopPreorder");
                                  theTree.printPopPreorder();
                                  notCommand=false;
                             if (word.equals("printPopRoot"))  {
                                  System.out.println("printPopRoot");
                                  theTree.printPopRoot();
                                  notCommand=false;
                             //if word was not a command it must be a number
                             if (notCommand == true) {
                                  boolean notPlaced = true;
                                  int v = 1;
                                  //starting at the root, find suitable place for number
                                  while ((notPlaced==true) && (v < theTree.size())) {
                                       //if the stack at v is empty, number goes here
                                       if (theTree.element(v).isEmpty()) {
                                            theTree.element(v).push(Integer.valueOf(word));
                                            System.out.println("inserting: "+word);
                                            System.out.println("in empty stack at location: "+(v-1));
                                            notPlaced=false;
                                       //if the stack is not empty
                                       if (notPlaced==true) {
                                            //if the value on the top of the stack is smaller than number, number goes onto the stack
                                            if (  Integer.valueOf(word) > Integer.valueOf( theTree.element(v).top().toString() )  ) {
                                                 theTree.element(v).push(Integer.valueOf(word));
                                                 System.out.println("inserting: "+word);
                                                 System.out.println("in stack at location: "+(v-1));
                                                 notPlaced=false;
                                       //if that node was no good, check the next one for suitability
                                       v++;
              catch (Exception e) {
                   //occurs when user inputs something that is neither a command, or a number, or upon EOF, or stack is full
         public TreeStack () {
              //create the TreeStack ADT by adding stacks in the vector, note vector 0 is instantiated but not used.
              for (int i = 1;i<=TREE_CAPACITY;i++)
                   tree.add(new ArrayStack(STACK_CAPACITY));
         public int size() {
              //return the size of the tree +1 (as 0 is not used)
              return tree.size();
         public ArrayStack element (int v) {
              //return the ArrayStack at v
              return (ArrayStack)tree.get(v);
         public int leftChild (int v ) {
              //return left child of v
              return v*2;
         public int rightChild (int v ) {
              //return the right child of v
              return v*2+1;
         public boolean children (int v ) {
              //search for children of v and return true if one exists
              for (int i =v;i<size();i++) {
                   if (i/2==v ) {
                         //left child found at i
                         return true;
                   if ((i-1)/2==v ) {
                        //right child found at i
                        return true;
              //no children found
              return false;
         public boolean isInternal (int v ) {
              //test whether node v is internal (has children)
              if (children (v)== true) {
                   //has children
                   return true;
              return false;
         //print the top value in each stack encountered on a level-order traversal of tree
         public void printLevelOrder() {
              //for every node of tree v
              for (int v = 1;v<size();v++) {
                   if (!element(v).isEmpty() ) {
                        //print the top value in stack v
                        System.out.println(" "+element(v).top());
                   else {
                        //stack at v is empty
                        System.out.println(" -");
         //pop off and print the top value in each stack encountered on a level-order traversal of tree
         public void printPopLevelOrder () {
              //pop off and print the top value in stack v
              for (int v = 1;v<size();v++) {
              //for each node of tree v
                   if (!element(v).isEmpty() ) {
                        //if v isnt empty print the top value in stack v
                        System.out.println(" "+element(v).top());
                        //pop the top value in the stack at v
                        element(v).pop();
                   else {
                        //stack at v is empty
                        System.out.println(" -");
         //pop off and print the top value in each stack encountered on an in-order traversal of tree
         public void printPopInorder () {
              printPopInorder (1);
         public void printPopInorder (int v) {
              boolean isInternal = false;
              if (isInternal (v)) {
                   //use a boolean for isInternal to save on running the method twice
                   isInternal = true;
                   //recursively search left subtree
                   printPopInorder (leftChild(v));
              //pop off and print the top value at v
              if (element(v).isEmpty() ) {
                   //stack at v is empty
                   System.out.println(" -");
              else {
                   //if v isnt empty print the top value in stack v then pop
                   System.out.println(" "+element(v).top());
                   element(v).pop();
              if (isInternal ) {
                   //recursively search right subtree
                   printPopInorder (rightChild(v));
         //pop off and print the top value in each stack encountered on an pre-order traversal of tree
         public void printPopPreorder() {
              printPopPreorder(1);
         public void printPopPreorder(int v) {
              //pop off and print the top value at v
              if (!element(v).isEmpty() ) {
                   //if v isnt empty print the top value in stack v then pop
                   System.out.println(" "+element(v).top());
                   element(v).pop();
              else {
                   //stack at v is empty
                   System.out.println(" -");
              if (isInternal (v)) {
                   //recursively search left and right subtrees
                   printPopPreorder (leftChild(v));
                   printPopPreorder (rightChild(v));
         //pop off and print all values from the stack at the root
         public void printPopRoot (){
              //while the root stack has values left
              while (!element(1).isEmpty()) {
                   //print, then pop
                   System.out.println(" "+element(1).top());
                   element(1).pop();
    }

  • How do I get signal from Digital Optical input (Extigy) to the Creative PlayCent

    How can I rip MP3's from the Digital Optical input on the Extigy? The PlayCenter does not seem to have any interest in the Extigy/USB as an input source. Thank you for your help!!?

    Since you are talking about variables, I suppose that you are using CP4, right?
    There is a fine tutorial in de CP4-help, chapter 'Variables and advanced actions', 'Tutorial on scripting' which explains more elaborately what I will try here:
    Create a user variable, p.e. named 'vName'  (Project, Actions, sheet Variables)
    Ask the user to enter his name in a Text Entry Box; in the properties of this TEB, sheet Advanced you indicate that this name should be put in your variable 'vName'
    Wherever you want to show this name, create a Text Caption and insert your variable by the button 'Insert variable'; this button is present in the properties window and also in the formatting toolbar if you are editing in place (look for X and and arrow); the variable in the text caption will show as '$$vName$$' and in the published SWF you will see the username.
    Hope this could help you, but please check the tutorial.
    Lilybiri

  • Get input from user and create a file and run a script in command line.

    Hi all,
    i'm trying to get a input from user and write it into a file named alpe.jacl
    To get multiple userinputs like address and jobtitle etc etc in the same single window.
    and the code will save the inputs in alpe.jacl one by one in a new line like
    nameis name
    address russia
    jobtitle dev
    So i coded like below.
    Though GUI for user input looks dull Its working fine.
    Now I want this code to perform one more task which is the GUI will contain one more button INSTALL with OK and CALCEL .
    and when after putting all inputs and creating the alpe.jacl file if someone clicks INSTALL it should start ./install.sh script present at the same folder which contains some unix shell commands.
    Here am not able to figure out how to go further...
    One more thing after all the inputs given when I am clicking on the OK button its closing the window instantly which i dont want. I want it like it should wait till someone press CANCEL to exit.
    Please some one help me.
    import javax.swing.*;
    import java.io.*;
    public class file
    public static void main(String []args)throws IOException
    FileWriter ryt=new FileWriter("alpe.jacl");
    BufferedWriter out=new BufferedWriter(ryt);
    JTextField wsName = new JTextField();
    JTextField sName = new JTextField();
    JTextField cName = new JTextField();
    Object[] message = {    "Web Server Name:", wsName,"Server Name:", sName,"Cluster Name:", cName};
    int answer = JOptionPane.showConfirmDialog(    null, message, "Enter values", JOptionPane.OK_CANCEL_OPTION);
    if (answer == JOptionPane.OK_OPTION){    String webserver = wsName.getText();
    String server = sName.getText();
    String cluster = cName.getText();
    out.write("set webservername " +wsName.getText()+"\n");
    out.write("set ClusterName " +cName.getText()+"\n");
    out.write("set ServerName " +sName.getText()+"\n");
    out.close();
    }}Thanks,
    Ricky

    Thanks a lot.
    Is there any way through which i can assign a scroll bar to my panel.
    As when the number of user inputs grows the GUI becomes more bulky and some of the fields are not showing up.
    Cheers
    _Ricky                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Considering a Macbook pro 13".  want to use garage band - how do i run line in from my guitar.  There is not a mic/line input that I can see in specs.

    Considering buying a Macbook pro 13".  Want to use garage band - how do i run line in from my guitar.  There is not a mic/line input that I can see in specs.

    Simple. GarageBand question, GarageBand forum where all those users are jacked into their Macs and can tell you how. Also look to the right of your post to the column, "More Like This."---------------------------------------------->
    https://discussions.apple.com/community/ilife/garageband

  • No 'Line input' option in sound prefs after upgrading from Tiger to Leopard

    I have connected guitars and mics using Garageband 3 without a problem, until upgrading from Tiger to Leopard 10.5.8.
    I'm not getting sound from the guitar apart from feedback when I plug it in to the audio line-in port on my iMac G5.
    I have read many of the questions and comments in the relevant forums all pointing to selecting the line-in option of the input tab in the sound preferences window.
    I only have the 'internal mic' appearing in that window now.
    I've checked that the cables are working correctly on a guitar amp and are fine.
    So not sure why I don't get the 'Line-in' option anymore.
    Are there any patches/updates to cure this problem, or would updating to Garageband 9 cure the problem?
    Thanks,
    Mick

    Yes, checked the 'Audio MIDI Setup' utility and can select Line-in from there.
    All working fine now!
    Thanks very much for your help.
    Mick

  • Is LabView able to read digital inputs from maxon motors controller, EPOS2?

    Hello,
    I would like to ask that if LabView is able to read any digital inputs directly from a maxon motor controller, EPOS2. As i have tried making a new VI from the maxon example VI, but the difference is that i've added a input control. But the program doesn't seems to work.
    That's why i would like to ask if LabView can read a direct digital input from the maxon motor controller.
    Thank You & Regards,
    ParkyPak
    Attachments:
    sensor.vi ‏34 KB

    Hello Parky,
    I understand now. I check on the motion controller and it is connected through USB to your computer. In term of controlling the motion controller, you are using some LabVIEW library from maxon. The photosensor is connected to the motion controller may be as a switch or as a limit switch.
    In order to read the value of the Digital input port, you may need to take a look of the libraries to check on what function call and the supported command to check the digital input port. If this is not successful, then question or referring to examples from Maxon motors would be the best.
    I hope that this helps.
    James
    - Meadow -
    LabVIEW 7.0 - 2011, Vision, RT, FPGA
    TestStand 3.0 - 4.5

  • Calling C from Java. C takes in a command line input

    Hello,
    I have created some basic JNI programs, in which the java file calls the C files. The way I could do it was directly calling the functions in the C files, which I needed. Now I am trying to call a C file from Java, and the C files takes in a command line argument after being compiled.
    Also after compiling the C file, it produces an exe. I cannot change the C file and also want to call it from Java using JNI (as I want to later put all this into a jar and jnlp file and put it on webstart).
    If anyone can help me on how to call the compiled C file and how to send in the input as a command line argument I would greatly appreciate it.
    Thanks
    Nick

    Now I know how to create a C wrapper file and a Java file in JNI format. Does this mean you want to run the exe files by calling the main() method through JNI. Yes you can do that BUT you will need to turn your exe file into a dll and then write a JNI wrapper to act as a bridge between the Java and the dll.Yes. Thats exactly what I want to do. I want to call the C files through JNI. But what I am asking is, how do I send in the input which is originally sent in as stdin? And also what are the steps to follow if I want to call a main method of the C files in the JNI.
    Up till now I have been using JNI to call functions from the initial C files from the C wrapper file. But now I want to call the .exe file by sending it a command line input. Or if you can suggest a better method that would be great.
    You can execute an exe file using ProcessBuilder then there is no need for a JNI wrapper. You must read the 4 sections of [http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html|http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html] and implement ALL the recommendations. Failure to do so will cause you much grief.
    You could achieve the same result but using a lot more code and a hell of a lot more effort by invoking the exe executables from JNI code that invokes the 'C' exec() library. Just thinking about that approach makes my eyes water!
    Well if I just use the exec() library I can do it, yes thats ture. But I wasnt sure if I did that, and then put this on Java Web Start, if non PC users can access it or not. If macs, and linux machines can access this even If i use exec, then my problem is solved.
    Thanks
    Nick

  • Ni 6008 acquiring digital inputs from an absolute encoder.

    Hi, i'm a student working on my master thesis.
    I'm trying to acquire 9 digital channels from a 9bit absolute encoder on the NI-USB 6008 but i'm encountering the following problem.
    I'm powering the encoder trough the 0V (GND) and +5V ports on the NI-USB 6008, and if i read the digital outputs directly from the pins
    of the encoder with a tester, without connecting them to the NI-USB 6008, i see +5V or 0V with respect to GND.
    If then i wire the outputs of the encoder to the NI-USB 6008 digital ports, the readings of the tester,  are 5V or 3.6V with respect to GND, so basically
    when i try to acquire the signals with Labview, they never switch to logic low.
    I'm a doing something wrong or is it a problem with the NI-USB 6008?
    Thank you for the help.

    Hi,
    It seems that NI-USB 6008 works well and that the encoder is not able to force low the digital output signal.
    I think that this problem could have different explanations:
    - the encoder needs a pull down resistor in order to work properly
    - the encoder try to force low the digital port while the 6008 is forcing high the same port
    - the encoder is damaged
    Try to take a look at the encoder manual in order to see if the encoder needs some additional circuitry to work properly.
    Alex

  • Getting input from textbox as "console"

    Hi all. I am learning C# and have a Windows forms project that I am working on to learn various techniques. Basically it has a text box that I use to mimic a console. The user enters a command followed by the Enter key and the program reads that in and interprets
    it. I also have some rudimentary "batch" commands, such as IF/THEN, INPUT and PRINT.
    The application has two main components: The form and a class. The form takes care of interpreting the commands that the user enters and the class implements the three batch commands (more to follow in the near future). The issue that I am having is that
    sometimes (maybe 2%) the INPUT functionality does not work. When I enter a string and press Enter an empty string is returned. I have tried to debug this as much as I can, but it is difficult since this problem only happens once in a while.
    I have extracted the INPUT functionality and duplicated it in a simple app which I present here. The test app contains one button called btnConRead and a multi line text box called txtConsole. Clicking the button "forces" the app into "run"
    mode where the batch commands are interpreted. For this example I run the code that runs when an INPUT command is being processed. The app prompts with "OK" and waits for the user to type something in. When the user presses the Enter key the entered
    string is echoed on the console. The form module contains this code:
    string sKBBuf = ""; //App wide KB buffer when form Key preview is enabled.
    bool bEnter;
    private delegate void DisplayMsgDelegate(string sMsg);
    private void cEventPrint(object sender, PrintDataEventArgs e)
    Display(txtConsole, e.sPrintLine);
    private void cEventRead(object sender, ReadDataEventArgs e)
    //Event that reads text from the console and returns it.
    //This event requires input from the user. It traps the program here until the user
    //presses Enter.
    //Clear the KB buffer.
    sKBBuf = "";
    //Loop incessantly until user presses Enter key or Stop key (s).
    do
    //Braindead.
    } while (!bEnter);
    if (bEnter)
    //User pressed the Enter key, return the KB buffer.
    e.sReadLine = sKBBuf;
    //Empty buffer.
    sKBBuf = "";
    //Reset Enter key flag.
    bEnter = false;
    //Push CRLF to console.
    Display(txtConsole, Environment.NewLine);
    private void DisplayMsg(string sMsg)
    txtConsole.AppendText(sMsg);
    private void Display(TextBox txtOutput, string sMsg, bool bToCon = true)
    //Check output to console flag.
    if (bToCon)
    if (txtOutput.InvokeRequired)
    txtOutput.Invoke(new DisplayMsgDelegate(DisplayMsg), sMsg);
    else
    txtOutput.AppendText(sMsg);
    private void GetConInput()
    clsExample cEx = new clsExample();
    cEx.ReadData += cEventRead;
    cEx.PrintData += cEventPrint;
    System.Threading.Thread runThread = new System.Threading.Thread(() =>
    cEx.Process();
    this.KeyPreview = false;
    this.KeyPreview = true;
    runThread.Start();
    private void btnReadCon_Click(object sender, EventArgs e)
    //Prep stuff
    sKBBuf = "";
    txtConsole.Focus();
    Display(txtConsole, "OK" + Environment.NewLine);
    //Read console textbox
    GetConInput();
    private void Form1_KeyPress(object sender, KeyPressEventArgs e)
    bEnter = e.KeyChar == 13;
    //Save to buffer. At this time I am not distinguishing from letter or digits.
    //But I do need to check for a BS.
    if (e.KeyChar == 8)
    //Yeah, BS, remove the last char, if any.
    if (sKBBuf.Length > 0)
    sKBBuf = sKBBuf.Substring(0, sKBBuf.Length - 1);
    else
    sKBBuf += e.KeyChar;
    The class is called clsExample and contains the following code:
    //Event raised when data needs to be printed to console.
    public event EventHandler<PrintDataEventArgs> PrintData;
    //Event raised when data needs to be read from console.
    public event EventHandler<ReadDataEventArgs> ReadData;
    protected virtual void OnReadData(ReadDataEventArgs e)
    EventHandler<ReadDataEventArgs> handler = ReadData;
    if (handler != null)
    handler(this, e);
    protected virtual void OnPrintData(PrintDataEventArgs e)
    EventHandler<PrintDataEventArgs> handler = PrintData;
    if (handler != null)
    handler(this, e);
    public void Process()
    ReadDataEventArgs argsRead = new ReadDataEventArgs();
    PrintDataEventArgs args = new PrintDataEventArgs();
    string sMsg = "";
    //Get input from user.
    OnReadData(argsRead);
    if (argsRead.sReadLine.Length > 0)
    //I have something
    sMsg = argsRead.sReadLine;
    else
    //No data
    sMsg = "*";
    args.sPrintLine = sMsg + Environment.NewLine;
    OnPrintData(args);
    Plus two more support classes for the Print and Read events:
    public class PrintDataEventArgs : EventArgs
    public string sPrintLine { get; set; }
    public class ReadDataEventArgs : EventArgs
    public string sReadLine { get; set; }
     All the above was necessary so that the Process procedure running in a different thread could interact with the UI elements in the main form. The above mostly works, but I wonder if I am doing it the right way. I don't particularly like the use of
    global flags, such as bEnter or having empty loops to just "kill" time, such as the one found in the cEventRead procedure.
    In the cEventRead procedure I had the if() block immediately following the empty loop inside
    the loop and moved it out of there to see if this made any difference, but apparently it did not. Can anyone provide any feedback or suggestions of what I could change to make it work 100% of the time? I appreciate your time and effort. Thank you, Saga
    You can't take the sky from me

    Hi all. I am learning C# and have a Windows forms project that I am working on to learn various techniques. Basically it has a text box that I use to mimic a console. The user enters a command followed by the Enter key and the program reads that in and interprets
    it. I also have some rudimentary "batch" commands, such as IF/THEN, INPUT and PRINT.
    //Loop incessantly until user presses Enter key or Stop key (s).
    do
    //Braindead.
    } while (!bEnter);
    Hi Saga,
    Please don't use such kind of loop in your code, if you want to monitor the user input, just use the KeyPress event provided by the TextBox control.
    Control.KeyPress
    Event
    If you just want to execute some standard commands, I recommend that you use
    Process to start cmd.exe to execute the command, for example:
    void ExecuteCommand(string command)
    int exitCode;
    ProcessStartInfo processInfo;
    Process process;
    processInfo = new ProcessStartInfo("cmd.exe", "/c " + command);
    processInfo.CreateNoWindow = true;
    processInfo.UseShellExecute = false;
    // *** Redirect the output ***
    processInfo.RedirectStandardError = true;
    processInfo.RedirectStandardOutput = true;
    process = Process.Start(processInfo);
    process.WaitForExit();
    // *** Read the streams ***
    string output = process.StandardOutput.ReadToEnd();
    string error = process.StandardError.ReadToEnd();
    exitCode = process.ExitCode;
    Console.WriteLine("output>>" + (String.IsNullOrEmpty(output) ? "(none)" : output));
    Console.WriteLine("error>>" + (String.IsNullOrEmpty(error) ? "(none)" : error));
    Console.WriteLine("ExitCode: " + exitCode.ToString(), "ExecuteCommand");
    process.Close();
    If it's powershell script, you can also use the existing library to execute it, check this blogpost:
    Executing PowerShell scripts from C#
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for