Basic Array Help needed

K all i am trying to do is Make an array of 5 int and then make a small basic test program that returns the smallest index of the matrix. Now the way i am doing this i want to make two files and make a call to the method that i createded called getSmallest of the public class SmallestIndex. The reason i am doing it this way nstead of putting the code in the main method is because i want to learn to pass arrays as parameters . I am learning them for the first time. This is my code:
import java.util.*;
import java.io.*;
public class SmallestIndex
     public static int getSmallest(int[] matrix)
          int minIndex = 0;
          int smallestmatrix;
          for(int index = 1; index < matrix.length; index++)
               if(matrix[minIndex] < matrix[index])
                    minIndex = index;
               smallestmatrix = matrix[minIndex];
               return smallestmatrix;
     public static void fillarray(int[] matrix, int numofelements) throws IOException
          BufferedReader board = new BufferedReader(new InputStreamReader(System.in));
          StringTokenizer tokenizer;
          tokenizer = new StringTokenizer(board.readLine());
          for(int index = 0; index < numofelements; index++)
               matrix[index] = Integer.parseInt(tokenizer.nextToken());
               if(!tokenizer.hasMoreTokens())
                    tokenizer = new StringTokenizer(board.readLine());
     public static void printArray(int[] matrix, int numofelements)
          for(int index = 0;index < numofelements; index++)
               System.out.print(matrix[index] + " ");
import java.io.*;
public class TestMatrix
     static BufferedReader board = new BufferedReader(new InputStreamReader(System.in));
     public static void main(String[] args) throws IOException
          int[] matrix = new int[5];
          for(int index = 0; index < matrix.length; index++)
               matrix[index] = Integer.parseInt(board.readLine());
          System.out.print("Elements");
          SmallestIndex.printArray(matrix, matrix.length);
          //SmallestIndex.fillarray(matrix);
          //SmallestIndex.getSmallest(matrix);

Here's something slightly different. Compare to yours to see differences
import java.io.*;
class SmallestIndex
  public SmallestIndex()
    int[] matrix = fillArray();
    printArray(matrix);
    System.out.println("Smallest          = " + getSmallestNumber(matrix));
    System.out.println("Index of smallest = " + getSmallestIndex(matrix));  
    System.exit(0);
  private int[] fillArray()
    int[] temp = new int[5];
    try
      BufferedReader board = new BufferedReader(new InputStreamReader(System.in));
      for( int x = 0; x < 5; x++)
        System.out.print("Enter a number: ");
        temp[x] = Integer.parseInt(board.readLine());
    catch(Exception e) {System.out.println("error - " + e.getMessage());}   
    return temp;  
  private void printArray(int[] arrayToPrint)
    for(int x = 0; x < arrayToPrint.length; x++)
      System.out.println("Element "+ x + " = " + arrayToPrint[x]);
  private int getSmallestNumber(int[] arrayToGetNumber)
    int smallest = arrayToGetNumber[0];
    for(int x = 1; x < arrayToGetNumber.length; x++)
      if(arrayToGetNumber[x] < smallest)
        smallest = arrayToGetNumber[x];
    return smallest;
  private int getSmallestIndex(int[] arrayToGetIndex)
    int smallest = arrayToGetIndex[0];
    int smallestIndex = 0;
    for(int x = 1; x < arrayToGetIndex.length; x++)
      if(arrayToGetIndex[x] < smallest)
        smallest = arrayToGetIndex[x];
        smallestIndex = x;
    return smallestIndex;
  public static void main(String[] args){new SmallestIndex();}
}

Similar Messages

  • *Basic* Java help needed...

    I feel like a complete novice for posting this kinda stuff, but i figured somebody would take 5 minutes and help me out. My final in my programming class depends on 2 programs, one of which is giving me some actual trouble.
    What I have to do is create a java applet that allows a user to input their weight, select a planet, and then have their weight converted to what their weight would be on the selected planet. However, if the ouput is higher than 60 pounds, I need a picture of the michelin man to appear and the theme from star wars to play. If it is below 60, A multicolored asterisk should be displayed with applause.
    I will post what code I have already made. Please note: ITS VERY VERY BASIC. I may have overcomplicated some things, and there is always more than one way to do something (in my experience). Also, I kinda just converted a temperature conversion applet, so there may be some extra stuff I don't need.
    Please help.
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    public class tempsapp2 extends Applet implements ActionListener
    Label prompt1;
    TextField input1;
    Label prompt2;
    TextField input2;
    int number1, number2;
    int mercury, venus, earth, mars, jupiter, saturn, neptune, uranus, pluto, result;
    public void init()
    prompt1 = new Label ("Enter your weight:");
    add (prompt1);
    input1 = new TextField (10);
    add (input1);
    prompt2 = new Label ("Enter the Number of the Planet you would like to have your weight converted to:");
    add (prompt2);
    input2 = new TextField (10);
    add (input2);
    input2.addActionListener(this);
    add (input2);
    public void paint (Graphics g)
    number1 = Integer.parseInt(input1.getText());
    number2 = Integer.parseInt(input2.getText());
    mercury = (number1*3780)/1000;
    venus = (number1*9070)/1000;
    earth = (number1*10)/1000;
    mars = (number1*3770)/1000;
    saturn = (number1*9160)/1000;
    uranus = (number1*8890)/1000;
    neptune = (number1*1125)/1000;
    jupiter =  (number1*2364)/1000;
    pluto = (number1*670)/1000;
    if(number2==1)
    g.drawString("Your weight on Mercury would be "+mercury+" lbs",100,150);
    else if(number2==2)
    g.drawString("Your weight on Venus would be "+venus+" lbs",100,150);
    else if(number2==3)
    g.drawString("Your weight on Earth would be "+earth+" lbs",100,150);
    else if(number2==4)
    g.drawString("Your weight on Mars would be "+mars+" lbs",100,150);
    else if(number2==5)
    g.drawString("Your weight on Jupiter would be "+jupiter+" lbs",100,150);
    else if(number2==6)
    g.drawString("Your weight on Saturn would be "+saturn+" lbs",100,150);
    else if(number2==7)
    g.drawString("Your weight on Uranus would be "+uranus+" lbs",100,150);
    else if(number2==8)
    g.drawString("Your weight on Neptune would be "+neptune+" lbs",100,150);
    else if(number2==9)
    g.drawString("Your weight on Pluto would be "+pluto+" lbs",100,150);
    public void actionPerformed(ActionEvent evt)
      number1 = Integer.parseInt(input1.getText());
      number2 = Integer.parseInt(input2.getText());
      repaint();
    }

    I am guessing that you are wondering where to go from here. If so http://java.sun.com/products/plugin/1.5.0/demos/applets/Animator/Animator.java may prove helpful.
    Also I would recommend using arrays of planet names and weight multipliers. It could make your code a lot less cumbersome.

  • Urgent array help needed! come get some duke points

    this program keeps track of rentals for a shop. Other methods and classes not shown (like Customer, Transaction classes) are also in this program. Every item (created with a constructor in Item class) can hold an array of up to 20 transactions; part of a Transaction object is a rental total, based on a number of rental days * specific rental price for that item rented (backhoe, edger, etc.) If the user presses "t" for total amount of transactions, the following method is called, which calls the getTotalPrice() in another class called Item. My problem here is that even if I enter in transaction amounts, when I press "t", the program just quits, not producing the report and returning me to the main class. I have been over it with the debugger and I am still lost. Below is some selected code; I hope it is sufficient. Please let me know if I need to put up more
    //main
    String input = JOptionPane.showInputDialog(null, "Enter a rental transaction (x)" +
                                                      "\nAdd a customer (c)" +
                                                      "\nAdd an item (i)" +
                                                      "\nReport on a specific item (r)" +
                                                      "\nReport on total dollar amounts of rentals for all items (t)" +
                                                      "\nReport on total rentals for a specific customer (s)" +
                                                      "\nStrike cancel to exit from the program");
              //big huge while
              while (input != null){
                   if (input.equals("x")){
                        rentalTrans();
                   }//if
                   if (input.equals("c")){
                        addCustomer();
                   }//if
                   if (input.equals("i")){
                        addItem();
                   }//if
                   if (input.equals("r")){
                        specificItemReport();
                   }//if
                   if (input.equals("t")){
                        allItemReport();
                   }//if
                   if (input.equals("s")){
                        customerReport();
                   }//if
                   input = JOptionPane.showInputDialog(null, "Enter a rental transaction (x)" +
                             "\nAdd a customer (c)" +
                             "\nAdd an item (i)" +
                             "\nReport on a specific item (r)" +
                             "\nReport on total dollar amounts of rentals for all items (t)" +
                             "\nReport on total rentals for a specific customer (s)" +
                             "\nStrike cancel to exit from the program");
    //allItemReport()
    public static void allItemReport(){ //menu item t
              Item temp = null;
              for (int index = 0; index < items.length; index++){
                   temp = items[index];
              }//for
              JOptionPane.showMessageDialog(null, "Total rental transactions to date amount to: $" + temp.getTotalPrice());
    //Item Class
    public String getTotalPrice() {
              double total = 0;
              String output = "";
              for (int i = 0; i < trans.length; i++) {
                   if (trans[i] == null) {
                        if (i == 0) {
                             output = "There are currently no transactions.";
                        }// if
                        break;
                   }// if
                   else{
                   total += getPerDayRentalPrice();
                   }//else
              }// for
              output+= total;
              return output;
         }//getTotalPrice

    Don't flag your questions as urgent. It's rude. Also don't think that waving with a couple of worthless Dukes is going to get you better/quicker help.
    The reason I respond to your question is because you have explained your problem well and used code tags.
    Try this:class Main {
        public static void main (String[] args) {
            String message = "Enter a rental transaction (x)\nAdd a customer (c)" +
                "\nAdd an item (i)\nReport on a specific item (r)\nReport on total "+
                "dollar amounts of rentals for all items (t)\nReport on total rentals"+
                " for a specific customer (s)\nStrike cancel to exit from the program";
            String input = JOptionPane.showInputDialog(null, message);
            while(input != null){
                if (input.equals("x")) rentalTrans();
                else if (input.equals("c")) addCustomer();
                else if (input.equals("i")) addItem();
                else if (input.equals("r")) specificItemReport();
                else if (input.equals("t")) allItemReport();
                else if (input.equals("s")) customerReport();
                else System.out.println("Invalid option!");
                input = JOptionPane.showInputDialog(null, message);
            System.out.println("Bye!");
        // the rest of your methods ...
    }

  • Javascript array help needed to generate narrative from checkboxes

    For context...  the user will indicate symptoms in cardiovascular section, selecting "deny all", if none of the symptoms apply.  The narrative sub-form needs to processes diagnosis sub-form and generate text that explains the symptoms in a narrative form.  For example, if the user selects "deny all" in the cardiovascular section, the Cardiovascular System Review field would have:  "The patient denies:  High Blood Pressure, Low Blood Pressure.  The logic associated with the narrative needs to account for "deny all" and all the variations of selections.
    I have what I think is a pretty good start on the logic, but would like some help with the following:
    1) loading selected fields into the cv_1s array
    2) loading fields not selected into the cv_0s array
    3) generating the narrative
    See "phr.narrative.cv_nar::calculate - (JavaScript, client)" for the coding I've done thus far.  Feel free to comment on any efficiency opportunities you see.  I have a SAS programming background, but I'm new to Javascript.  Thanks...
    Rob

    Hi Rob,
    One approach would be to give your checkboxes the same name so they can then be referenced as a group and use the caption as the source of your text, so you shouldn't have to duplicate the text and will make it easier to add more later.
    Attached is a sample doing that.
    Hope it helps.
    Bruce

  • Basic DVD Help Needed - More challenging than expected

    Need help creating a basic DVD that a client needs. Here are the specs needed for the DVD:
    No Menu
    No Chapters
    Can scrub forward and backward
    Begins in DVD player in a stopped state
    I can not seem to find an option to remove chapter 1 from the V1 timeline in DVD Studio Pro. Also when DVD is inserted into DVD player the video begins playing right away instead of beginning in a "stopped state" on the DVD player. Any help would be greatly appreciated.

    Make a black menu with a invisible button and link it to your track.
    as for the chapter 1 - you can't get rid of this and is a good thing to have for what your trying to achieve anyways. That way the user can either hit play to start the video or they can hit chapter and it will play as well.
    If you don't want them to be able to push anything other than play on their remote you can disable buttons.

  • Basic Info & Help Needed!

    Hello,
    I recently got Logic Pro, and a TonePort KB37.
    Basically, I can't figure out how to use TonePort on Logic. I see that there's input from it, yet i cannot hear anything.
    I also can't figure out how to record anything.
    If you guys could help me out, I would greatly appreciate it.
    also if you could just offer some basic functions
    like recording with my iBook internal mic or stuff like that, i would like it much.
    thank you in advance
    Cody Trevino

    1)How Do I activate my Plug- Ins?
    Please note that the Toneport DI is preactivated and a license key is not necessary.
    In order to activate your Line 6 Plug-Ins there are a few steps you must take. First, please make sure you have downloaded the latest version of Line 6 Monkey from our website HERE http://www.line6.com/software/ . Once you have the Line 6 Monkey downloaded please plug in the device that contains the plug ins via USB and launch the Line 6 Monkey. On the Optional Add-Ons tab in the Monkey select “Activate Purchase” and paste your License Key in the prompt window. Select “Activate”. Once the Monkey has activated your Plug-Ins you may need to authorize your computer to use them. In the Optional Add-ons tab in Monkey click on the “Authorize” button in the top right corner. For more detailed information please refer to our Gearbox 3.0 set up guide on our website HERE. http://www.line6.com/support/knowledgebase/toneporthelp/

  • Really basic Install help needed, please.

    Assistance would be greatly appreciated.
    Yes, I've searched this whole forum and probably don't know enough to ask the right "search" questions because I haven't found the answers.
    Over the past few months, I've been learning Linux as I now plan to switch from Windows to a Linux distro rather than go with a new computer and Windows 7 and the associated problems.  I have tried several Linux distros individaully side by side with  Windows XP on a partitioned drive.. Most recently I've been using Linux Mint 8 'Helena' and done lots with and to it.  Linux Mint 9 'Isadora' was just released, and since upgrading for a non-rolling distro is a nuisance, I thought I'd try a rolling one. After review and recommendations, I thought I'd give Arch Linux a try. Since most of my computer use is music via a Jukebox (14+k files), browsing, email and info seeking, I don't need all the bells and whistles whith which many distros come. I'm not a gamer.
    Basic Infor:
    PC with 1.4GHz Athlon,  512 Ram, 320 G Hard Drive partitioned equally between Windows XP and Linux (hopefully Arch). High Speed DSL.
    What I need are some really really basic instructions on a side by side install of Arch.
    SOofar, I've got the clock set, and have partitioned my hard drive into
    SDA 1 (my Windows Partition)(160 Gigs
    SDA5                                               1200mb for my swap
    SDA6                                                20 Gigs for the root
    SDA7                                               130 (the rest) Gigs for home
    What I need to know is darned near everything else.
    Bootability for SDA5-7
    How to label (the method for) SDA 5-7
    and thereafter a step by step really simple set of install instructions for a side by side installation.
    I've searched on this forum as well as via Google, but simple  instructions are nowhere to be found. I really have had no trouble installing Mepis, Madriva, Ubuntu, and Linux Mint side by side with my Windows Xp partition and done so for at least 2 of them with manual partitioning rather than the automatic side by side install offered.
    With this introduction, can someone point me to a Arch Linux side by side install for Dummies or help me with a walk through??
    Or am I in completely over my head and need to just go back to Linux Mint and plan to upgrade every 6-18 months? Or try a different rolling Distro???
    Thanks in advance to any and all who can help..
    Dick

    Willie,
    Were I certain I would be happy with Arch, there would be no problem doing as you suggest. However, looking backover at least 2 decades, our first computer was an IBM with an 8086 chip and 20 whole MB of hard drive. The choice of operating systems was DOS. As we moved onwards and upwards, Windows 95, 98, and XP were Hobson's choice for PC users (our office computer used Unix). Now with more experience and research, a new world of operating systems is available, especially for those of us with older computers which would require major (and expensive) upgrades when possible to move to Windows 7. And as with Windows ME, 2000, and Vista, there is probably potential for significant problems with 7. Utilizing my current ability to have 2 (or more) OS's on my computer affords the opportunity to learn more about them and develop my 'geekiness" as well as to evaluate and selectively choose one which will best meet my needs.
    As of now, I have at least 3 problems with abandoing Windows XP completely:
    1) I haven't found a Jukebox program for Linux equivalent to J Rivers' Media Jukebox which has seamless track switching, an equalizer, and DSP studio effects,etc. I've used WINE doors and made it run on Linux Mint, but the program will not recognize my CD-ROM drives. I have some 14+k music files and my computer jukebox runs through my home sound system.
    2) I've some 600+ movies indexed on Movie Organizer (movieorganizer.org) which flat out won't run on the Linux distro's I've tried. Re-entering those 600+ indexed movies to another program will be a bear. So far, no one of my local sources or on the other various Linux forums has a solution. WINE doors won't do it as it needs MDAC. 
    3) For all its frailties and faults, I'm reasonably literate with Windows XP. Linux OS's are still, quite obviously, relatively unfamiliar to me (3 mos experience).. So until I'm much more conversant with Linux, better the devil I know.
    I have installed and used both the Linux Mint 8 Fluxbox and KDE editions on more than one computer so it's not a question of my being shy. BTW, I'm a retired internist, and our speciality is known for being really nitpicky, detail oriented, and investigational, and I'm sure it shows.
    Again, thanks to all for the suggestions and comments. I'll keep in touch.
    Dick

  • Basic form help needed

    I am new to Dreamweaver 8 (but have worked with simple html a
    quite a bit) and am working on building a, hopefully, simple
    prototype for a project. What I need to do is collect user-entered
    text and user-selected dropdown box data on one page and send it to
    another for presentation there. After looking at the Help screens,
    I looked at using Session variables and it seems that is the best
    way to pass the data. Where I am stuck is in the (from Help
    Contents) Making Pages Dynamic - Creating Forms - Creating HTML
    forms help. They first say to, in step 2, Select Insert > Form
    (which doesn't do anything - you have to click another option,
    which I figured meant Form again). Then, in step 3, they say to
    "Specify the page or script that will process the form data." by
    selecting the file in the Action box in Properties. I don't have a
    file to "process the form data" and don't really know what they are
    talking about. Help!
    I originally (before I reverted to using Help) set it up with
    Insert->Form->Text Field text entry boxes, figuring this was
    a Form field that could be captured and passed on. Right? Wrong? I
    guess I thought the method would be to define a variable name
    associated with a text input field in one page, then pass it with
    the value to the next page. That is pretty much what it seems
    Session variables do (?), which I discovered when I started looking
    at Help.
    So, was I on the right track for a simple implementation and
    missed the way to capture and transmit the data, or do I need to
    use the Forms->Forms option? If the former, how do I define the
    variable names? If the later...well, I am real confused then. :-)
    Thanks for your help.
    (btw, we do have training material coming - went with
    Dreamweaver for Dummies, Peachpit Macromedia Dreamweaver 8 Hands-On
    Training "dead tree media" and TechRepublic Fast Track Dreamweaver
    8 CBT. Any opinions on those?)

    Session variables as the name suggests are created when a
    user starts a session and last till the session is open. You form
    doesn't really need session variables unless you are carrying form
    data from one page to another and need to keep it associated with
    that specific user such as in shopping cart applications.
    I have never used the dreamweaver insert form, so can't help
    you there. why not code the form yourself, especially since you
    have been using html
    The link below may help.
    http://www.w3schools.com/html/html_forms.asp

  • Array help needed!!!

    import java.lang.String;
    import java.io.*;
    import java.io.IOException;
    import java.util.*;
    import java.lang.Boolean;
    class Books
    public static final int SIZE=3;
    // public static final int LOAN;
    // public static final int RETURN;
    //public static final int QUERY;
    static int option;
    String title;
    String author;
    boolean loanStatus;
    String borrowerID;
    Date loanDate;
    Date dueDate;
    Books[]p0=new Books[SIZE];
    static void DisplayMenu()
    System.out.println("===Menu===");
    System.out.println("0 to Exit");
    System.out.println("1 to Borrow a book");
    System.out.println("2 to Return a book");
    System.out.println("3 to Query a book");
    System.out.print("===Your Choice>>");
    public static void main(String[] args)
    throws IOException
    BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
    String string;
    Books display =new Books();
    do
    System.out.println("\n\n");
    Date loanDate = new Date();
    Date dueDate = new Date();
    dueDate.setTime(loanDate.getTime() + (long)(24*60*60*1000)*14);
    System.out.println(loanDate);
    System.out.println(dueDate);
    display.DisplayMenu();
    System.out.flush();
    string=stdin.readLine();
    option=Integer.parseInt(string);
    switch(option)
    case 0:
    System.out.println("Exit");
    break;
    case 1:
    //display.displayBookList(Books[] p0)
    display.displayBookList(p0);
    display.loanBook();
    break;
    case 2:
    display.returnBook();
    break;
    }while(option!=0);
    void loanBook() throws IOException {
    BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
    String string;
    if(!loanStatus){
    System.out.println("Enter borrower ID: ");
    System.out.flush();
    borrowerID=stdin.readLine();
    loanStatus=true;
    else
    System.out.println("Book is on loan");
    public void Books()
    // Books[]p0=new Books[SIZE];
         loanStatus=false;      
    p0[0]=new Books();
    p0[0].title="Java Software Solution";
    p0[0].author="Lewis Loftus";
    p0[1]=new Books();
    p0[1].title="Java How To Programming";
    p0[1].author="Lewis Loftus";
    p0[2]=new Books();
    p0[2].title="Java";
    p0[2].author="Lewis Loftus";
    void returnBook()
    if( loanStatus)
    loanStatus=false;
    System.out.println("Book is return");
    else
    System.out.println("Book is Not on loan");
    static void displayBookList(Books[] p0)
    //Books display=new Books();
    System.out.println("===Book List===");
    System.out.println("0 Back To Main Menu");
    System.out.println("1 "+p0[0].title);
    System.out.println("2 "+p0[1].title);
    System.out.println("3 "+p0[2].title);
    System.out.print("===Your Choice>>");
    static void processBook(Books[] p0) throws IOException
    System.out.flush();
    string=stdin.readLine();
    option=Integer.parseInt(string);
    switch(option)
    case 0:
    display.DisplayMenu();
    break;
    case 1:
    break;
    case 2:
    display.returnBook();
    break;
    Does anyone know how why i cant access the array???

    Hello,
    After u make p0 as display.p0 inside choice 1 in your main method u can compile the code.
    But still there are some problems in ur code.
    1)when u will try running it and give option as 1.
    ur constructor --- public void Books() will not be called because its not a constructor at all its a method. In any case a constructor can not have a return type.
    if u give a return type to a constructor as given void by u.then that constructor wil be treated as a method and when u costruct the objects default costructor will be called. So ur constructor is never called.Thats why it will
    give u null pointer exception when u try to display the list of books.
    2) if u remove void from ur constructor...
    then also u are calling new Books() constructor again in side new Books() constructor, so it will go in to an infinite loop....
    so be clear what u want to do and then proceed..
    hope this will be of help.
    Amrainder

  • Basic Recording Help Needed!

    I am recording a song that consists of 3 tracks total. I have cut out the parts that are not needed while maintaining the position of the remaining sections. How do I record a final mix that is only one track? Or, how do I burn these tracks to a disc? Basically, I have the recording and editing process done, but now I need to place the music on a disc, or at least have it all saved as one track.
    THANKS!
    LMZ

    Well, I assume since you're in the Logic forum, you are using Logic on your project.
    What you're talking about is called bouncing. This means creating a 2-track mixdown (one track for the left, one for the right). Fortunately, this is easy: just go to File and choose "bounce". From there a window will open giving you several options. If you choose to bounce as AIFF, you can take the resulting file and burn it as an audio CD in Toast or iTunes. Or better yet, you can choose "burn" which will put your smash hit directly on a disc.
    See how easy that was? Now have a pancake.
    macbook pro   Mac OS X (10.4.9)  

  • Basic automator help needed

    I consider myself fairly self reliant, but I cannot figure out how to get "batch rename" to work. I don't think I understand how to utilize automator in it's basic essence. I have large folders of randomly named jpegs. I would like to rename them by topic. I have tried to program and initiate the batch rename automator, but the process does not change the files. Can anyone offer me a step by step, idiot proof, direction of how to do this properly?
    I would greatly appreciate some assitance.

    Hi, David. Automator is perfectly suited for this task. In fact, you're in luck. Apple has written an excellent easy-to-follow guide that walks you through precisely the project you describe!
    http://www.apple.com/macosx/features/automator/example1.html
    Good luck, and happy automating.
    PowerMac G5 (June 2004) 2x1.8GHz 1.25GB, PowerBook G4 (12-inch DVI) 1x1GHz 768MB   Mac OS X (10.4.3)  

  • Basic Profibus Help Needed

    I've been tasked with establishing some communication between a spectrometer (interfaced with by a laptop) and a process skid on a Profibus network to have data such as concentration/total mass/etc. appear on it's hmi. Ive had success in writing a program in C# that mapped this data to analog signals via an NI 6009 and the nidaqmx api to communicate with other skids but am at a loss when it comes to serial communication, how would this connection be established? Could I similarly map the data using some digital i/o device an/or Profibus interface module? I apologize, I'm completely new to this sort of thing, and any sort of Product/Resource recommendation would be much appreciated.

    Hi mbatc,
    What devices are you trying to communicate with?  Are you looking to communicate using a compactRIO or PXI/PCI device for your PROFIBUS communication?  Are you looking to communicate in LabVIEW or a different programming language?  In terms of LabVIEW, we have our cRIO PROFIBUS module, and was also have PXI/PCI format.  We also have examples available to help guide you with using the PROFIBUS modules.  I encourage you to take a look at the examples we include with the cRIO PROFIBUS driver.  Additionally, please take a look at the getting started material we have available for PROFIBUS.  Let me know if you have any questions!
    Matt S.
    Industrial Communications Product Support Engineer
    National Instruments

  • Basic labview help needed

    actually i m working on labview programming..my sub vi is working but when I use it in main vi its not working.. i know its the problem of dataflow but I could not find the solution to my problem..please anone help me out
    Attachments:
    subvi.vi ‏39 KB
    mainvi.vi ‏7 KB

    the way how you call a SubVI was not ok. I hope it works now.
    see attached VI.LV Version 2009
    Message Edited by FHM on 06-10-2010 09:35 AM
    Attachments:
    mainvi.vi ‏26 KB
    subvi.vi ‏16 KB

  • Point Array Help needed

    I'm trying to create an array of points and set all to points to (0,0)     
    private Point[] triPoints = new Point[2];
    this is what i have used but i'm not sure if it sets every point to (0,0) cos i get nullPointerException.
    Is there a quick way of declaring all the Points in the array (0,0)??
    Thanks in advance

    not that I'm aware of. Best way is:
    for (int x=0; x < triPoints.length; x++)
      triPoints[x] = new Point(0,0);
    }

  • WLAN Controller basic configuration help needed

    Please advise me for the initial config. of wlan controller. if found following parameters needs to be configured for initial config. of wlan controller.
    Enable Link Aggregation (LAG) [yes][NO]:
    Management Interface IP Address:
    Management Interface Netmask:
    Management Interface Default Router:
    Management Interface VLAN Identifier (0 = untagged):
    Management Interface Port Num [1 to 2]:
    Management Interface DHCP Server IP Address:
    AP Transport Mode [layer2][LAYER3]:
    AP Manager Interface IP Address:
    AP-Manager is on Management subnet, using same values
    AP Manager Interface DHCP Server (192.168.50.3):
    Virtual Gateway IP Address:
    Please advise me what these parameters mean. I'm new to wlan controller.
    Please advise.
    Thanks in advance.

    Enable Link Aggregation (LAG) [yes][NO]: Yes
    Management Interface IP Address: ex - 192.168.1.2
    Management Interface Netmask: Ex- 255.255.255.0
    Management Interface Default Router: 192.168.1.1
    Management Interface VLAN Identifier (0 = untagged):(Hit enter no need to fill this)
    Management Interface Port Num [1 to 2]:1
    Management Interface DHCP Server IP Address:
    AP Transport Mode [layer2][LAYER3]: LAYER 3
    AP Manager Interface IP Address: ex - 192.168.1.3 (same subnet that of Management interface)
    AP-Manager is on Management subnet, using same values
    AP Manager Interface DHCP Server (192.168.50.3):
    Virtual Gateway IP Address:1.1.1.1

Maybe you are looking for

  • TS1538 i cant get my new ipod touch 7 to be recognized in itunes? Please help!

    I cant my new Ipod Touch 7 to be recognized in Itunes?  Please help!  I'm trying to sync my music and book files with the new Ipod buts it not even listed under devices.  I have an old Ipod that I was using prior to this one that shows up under devic

  • How to display data in text file in column format

    hi i am acquiring data from an oscilloscope. wen i save the data in a text file using wite to speadsheet string, all the voltage values r displayed first and then the time values... besides its tab delimited how can i display it such that the time va

  • Passing values to parameters in row created by createInsert method

    Hi, I am passing some values from one task flow to other as input parameters for the other. There(in second task flow) i am using a createInsert method to create a row. How can i pass the values of the input parameters received to the parameters of t

  • Drop Down Menu in Adobe Muse Form

    Hello.  Is there a way to create a drop down list in a FORM in Adobe Muse.   I could not seem to find that anywhere Thanks for your Help David

  • Importing in flash problem

    This appears when I export from captivate to flash: "A swf animation slide has been imported. The following files must be made available at publish time: myfile_Slide_7_0.swf myfile_Slide_10_0.swf Please make sure you publish the project to "C:/Docum