Read Instrument Value and Saving Data

Hi Everyone,
I have DSOX3014A Oscilloscope and  33521AQ Function / Arbitrary Waveform Generator . I want to make program that read oscilloscope and waveform generator data and send to tax file.
What should ı do ?
Thank for your time and attention.
Solved!
Go to Solution.

I am really beginner.I never tried something so far.I have oscilloscope and arb generator. Also ı have piezoelectric bender(been attach) actuator resonance impedance.I connected oscilloscope and arb waveform generator to my computer. I want to record oscilloscope and arb waveform generator's data to tex file.
Actually ı don't have impedance analyzer therefore ı calculate piezo bender's resonance impedance this way.
Seem http://www.ni.com/try-labview/instrument-control/    first video but ı have to convert data to tex file. 
What should ı do? 
Thank You for your attention.
Attachments:
20150203_231732_Richtone(HDR).jpg ‏840 KB
Capture.PNG ‏970 KB

Similar Messages

  • Please recommend if we have options to read xml file and insert data into table without a temporary table.

    Please recommend if we have options to read xml file and insert data into table without a temporary table. 

    DECLARE @data XML;
    SET @data =N'<Root>
    <List RecordID="946236" />
    <List RecordID="946237" />
    <List RecordID="946238" />
    <List RecordID="946239" />
    <List RecordID="946240" />
    </Root>'
    INSERT INTO t (id) SELECT T.customer.value('@RecordID', 'INT') AS id
    FROM @data.nodes('Root/List')
     AS T(customer);
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Different values beetween front page and saved data

    Hello,
    I have problems to saved data correctly. I acquire data with Labview 6.0 and a counter/timer card. These data appear on my front page. But when I save them in a table file, their format is modified, rounded.
    For exemple: on my front page values are 20.675 , 21.012 and in my saved file these values are 20.750 and 21.000, even if I checked all the numbers format in the diagram, and declare them in extended precision.
    Where is my mistake ?
    Thank you for your help

    Hello shadok,
    that's strange :-)
    Try this simple example. If this works, then something with your data is wrong...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Test_Save.vi ‏12 KB

  • Issues In Reading Attribute Values From Master Data

    Hi All,
    I have a requirement where, i need to read an attribute value from master data. I have a characteristic YCSTATMCG (AT Cost Group Code) which is the master data from where i have to read the attribute, 0PROFIT_CTR (Profit Center). The attribute thus read, has to be populated into another characteristic, YPROFIT_C.  But YCSTATMCG referes to another characteristic, YCSTCG. Here is the FOX Code I wrote with YPROFIT_C as the changing characteristic and 0AMOUNT as keyfigure.
    DATA V_ATCP TYPE YCSTATMCG.
    DATA V_PROFIT TYPE YPROFIT_C.
    DATA V_PROFITC TYPE YPROFIT_C.
    DATA V_AMOUNT TYPE F.
    V_ATCP = OBJV().
    MESSAGE I020(YCO_CFT) WITH V_ATCP.
    V_AMOUNT = {0AMOUNT,  # }.
    V_PROFIT = ATRV('0PROFIT_CTR' , V_ATCP).
    MESSAGE I020(YCO_CFT) WITH V_PROFIT.
    {0AMOUNT, V_PROFIT} = V_AMOUNT.
    But this is not working. The ATRV() function is not reading the attribute values at all. Any solutions and suggestions is highly valued.
    Thanks in advance
    Swaroop

    Hi,
    even i have the same situation.
    i just want the attribute value of a char to be populated into another characteristic in the planning query.
    my question is whether i should populate the keyfigure field also in the FOX code.
    if so should i populate both 0amount and 0quantity fields as i have 2 keyfigure fields.
    Thanks for your help
    Nishanth

  • BDC read screen value and press button

    Hi,
      How can i read a screen value and press button by BCD??
    Regards,
    Kit

    Hi ,
    There is table bdcmsgcoll which holds the values  so if do like below  you can find out the values
    data: it_tab2 type table of bdcmsgcoll with header line.
       call transaction 'BGM1' using it_tab3 mode 'E' messages into it_tab2.
    now  it_tab2 will hold the values  and you can check that in debugging mode
    do reward if helpful

  • Reading s file and saving a the dta to an array

    Hi,
    I have a txt file that is contained of text and numbersso this is the format :
    hdfsgfjsgfjsfg
    kshfkwhfl
    kshfakh
    kahflak
    Xunit , YUNIT
    1,2
    2,3
    5,4
    So I want to read this file and save the numbers to two arrays, here is my code, and it gives error on Ch[i] = result[1]; it also say array out of bound and it gives me the watrning that ReadDile.java overrides a depricated API. hELP:
    import java.net.*;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    public class ReadFile {
    public static void main(String[] args) throws IOException {
    /*Open the file and Read the file
         File inputFile = new File("wfmdata.txt");
         FileReader in = new FileReader(inputFile); */
         FileInputStream fis = new FileInputStream("wfmdata.txt");
    BufferedInputStream bis = new BufferedInputStream(fis);
    DataInputStream dis = new DataInputStream(bis);
         String c;
         String[] T = new String[10012];
         String[] CH = new String[10012];
    int i=0;
    for(;;)
    /*Read one line and store it in variable c */
    c = dis.readLine();
    //if a null line return
    if(c != null)
    if( (c == "XUNIT , YUNIT"))
    continue;
    String[] result = c.toString().split(",");
    T[i] = result[1];
    CH[i] = result [1];
    System.out.println( T[i] + "," + "CH" + result.length);
    i++;
         }else
    dis.close();
    how would I change the code to get rid of the errors!
    there are 10000 lines of numbers(data).
    Sanaz,

    If you are only trying to read in integers i would recommend a different approach. Try using the scanner class. It's new to 1.5 It basically splits up everything in the data source into tokens based on where there is white space. what might interest you is that it has methods to just retrieve primitive types ints, doubles etc.
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
    you might try something like this. It will ignore strings and just handle integers, based on the format you have given.
    import java.util.Scanner;
    import java.io.*;
    public class ReadFile
        public static void readFile() throws FileNotFoundException
            Scanner sc = new Scanner(new FileReader("C:\\YourFile.txt")); // set the source of the data and create a scanner object to tokenize the data
            int[] xUnit = new int[10012]; // initialise the integer arrays
            int[] yUnit = new int[10012];
            while (sc.hasNextInt() == false) // checks to see if the next "token" read by the scanner is an integer
                sc.next(); // moves onto the next token until an int is found.
            for (int count = 0; count < xUnit.length; count ++)  // goes through the array until it hits the end
                xUnit[count] = sc.nextInt(); //assigns the int to the array
                sc.next(); // skips the comma
                yUnit[count] = sc.nextInt(); //assigns the next int to the other array
            for (int count = 0; count < xUnit.length; count ++)
                System.out.println( xUnit[count] + "," + yUnit[count]); //prints out all the data read in
    }Bear in mind my java experience is fairly limited, so this may not be what you're after.

  • Read from file and plot data against timestamp

    Hello,
    I know that there are already many posts regarding the question I m about to ask. But, I somehow dont seem to achieve what I want using the suggestions given in the other posts.
    My problem is that, I have a file with the first column as a time stamp containing hour, minute, second and millisecond. The second column in a set of pressure values. I want to plot a graph of these pressure values against the timestamp recorded in this .txt file. Whatever I do, the timestamp values seem to skip by a couple of seconds.
    How do i do this correctly?
    Also, Is it advisable to use the read from file or the read from spreadsheet file vi? Kindly help me out.
    Thanks and regards.

    Hey, I was having a similar issue the other day.  The first problem I had was how to open the file and actually get the timestamp information.  Since I'm using LabView 8.0, I had to go into Read Spreadsheet File and create a new vi to open strings (in an array form).  That's the Read Spreadsheet File (string) vi below.  Then, I had to figure out how to convert the string of a timestamp to something meaningful to me.  The Timestamp2.vi is how I did that below.  I'm also including a little test file.  So, to run Timestamp2.vi, you will have to input the right base path, and have the Read Spreadsheet File (string).vi in the same place as Timestamp2.  Hope that helps.  I think I'm finally getting this stuff, so let me know if it doesn't work.
    Attachments:
    Test.txt ‏1 KB
    Timestamp2.vi ‏28 KB
    Read From Spreadsheet File (String).vi ‏25 KB

  • Execute BAPI for different input values and dispaly data in a table

    Hi all,
    I have a specific problem about executing BAPI multiple times for different input values and didplay result in a table.
    I am using the code similar to the following logic.
    Bapi_Mydata_Input in = new Bapi_Mydata_Input();
    wdContext.nodeBapi_Mydata_Input().bind(in);
    String in = wdContext.currentperdataElement.getnumber();
    in.setDestination_From(10)
    wdThis.wdGetMydataComponentController().executeBapi_Mydata_Input();
    in.setDestination_From(20)
    wdThis.wdGetMydataComponentController().executeBapi_Mydata_Input();
    in.setDestination_From(30)
    wdThis.wdGetMydataComponentController().executeBapi_Mydata_Input();
    And I want to display the data in a single table. I want the result in a table for Bapi execution based on input parameters passed 10,20 30.
    But I am getting the table data only for the input parameter 30.I mean its actually display the data in table only for the last input parameter.
    So May I ask you all if you know the solution for this problem.PLease advise me with some tips .or sample code is very much appreciated.I promise to award points to the right answer/nice advises.
    Regards
    Maruti
    Thank you in advance.

    Maruti,
    It seems that WDCopyService replaces content of node, rather then adds to content.
    Try this:
    Bapi_Persdata_Getdetailedlist_Input frelan_in = new Bapi_Persdata_Getdetailedlist_Input();
    wdContext.nodeBapi_Persdata_Getdetailedlist_Input().bind(frelan_in);
    final Collection personalData = new ArrayList();
    String fr1 = wdContext.currentE_Lfa1Element().getZzpernr1();
    frelan_in.setEmployeenumber(fr1);
    wdThis.wdGetFreLanReEngCompController().executeBapi_Persdata_Getdetailedlist_Input();
    WDCopyService.copyElements(wdContext.nodePersonaldata(), wdContext.nodeNewPersonaldata());
    for (int i = 0, c = wdContext.nodePersonaldata().size(); i < c; i++)
      personalData.add( wdContext.nodePersonaldata().getElementAt(i).model() );
    String fr2=wdContext.currentE_Lfa1Element().getZzpernr2();
    frelan_in.setEmployeenumber(fr2);
    wdThis.wdGetFreLanReEngCompController().executeBapi_Persdata_Getdetailedlist_Input();
    WDCopyService.copyElements(wdContext.nodePersonaldata(), wdContext.nodeNewPersonaldata());
    for (int i = 0, c = wdContext.nodePersonaldata().size(); i < c; i++)
      personalData.add( wdContext.nodePersonaldata().getElementAt(i).model() );
    wdContext.nodeNewPersonalData().bind( personalData );
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Need help regarding complex calculation using Max value and limiting data after Max date in MDX

    I am working on a bit complex calculated measure in SSAS cube script mode.
    Scenario /Data Set
    Date
    A
    B
    C
    A+B
    5/29/2014
    Null
    34
    Null
    34
    6/30/2014
    Null
    23
    45
    68
    7/15/2014
    25
    -25
    Null
    0
    8/20/2014
    -34
    Null
    Null
    -34
    9/30/2014
    25
    Null
    60
    25
    10/15/2014
    45
    -45
    Null
    0
    11/20/2014
    7
    8
    Null
    15
    a) Need to capture latest non-null value of Column C based on date
    with above example it should be 60 as of 9/30/2014
    b) Need to capture column A+B for all dates.
    c) Add values from column (A+B) only after latest date which is after 9/30/2014. 
    with above example it's last 2 rows and sum is 15
    d) Finally add value from step a and step c. which means the calc measure value should be = 75
    I need to perform all this logic in MDX. I was able to successfully get step a and b in separate calc measure, however i am not sure how to limit the scope based on certain date criteria. In this case it's, date> Max date(9/30/2014) . Also how should
    i add calculated members and regular members?
    I was able to get max value of C based on date and max date to limit the scope.
    CREATE MEMBER CURRENTCUBE.[Measures].[LatestC] AS
    TAIL( 
      NONEMPTY(
        [Date].[Date].CHILDREN*[Measures].[C]),1).ITEM(0) ,visible=1;
    CREATE MEMBER CURRENTCUBE.[Measures].[MaxDateofC] AS
    TAIL( 
      NONEMPTY(
        [Date].[Date].CHILDREN,[Measures].[C]),1).ITEM(0).MemberValue ,visible=1;
    Please help with Scope statement to limit the aggregation of A+B for dates > MaxDateofC? Also further how to add this aggregation value to LatestC calc measure?
    Thank You

    Hi Peddi,
    I gave TRUNC to both of the dates. But still the same issue. I think the problem is in returning the BolbDomain.
    return blobDomain;
    } catch (XDOException xdoe) {
    System.out.println("Exception in XDO :");
    throw new OAException("Exception in XDO : "+xdoe.getMessage());
    catch (SQLException sqle) {
    System.out.println("Exception in SQL :");
    throw new OAException("SQL Exception : "+sqle.getMessage());
    catch (OAException e) {
    System.out.println("Exception in OA :");
    throw new OAException("Unexpected Error :: " +e.getMessage());
    Thanks and Regards,
    Myvizhi

  • Question about iphone apps and saved data.

    So let's say I'm playing a game from the app store on my iphone and I beat it. Now I want to buy a new game but I don't have enough space to keep them both on my phone. So I delete the old one from my phone knowing it will still be on my mac. Then I play the new game and beat it and I start wanting to play that old game again. So I put the old one back on my phone and I lost everything I did before. Why? Is there a way I can take an app off my iphone without losing all the saved data?

    Here's how it works (from page 179 of the iPhone iOS4 User Guide).  You can delete apps you install from the App Store. If you delete an app, data associated with the app is no longer available to iPhone, unless you reinstall the app and restore its data from a backup.
    You can reinstall an app and restore its data as long as you backed up iPhone with iTunes on your computer. (If you try to delete an app that hasn’t been backed up to your computer, an alert appears.) To retrieve the app data, you must restore iPhone from a backup containing the data.
    To restore from a backup, see page 257 of the iPhone iOS4 User Guide

  • I want to read system registry and installation date of that

    Hi All,
    I want to read a registry of one product and the date of installation of that registry.
    please can any one answer.

    Hi-
    The limitation of OS would be because of the processor speed- need a minimum of 867mhz to run Leopard.
    If you were to upgrade to a 1.2ghz, or better, the OWC 1.5ghz processor, you would realize speed that would be worth the upgrade. This would also help you run more current software, and of course, Leopard.
    The two processors that I think have the best performance vs. cost, are the OWC 1.5ghz 7455 based processor, and the Newertech 2.0ghz 7448 based processor. Both will run the more current softwares, run Leopard, improve graphics intensive work, and really increase performance over the OEM processors.
    Of course, all other processor upgrades will increase performance, I just feel that these two offer the most "bang per buck".
    FYI, the 1.5ghz (runs 1.47ghz in the DA) gets Xbench scores of 60-65(avg.). This is in comparison to the dual 533mhz DA which scores 30-35(avg.) That is a healthy boost, pretty much double, and moves the DA into the realm of dual 1.25ghz MDD scores.
    BTW, the 1.2ghz bumps Xbench scores to 45-50.
    And yes, thanks for the stars!

  • Promblem about inheritance and saving data

    I have Product class (super class) and Kitchen class (sub class). When I want to create a Kitchen object and write it to a *.txt file. However the error occurs: "java.lang.NullPointerException". What is going wrong? Please help. Thanks
    Product class
    public Product(int aProductID, String aProductName, String aOriginalCountry,
                        double aWeight, double aPrice, String aProductCategory,
                        String aInputDate, String aExpiryDate, double aVatPrice,
                        String aManufacturerName, String aManufacturerAddress,
                        String aWarranty)
        productID = aProductID;
        productName = aProductName;
        originalCountry = aOriginalCountry;
        weight = aWeight;
        price = aPrice;
        productCategory = aProductCategory;
        inputDate = aInputDate;
        expiryDate = aExpiryDate;
        vatPrice = aVatPrice;
        manufacturerName = aManufacturerName;
        manufacturerAddress = aManufacturerAddress;
        warranty = aWarranty;
      }Kitchen class
    public Kitchen(int aProductID, String aProductName, String aOriginalCountry,
                         double aWeight,
                         double aPrice, String aProductCategory,
                         String aInputDate, String aExpiryDate, double aVatPrice,
                         String aManufacturerName, String aManufacturerAddress,
                         String aWarranty)
       super(aProductID, aProductName, aOriginalCountry, aWeight, aPrice,
               aProductCategory, aInputDate, aExpiryDate, aVatPrice,
             aManufacturerName, aManufacturerAddress, aWarranty);
    }The method that write the method to text file
    public void writeInfo()
        try{
          PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter
          ("C:\\Documents and Settings\\Charles\\My Documents\\Kitchen.txt", true)));
          out.println();
          out.write(Integer.toString(productID));
          out.write("  ");
          out.write(productName);
          // More data to write...
          out.flush();
          out.close();
         catch(IOException ex)
            ex.printStackTrace();
    }

    This is the Product Class
    package supermarket;
    import java.io.*;
    import javax.swing.*;
    public class Product {
      // Declare variables
      protected int productID;
      protected String productName;
      protected String originalCountry;
      protected double weight;
      protected double price;
      protected String productCategory;
      protected String inputDate;
      protected String expiryDate;
      protected double vatPrice;
      protected String manufacturerName;
      protected String manufacturerAddress;
      protected String warranty;
      protected double originalPrice;
      protected double calculatedVATPrice;
      public Product() {
        productID = 0;
        productName = "";
        originalCountry = "";
        weight = 0.0;
        price = 0.0;
        vatPrice = 0.0;
        manufacturerName = "";
        manufacturerAddress = "";
        warranty = "YES";
      public Product(int aProductID, String aProductName, String aOriginalCountry,
                           double aWeight, double aPrice, String aProductCategory,
                           String aInputDate, String aExpiryDate, double aVatPrice,
                           String aManufacturerName, String aManufacturerAddress,
                           String aWarranty)
        productID = aProductID;
        productName = aProductName;
        originalCountry = aOriginalCountry;
        weight = aWeight;
        price = aPrice;
        productCategory = aProductCategory;
        inputDate = aInputDate;
        expiryDate = aExpiryDate;
        vatPrice = aVatPrice;
        manufacturerName = aManufacturerName;
        manufacturerAddress = aManufacturerAddress;
        warranty = aWarranty;
      public void writeInfo()
        try{
        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter
        ("C:\\Documents and Settings\\Charles\\My Documents\\testing.txt", true)));
        out.println();
        out.write(Integer.toString(productID));
        out.write("  ");
        out.write(productName);
        out.write("  ");
        out.write(originalCountry);
        out.write("  ");
       // and more data to save...
        out.flush();
        out.close();
        catch(IOException ex)
         ex.printStackTrace();
    public void displayInfo(JLabel D1)
        try
          BufferedReader in = new BufferedReader(new FileReader
          ("C:\\Documents and Settings\\Charles\\My Documents\\testing.txt"));
          String fromAll = in.readLine();
          D1.setText(fromAll);
        catch(IOException ex)
        ex.printStackTrace();
    }This is the Kitchen class
    package supermarket;
    import supermarket.Product;
    import java.io.*;
    import javax.swing.*;
    public class Kitchen extends Product{
          private int productID;
          private String productName;
          private String originalCountry;
          private double weight;
          private double price;
          private String productCategory;
          private String inputDate;
          private String expiryDate;
          private double vatPrice;
          private String manufacturerName;
          private String manufacturerAddress;
          private String warranty;
          private double originalPrice;
          private double calculatedVATPrice;
         public Kitchen() {
         super();
      // The constructor is not working......
      public Kitchen(int aProductID, String aProductName, String aOriginalCountry,
                          double aWeight, double aPrice, String aProductCategory,
                         String aInputDate, String aExpiryDate, double aVatPrice,
                         String aManufacturerName, String aManufacturerAddress, String aWarranty)
       super(aProductID, aProductName, aOriginalCountry, aWeight, aPrice,
                aProductCategory, aInputDate, aExpiryDate, aVatPrice,
                aManufacturerName, aManufacturerAddress, aWarranty);
    public void writeInfo()
        try{
          PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter
         ("C:\\Documents and Settings\\Charles\\My Documents\\Kitchen.txt", true)));
          out.println();
          out.write(Integer.toString(productID));
          out.write("  ");
          out.write(productName);
          out.write("  ");
          out.write(originalCountry);
          // and more data to save...
          out.flush();
          out.close();
    catch(IOException ex)
      ex.printStackTrace();
    public void displayInfo(JLabel E1)
       try
         BufferedReader in = new BufferedReader(new FileReader
        ("C:\\Documents and Settings\\Charles\\My Documents\\Kitchen.txt"));
         String fromAll = in.readLine();
         E1.setText(fromAll);
       catch(IOException ex)
         ex.printStackTrace();
    }Is this look better? Please help. Thanks

  • Measuremen​t, visualizat​ion and saving data in parallel: Performanc​e question

    Hello,
    I have written an application with 3 loops running in parallel.
    The first loop does only measure and analyze measurement values from a DAQmx device (3 analog input signals from 3 sensors with 1000 Hz).
    The second loop does only do the visualization with a graph per sensor continously. The data will be sent from the first loop through a queue.
    The third loop only saves the data to a file after a measurement has finished. The data will be sent at the end of a measurement from the first loop, too.
    There are 3 measurements running asynchronous.
    That means it could be that only one sensor will be read, but it also could be that 3 sensors will be read. The duration of each measurement phase and the beginning/end is asynchronous.
    Now I have the following problem:
    Measurement 1 starts
    A short time later measurement 2 starts
    Measurement 2 will end, the measurement values will be saved into a binary file
    Measurement 1 is still running but the visualization of measurement 1 stops for about 1 second during the saving process. After the data is saved, the visualization runs normally again (no data is lost because of the queue).
    Why does tha graph stop its visualization during the saving process (I have a dual core cpu)?
    How can I do this in a way, the user does not see any lags?
    It all works fine but the "interrups" look very unprofessional.
    Regards
    Matthias

    Hello,
    I'm using the producer/consumer pattern.
    Maybe it could be, that the dll calls I'm using for saving will interrupt the whole program: http://lavag.org/files/file/212-sqlite-labview/
    When I use the LabVIEW File-I/O vis all is fine. But when I use these database vis my application will lag.
    Any ideas why this is so? Could it be that the dll calls freeze the application during the saving process (LabVIEW 2011)?
    Here are thze dll settings:
    Attachments:
    dll_settings.PNG ‏50 KB

  • Reading grayscale values from saved image

    Hi,
    I've written several methods that crop, convert to grayscale, histogram equalise and then resize a colour jpeg image for preparing sets of images for a face detection neural network. The next thing I want to do is to write a method that allows me to read that saved grayscale images pixel values back as singular grayscale values from the RGB values that were used to save the jpeg. I used this code to create the 2D array of grayscale pixel values
          for (int i = 0; i < imageWidth; i++)
                for (int j=0; j <imageHeight; j++)
                    grayRGB[i][j] = (rgb[i][j] & 0xff000000) | (eqGray[i][j]<<16) | (eqGray[i][j]<<8) | (eqGray[i][j]);
                    img.setRGB(i, j, grayRGB[i][j]);
                }and then used this code to resize the image:
            BufferedImage resized = new BufferedImage(20,20,1);
            Graphics2D g = resized.createGraphics();
            g.drawImage(img, 0, 0, 20, 20, null);
            g.dispose();my class gets the RGB values on instantiation as follows:
            //get RGB pixel values for image loaded
            for (int i = 0; i < imageWidth; i++)
                for (int j=0; j <imageHeight; j++)
                    rgb[i][j]= inputImage.getRGB(i,j);
                    //perform bitwise shift rgb information values to obtain appropriate values for each colour pixel
                    r[i][j]=  (rgb[i][j] >> 16) &0xff;
                    g[i][j]=  (rgb[i][j] >> 8) &0xff;
                    b[i][j]=  (rgb[i][j]) &0xff;
                }Is there a way to get the grayscale values directly from an image that is already converted to grayscale without having to perform the grayscale conversion method again, perhaps using a similar bitwise shift?
    Thanks
    Nick

    answering this myself for those lost souls like i was a while ago:
    the answer is very simple when you get to know it :) : use a signed type for your image. this can be achieved by using the Format Operator (javax.media.jai.operator.FormatDescriptor). an example as follows :
            BufferedImage bufferedImage= someimage...
            ParameterBlock pb = new ParameterBlock();
            pb.addSource(bufferedImage);
            pb.add(DataBuffer.TYPE_SHORT);
            RenderedImage formattedImage =
                    JAI.create("format", pb, null);
    // you may use as well TYPE_DOUBLE or TYPE_FLOATimage could be of any type such as PlanarImage, BufferedImage, RenderedImage etc..
    then all you need to do is read your pixel values by using an iterator such as RectIter or RandomIter to access pixel values etc..
    San

  • Producing a line graph of int values and saving as an image

    Hi,
    I wonder if anyone could help me with this. I have 2 arrays of integer values that I would like to plot as a line graph (e.g. X[ ] and Y [ ]) and then have this line graph saved as an image (the format isn't too important but PNG would be preferred).
    Could somone point me in the right direction of an easy way to do this?
    Thanks,
    Pete

    Have a look at the following classes :
    java.awt.Graphics (drawLine method)
    java.awt.Image
    java.awt.BufferedImage
    javax.imageio.ImageIO (jdk 1.4+)

Maybe you are looking for