Stuck using the Comparable Interface

I am having problems implementing the Comparable Interface in my class. I have written the compareTo method but this is not working. Can anyone see what I am doing wrong in the coding of this method. Thanks !!. (see below code for the class :
package tma02q1;
import java.util.*;
This is the outline of the basic Video class.
Such a class describes the videos stocked by a branch of a video hire company
As well as completing the given methods you will need to make further additions
to this class.For further details you should study the BranchTest class.
public class Video implements Comparable {
// declare two instance variables
// a String to hold the video title
// an int to hold the video rental cost - cost is held in pence
private String aTitle;
private int aCost;
public Video(String aTitle, int aCost) {
this.aTitle = aTitle;
this.aCost = aCost;
private void setTitle(String aTitle) {
this.aTitle = aTitle;
public String getTitle() {
return aTitle;
private void setRentalCost(int aCost) {
this.aCost = aCost;
public int getRentalCost() {
return aCost;
public String toString() {
return "Video Title = " + aTitle + " which has a rental cost of = " + aCost;
public boolean equals(Object vid) {
Video arg = (Video) vid;
return (this.aTitle.equals(arg.aTitle)
&&this.aCost==arg.aCost);
public int compareTo(Object vido) {
Video arg = (Video) vido;
int comp = aCost.compareTo(arg.aCost);
return comp;

You've got another serious problem with your code. Both the equals and compareTo methods will throw a ClassCastException if the parameter is not a reference to a video object. Using the instanceof operator will however solve the problem. E.g.
public boolean equals(Object o) {
  if (o instanceof Video) {
    Video  arg = (Video) o;
    return (this.aTitle.equals(arg.aTitle)
            &&this.aCost == arg.aCost);
  else
    return false;  
}The same approach is applicable to the compareTo method.
Regards

Similar Messages

  • Using the Comparator Interface.Please Help.

    Hello there,
    I am trying out this example regarding the Comparator Interface.
    It works fine, but I havent really understood this at all.
    It deals with reverse sorting.
    import java.util.*;
    class MyComp implements Comparator {
    public int compareTo(Object a,Object b)
    String aStr,bStr;
    aStr = (String)a;
    bStr = (String)b;
    return bStr.compareTo(aStr)
    class MyComparator {
    public static void main(String[] args) {
    // Create a Tree Set
    TreeSet ts = new TreeSet(new MyComp());
    ts.add("C");
    ts.add("A");
    ts.add("P");
    ts.add("Z");
    ts.add("B");
    System.out.println(ts)
    Output : [Z, P, C, B, A]
    I have not understood the following at all:
    1) We are implementing the Comparator Interface in class MyComp.
    Now where is this being called in the MyComparator class?
    2) How is the reverse sorting taking place.?
    How is this comparing the different instances of the MyComparator class
    when I havent even instantiated the MyComparator class ?
    3) How is the interface method compare To(Object a,Object b) being invoked?
    Please can some please answer my questions.
    Regards

    class MyComp implements Comparator {
    public int compareTo(Object a,Object b)
    String aStr,bStr;
    aStr = (String)a;
    bStr = (String)b;Your reverse ordering is happening here.
    If you were to write
    return aStr.compareTo(bStr)
    the ordering would be in normal order.
    >
    return bStr.compareTo(aStr)The comparator that the treeSet uses is declared and instantiated here
    TreeSet ts = new TreeSet(new MyComp());
    1) We are implementing the Comparator Interface in
    class MyComp.
    Now where is this being called in the MyComparator
    or class? The comparator is being used by the TreeSet to order your entries
    >
    >
    2) How is the reverse sorting taking place.?Explained above. For further explaination look up comparator and String.compareTo()
    How is this comparing the different instances of
    of the MyComparator class
    when I havent even instantiated the MyComparator
    or class ?Also explained above
    3) How is the interface method compare To(Object
    a,Object b) being invoked?Internally by the TreeSet
    I hope this helped a little

  • How to use the Comparable Interface?

    Now I have a question and I don't quite understand what the book explains. How does the comparable interface work? How can you redefine the equals implementation? How can you implement a compareTo? and how does this works with arrays? Thanks amigos......

    Not sure how to answer your question "how does the Comparable interface work" - what do you mean by "work"? It's purpose is to supply a known method that can be used to define an ordering on lists of objects. To do this you need to know how two objects compare to each other (less than, equal to, greater than) - and that's what the compareTo method gives you.
    You redefine the equals implementation by overriding the equals method - just declare a method in your class that has the same signature as equals and you're good.
    Your implementation of compareTo depends on your class. You just need to define how your classes compare to each other - for instance, assume you have an "Employee" class, that has an employee number and first name and last name fields. You want the natural ordering of lists of Employees to go in order by employee number. Define your compareTo method like:
    public int compareTo(Object o) {
        Employee emp = (Employee)o;
        if (emp.getEmployeeNumber() < this.getEmployeeNumber()) {
            return -1;
        else if (emp.getEmployeeNumber() == this.getEmployeeNumber()) {
            return 0;
        else {
            return 1;
    }You can sort arrays of things via the Arrays.sort method, which takes the array to sort and a Comparator (not Comparable) reference. The Comparator interface provides the same idea as the Comparable interface, but it's a stand-alone object that handles the comparison, as opposed to a method of some particular class. The compareTo method of the Comparator interface takes two Object references and returns how they compare.
    Good luck
    Lee

  • Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems n

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

    Since installing LTR 5.4, which I've now upgraded to 5.6, I've encountered repeated slowness and malfunctions in operations, especially when using the Compare View function and the Tab key to open and close the right and left side panels.  Such problems never arose during two years of using LTR-4 and nothing else has changed on my computer.  I have a pretty simple system with only a few plug-ins, which are usually not in operation.  I have 12GB of RAM in my Windows 7 PC.  I could illustrate these problems with screen shots if you would tell me how to submit screen shots.  Otherwise I will try to describe the problems in words.
    The problem is clearly cumulative, growing worse as usage time passes.  Compare View feature gradually slows down and eventually seems to choke as my work session proceeds. If I Exit LTR and re-enter and start all over, things will work normally for maybe 30 minutes, but then the Compare View feature begins to become very slow to respond.   In a recent example with my screen full of thumbnails in Library mode I highlighted two images to compare. LTR started to open the Compare View screen by first having the top row of thumbnails disappear to be replaced by the "SELECT" and "CANDIDATE" words in their spaces  (but no images), but Compare View never succeeded in gaining control of the screen. After some seconds the top row of thumbnails reasserted its position and the Compare View windows disappeared. But LTR kept trying to bring them back. Again the top row of thumbnails would go away, Select and candidate would reappear, try again, and give up. This went on for at least 2-3 minutes before I tried to choose File and Exit, but even that did not initially want to respond. It doesn't like to accept other commands when it's trying to open Compare View. Finally it allowed me to exit.
    To experiment I created a new catalog of 1100 images.  After 30-40 minutes, the Compare View function began to operate very slowly. With left and right side panels visible and two thumbnails highlighted, hitting Compare View can take half a minute before the two mid-size  images open in their respective SELECT and CANDIDATE windows. When the side panels are open and two images are in the Select/Candidate spaces, hitting the Tab button to close the side panels produces a very delayed response--25-30 seconds to close them, a few more seconds to enlarge the two images to full size. To reverse the process (i.e., to recall the two side panels), hitting Tab would make the two sides of the screen go black for up to a minute, with no words visible. Eventually the info fields in the panels would open up.
    I also created a new user account and imported a folder of 160 images. After half an hour Compare View began mis-placing data.  (I have a screen shot to show this.)  CANDIDATE appears on the left side of SELECT, whereas it should be on the right. The accompanying camera exposure data appears almost entirely to the left of the mid-screen dividing line. Although the Candidate and Select headings were transposed, the image exposure data was not, but the data for the image on the right was almost entirely to the left of the line dividing the screen in two.
    Gurus in The Lightroom Forum have examined Task Manager data showing Processes running and Performance indicators and they see nothing wrong.  I could also send screen shots of this data.
    At this point, the only way I can process my images is to work 30-40 minutes and then shut down everything, exit, and re-start LTR.  This is not normal.  I hope you can find the cause, and then the solution.  If you would like to see my screen shots, tell me how to submit them.
    Ollie
    [email protected]

  • Using the FilenameFilter interface to get the extension of a file

    Hello...
    I am trying to write a java program which is going to parse multiple xml documents and load them into the db. In a directory, there could be files other than xml files. Hence, i want to parse only files which have an .xml extension. I am using the FilenameFilter interface to get the extension of the files in a particular directory. However i am getting confused with the way it shd work...i am attaching herewith the code ...pl help me. I would appreciate if u could send me some sample code.
    /* Author : Jayashree */
    import com.xhive.XhiveDriverFactory;
    import com.xhive.error.XhiveException;
    import com.xhive.core.interfaces.XhiveTransactionIf;
    import com.xhive.dom.interfaces.XhiveDocumentIf;
    import com.xhive.core.interfaces.XhiveDatabaseIf;
    import com.xhive.core.interfaces.XhiveConnectionIf;
    import com.xhive.dom.interfaces.XhiveLibraryIf;
    import org.w3c.dom.Document;
    import java.io.*;
    public class MultiXML
    public static void main(String args[])
    try
    String administratorName = "Administrator";
    String administratorPassword = "secret";
    String DBName = "FirstDB";
    XhiveConnectionIf fConnection = XhiveDriverFactory.getDriver().getConnection();
    System.out.println("Got the connection");
    fConnection.connect(administratorName,administratorPassword,DBName);
    System.out.println("Connected");
    XhiveTransactionIf fTrans = fConnection.createTransaction();
    System.out.println("Transaction");
    fTrans.begin();
    System.out.println("Transaction begun");
    XhiveDatabaseIf fDBase = fTrans.getDatabase();
    String DBName1 = fDBase.getName();
    System.out.println(DBName1);
    XhiveLibraryIf rootLibrary = fDBase.getRoot();
    System.out.println("Got the root");
    File fDir = new File("e:/xhive");
    File[] files = fDir.listFiles(new FileFilter("xml"));
    int i = 0;
    while ((i < files.length))
    Document fDoc = null;
    System.out.println("Document Initialized");
    try
    fDoc = rootLibrary.parseDocument(new File(files[i]+".xml").toURL(), XhiveLibraryIf.PARSER_NO_VALIDATION);
    rootLibrary.appendChild(fDoc);
    System.out.println("Appended");
    catch (Exception e)
    e.printStackTrace();
    i++;
    fTrans.commit();
    System.out.println("Committed");
    fTrans.terminate();
    System.out.println("Terminated");
    fConnection.close();
    System.out.println("Connection Closed");
    catch(Exception e)
    System.out.println(e.getMessage());
    In the above code, I am trying to list all those files which have the filter as .xml. I am unable to understand what code i need to write in the accept method of the FilenameFilter interface which accepts the directory name and the file name. There could be a directory which consists of multiple xml files too..this is where i am finding a problem
    Regards,
    Jayashree

    This sample code uses an inner anonymous FilenameFilter that takes all readable files with a ".xml" extension.
    File[] fileList = dir.listFiles (new FilenameFilter () {
        public boolean accept (File dir, String name) {
            if (!name.trim().endsWith (".xml"))
                return false;
            File f = new File (dir, name);
            if (!f.isFile())
                return false;
            if (!f.canRead())
                return false;
            return true;
    });Please post any question if you don't understand.
    Matthieu

  • How do i pass a daqmx task from labview to matlab using the math interface toolkit?

    I want to use DAQMX functions from Matlab using the Math Interface Toolkit (MIT). How can I have a labview function output (return) the DAQMX task to matlab via the MIT?
    I want to do this so I can start a DAQMX task in Labview from a matlab function and return control to matlab without losing the task.

    Hi Mark,
    (I already posted this answer in your other thread, but let's keep THIS thread alive - it makes more sense here in the LabVIEW forum than in Instrument Control forum.)
    Since the DAQmx Task is not a native data type that can be passed directly to MATLAB from LAbVIEW, try flattening the DAQmx Task to a string before passing to MATLAB. However, I doubt that you can access the task from within MATLAB, but feel free to give it a try.
    Good luck!
    - Philip Courtois, Thinkbot Solutions

  • In Camera Raw 8.4.1 I can open dngs from 3 years ago, but it's using the old interface and functionality not the current - how do I change this. Have rebuilt cache.

    Running Creative Cloud on an HP with 18Gb Ram - I'm working on a project using 3 yr old dngs and when I open in my up to date Camera Raw it uses the old interface with 'contrast' towards the bottom and 'recovery' below 'exposure' - how do I get Camera Raw to open with the current interface?
    Thanks for any help.
    Craig

    If you're referring to the Process version, you set that in the Camera Calibration tab of ACR.
    Also keep in mind that any images with prior adjustments will show the Process used when they were adjusted.  That can also be changed in that tab.

  • Using the Mathcad Interface, my worksheet won't recognize the data as numbers

    While using the Mathcad Interface Library, I've written a 2D Matrix, but although the Mathcad Worksheet does display the data, it won't recognize it as numbers, hence I can't do any operations with it. However, if I declare the very same matrix in mathcad, my worksheet works fine. What can I do?

    Hi ali84, did you tried using the examples that are in the library? Do you get the same error? Could you post your code to see how you are sending the data?
    If manually defining the worksheet as numbers will make your program work, you could use directly the VIs for Active X and change the properties directly
    http://zone.ni.com/devzone/cda/tut/p/id/2983
    Best Regards
    Benjamin C
    Senior Systems Engineer // CLA // CLED // CTD

  • Aironet 1240AG - cant use the web interface

    I am trying to configure a new Aironet 1240AG. After it picked an ip address from the DHCP in my lan, I still can't log in using the web interface. I am using an Internet Explorer 6.0 on Win 2000. It keeps telling me cannot find server. please i need assistance

    Hi Obinna,
    Sorry about the link :( The problem here is the fact that 12.3.(11)JX is a Lightweight image. Have a look;
    Warning: All Cisco Aironet Access Points receiving Cisco IOS Software Release 12.3(11)JX will only function in conjunction with a Cisco Wireless LAN Controller. They will no longer be able to function as Cisco Aironet Autonomous Access Points.
    This product bulletin describes the content and delivery information for Cisco IOS Software Release 12.3(11)JX. This is a Cisco Lightweight Access Point Protocol (LWAPP) upgrade and recovery support software image supporting Cisco Aironet 1100, Aironet 1130, Aironet 1200, Aironet 1230 AG, Aironet 1240 AG, and Aironet 1300 Series Access Points.
    http://www.cisco.com/en/US/products/ps5861/prod_bulletin0900aecd804b1a72.html
    You can use this method to convert the AP back to Autonomous Mode (and access via Web);
    Reverting the Access Point Back to Autonomous Mode
    http://www.cisco.com/en/US/products/hw/wireless/ps430/prod_technical_reference09186a00804fc3dc.html#wp161272
    You can convert an access point from lightweight mode back to autonomous mode by loading a Cisco IOS Release that supports autonomous mode (Cisco IOS release 12.3(7)JA or earlier). If the access point is associated to a controller, you can use the controller to load the Cisco IOS release. If the access point is not associated to a controller, you can load the Cisco IOS release using TFTP.
    Using a TFTP Server to Return to a Previous Release
    Follow these steps to revert from LWAPP mode to autonomous mode by loading a Cisco IOS release using a TFTP server:
    Step 1 The static IP address of the PC on which your TFTP server software runs should be between 10.0.0.2 and 10.0.0.30.
    Step 2 Make sure that the PC contains the access point image file (such as c1200-k9w7-tar.122-15.JA.tar for a 1200 series access point) in the TFTP server folder and that the TFTP server is activated.
    Step 3 Rename the access point image file in the TFTP server folder to c1200-k9w7-tar.default for a 1200 series access point, c1130-k9w7-tar.default for an 1130 series access point, and c1240-k9w7-tar.default for a 1240 series access point.
    Step 4 Connect the PC to the access point using a Category 5 (CAT5) Ethernet cable.
    Step 5 Disconnect power from the access point.
    Step 6 Press and hold MODE while you reconnect power to the access point.
    Step 7 Hold the MODE button until the status LED turns red (approximately 20 to 30 seconds) and then release.
    Step 8 Wait until the access point reboots, as indicated by all LEDs turning green followed by the Status LED blinking green.
    Step 9 After the access point reboots, reconfigure it using the GUI or the CLI.
    From this doc;
    http://www.cisco.com/en/US/products/hw/wireless/ps430/prod_technical_reference09186a00804fc3dc.html#wp161272
    Hope this helps!
    Rob

  • Could not use the math interface toolkit

    I have labview 8.0....and i am unable to use the math interface kit it provided....please help..

    swap,
    You are correct that the Math Interface Tookit 1.0 is not compatable with LabVIEW 8.0, which probably exlains why you are seeing an error.  You may have already seen this knowledgebase.  As suggested in the knowledgebase, you can get version 1.0.2 by visiting the Upgrade Advisor.  You can also contact your local NI sales representative.
    Chris M

  • Importing form data per XML - Using the form interface?

    Hi!
    I'm developing interactive forms by adobe and I want to import my form data per XML file. The xml file and the email are created by my pdf document.
    Now this xml file has to be parsed by a report or something like this.
    Is it possible to use the form interface, I implemented, or do I have to parse it manually?
    I think it has to work with this interface because it makes the pdf and it "knows" what to import/export.
    Am I wrong with my suspicions or can you help me with this problem?
    Thanks & greets,
    Philip Gillißen

    I'm pretty impressed of Adobe and their stuff (I do NOT refer to the community), how helpful they are.
    Perhaps I didn't understand  the meaning on the offical customer support website, stating:
    The best way to contact us...  
    Ask our experts 
    Our community and staff are at your service 24/7
    Even worst, their is a similar question from 25/09/2013 (http://forums.adobe.com/message/5711946#5711946) and no feedback form Adobe stuff at all.
    Great service guys!
    Thanks a lot!

  • Hi,using the COM interface how do you get/set

    Hi, using the COM Interface how do you get/set the Keep iTunes Music Folder Organised options, I cant seem to find it in the help. Secondly if I have the location of a file and the Track DatabaseId, is there any way to get get the IITrack object that relates to the location. As far as I can see the Search method only allows searching on artist/abum,title,composer , and GetITObjectByID() reuires both the track database id and the track in playlist id ,and I only have the first.
    Thanks for any help Paul

    Yes, I brute force my way through it. I analyzed the file before and after a preference change to find the data changed. FYI, the "data" portion of the iTunesPrefs.xml file appears to be Base64-encoded. Strings are UTF8.
    If you want more support from apple, you would probably need to buy an higher-level ADC account.
    You can also try submitting an enhancement request through http://bugreport.apple.com (requires at least a free ADC Online account)

  • Problem in using the Unreferenced interface

    I let my RemoteObject to implement the Unreferenced interface to handle with the unexpectly abort client. but I have a question about how to use such interface in my remote object.
    My first thought about it is simple :
    class RemoteObject extends UnicastRemoteObject implements Unreferenced {
        public long lock(final int recno) {
            this.lockedRecNo = recno;
            this.lockCookie = LockManager.getInstance().lock(recno);
            return lockcookie;
        public void unreferenced() {
            this.unlock(this.lockedRecNo, this.lockCookie);
    }I think it is absolutely wrong under such scenario, since the unreference does not take effect immediately and we surely have only one RemoteObject, during this time. someother client may lock on other records, When performing the unreferenced, we may work on the incorrect record number and cookie.
    Then I improved it as
    class RemoteObject extends UnicastRemoteObject implements Unreferenced {
        private HashMap lockedRecord = new HashMap();
        public long lock(final int recno) {
            this.lockedRecNo = recno;
            this.lockCookie = LockManager.getInstance().lock(recno);
            lockedRecord.put(new Integer(recno), new Long(lockCookie))
            return lockcookie;
        public void unlock(final int recno, final int cookie) {
            LockManager.getInstance().unlock(recno, cookie);
            lockedRecord.remove(new Integer(recno));
        public void unreferenced() {
            //get all that haven't released lock from the HashMap
            //do a loop
            **loop** {
            this.unlock(this.lockedRecNo, this.lockCookie);
        }There are still some problems. maybe when we are executing the unreference, there is a client who are holding a lock and doing the update action, then we may wrongly release his lock.
    I can not figure out a good enough way to handle this. can any one help me on this. thx in advance.

    Hi.. Actually, it is not part of the[b] real world problem, I just want to provide a way to clean up the staleness record. If considering this. do you guys thing the approach 2 of the first posting is a way(maybe not a good way), except I should change the hashmap to hashtable to avoid the concurrent accessing... appreciate for any reply from u.

  • Problem with Get the current and voltage from HP Power Supply (HP E3631A), using the GPIB interface.

    my USB device's power support is from the DC Power Supply ( HP E3631A)
    I need to read using current from a DC Power Supply ( HP E3631A),via GPIB interface.
    When I use the follow command.Why can't read the current value.My environment is in vc++ 6.0.
    "APPL P6V,5.0,1.0"
    "OUTP ON"
    "MEAS:CURR? P6V"
    attached the NI SPY File.Please check it.
    Can you tell me what the problem is ??
    Thanks in Advance !
    Hope you can solve my problem !!!"
    Attachments:
    E3631AERR.spy ‏7 KB

    Hi neilchuang,
    A read timeout error is usually caused by an error on the command string sent.
    The first thing I would check is if the instrument requires a termination character at the end of each message (such as linefeed). I noticed in the Spy capture that the commands do not have a termination character attached. This means that the instruments never recognized that you completed the query command, it doesn't execute the requested action and as a consequence of that it doesn't have any data to return.
    One question: Is the instrument detected by MAX when you scan for instruments?. If yes then you can assume that the GPIB software and hardware are properly installed. The scan for instruments sends the *IDN? (terminated by a linefeed). You can right-cli
    ck on the instrument entry in MAX and select "Communicate with instrument". Notice that at the end of the command the linefeed is included (\n).
    Double check with the instrument manual if the commands sent are the right ones.
    Finally, there is an instrument driver available in the idnet library: www.ni.com/idnet. Search for 3631. Since you are working in C you can use the LabWindows/CVI Plug and Play driver. Even if you decide not to use the instrument driver, you can still use it as an excellent reference on how to program with the instrument.
    Hope this helps!.
    DiegoF
    National InstrumentsMessage Edited by Molly K on 02-18-2005 11:05 PM

  • NATting using the same interface ?

    hi there,
    I was wondering, is it possible to set up NAT/PAT for packets arriving/leaving (after being routed) the same interface , e.g. not going "through" the router ?
    I think that this is not possible but I need to be sure... Any help ?
    Thanks,
    Alex

    That is called nat on a stick.
    http://www.cisco.com/en/US/tech/tk648/tk361/technologies_tech_note09186a0080094430.shtml
    Once you understand how to do this NAT will never confuse you again.
    There may be a newer method with the new NAI interfaces in the latest IOS but I have not had time to test this and have not seen any documentation on using these new nat features for this purpose.

Maybe you are looking for

  • Storing Print Presets in a Manually Created PDF

    I am a Progress programmer creating/printing PDF documents from reports written in Progress by wrapping a PDF shell around the document. Having reviewed Adobe documentation, I know there is a feature called print presets that can be setup so that eac

  • New iMac - recommendations for running Win 7

    Okay, so I'm picking up my new 27" iMac today. I plan on installing Win 7 to run a few programs that I may need in the future (trying to downsize to one desktop), although OS X will be my main system. I know that Boot Camp is part of the OS now, but

  • Exporting Flash to Director WITH video

    In Flash, I have created a digital camera, that, when a button is pressed, the screen changes from showing pictures to showing a video. This works all fine and well in Flash, however, it has to work in Director. Now I imported it into Director, obvio

  • When i try to burn a cd everything appears to be functioning but the cd is still blank?

    when i try to burn a cd everything appears to be functioning but the cd is still blank?

  • RW-50015: Error:

    Fuckup Oracle Apps... 12.1.1 on RHEL 5.4... If you do not have Patch 6078836 pls do not try to setup above version... I have wasted 2 months for downlaod and pre-reqs.. pld do not laugh...... it is reality which faced.. on OTN... if you search my ID