How to write and read data in a specific memory location ??

Hi Everyone:
Does anyone know how to write and read data in a specific memory location by using Java ?
I need pointers, but I don't know how to do it ??
Thanks for answering
Rodger

Hi Everyone:
Does anyone know how to write and read data in a
specific memory location by using Java ?
I need pointers, but I don't know how to do it ??
Thanks for answering
RodgerWith Java you cannot write to a specific memory location. Java does not have pointers. If you really want to do it, you need to use JNI, i.e write the required functions in C (or other languages that support pointers) and make those functions available to Java (through JNI). This approach is not portable. You can have a look at http://java.sun.com/docs/books/tutorial/native1.1/index.html
Regards.

Similar Messages

  • How to write and read array on ObjectOutputStream............??

    Hello All...........,
    I have done some code for applet and servlet communication in which i writes "String " as an object and gets reply from servlet as a string as follows:
               // send data to the servlet
                            String input="hello there.....";
                   URLConnection con = getServletConnection();
                   OutputStream outstream = con.getOutputStream();
                   ObjectOutputStream oos = new ObjectOutputStream(outstream);
                   oos.writeObject(input);
                   oos.flush();
                   oos.close();
                   // receive result from servlet
                   InputStream instr = con.getInputStream();
                   ObjectInputStream inputFromServlet = new ObjectInputStream(instr);
                   String result =(String) inputFromServlet.readObject();
                             outputField.setText(result);
                           //outputField.setText("good morning");
                   inputFromServlet.close();
                   instr.close();This code is same at servlet end.
    But now i want to pass an int array.How to pass int[] as an object.
    It is giving me error if i pass int array as int array[]={1,2,3}; oos.writeObject(array); Why is it so?
    Can anybody tell me how to write and read int array[].
    Thanks.
    Shraddha.

    hello kaj,
    I am trying to write as follows
    while writting:
    int array[]={1,2,3,4,5};
    URLConnection con = getServletConnection();
    OutputStream outstream = con.getOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(outstream);
    oos.writeObject(array);
    oos.flush();
    oos.close();
    while reading:
    InputStream instr = con.getInputStream();
    ObjectInputStream inputFromServlet = new ObjectInputStream(instr);
    int result[] =(int []) inputFromServlet.readObject();
    Thanks,
    Really imp for me.

  • How to write and read Japanese on my Nokia E5

    I am trying to find out how I can write and read Japanese on my Nokia E5.
    I even don't knwo if it's possible...
    Does anyone have the answer???

    Hello ikokitakun,
    I believe you have to load a version of software on your phone that has the Japanese language pack in it because the version of software on the phone only has the languages for the region that you bought the phone in. for example if i bought my phone in NZ it would have English, Malaysian and maybe Philippino. There are "dodgey" places you can go to get the software changed but if you do this you void your warranty so be careful. Nokia doesn't condone the changing of regional software.
    Hope this helps
    -Cheers
    "Freedom is the only way, yeah!"

  • How to acquire and read data before trigger?

    Hi, all:  
             I want to acquire a impluse signal, and the data when the signal begins is very important to me. So, I want to using a digStart trigger to acquire it, but then i'll lose what i want, maybe i can acquire it continuously, and use the trigger to start read the buffer after a delay(in order to wait the signal end), i don't know if there is any ANSI C functions I can use to do it in this way. I am using PCI6220, DAQmx9.02 and ANSI C.   If anyone have some info on this please let me know. thinks.

    Hi Cris Brown:
                   From your application,I suggest that you can use DAQmxCfgDigEdgeRefTrig function; define  pretrigger samples fitting for your application.
    Try it. Best Regard!

  • How to write and read Xml file from database if possible?

    Hi all,
    I need to read the .Xml file when receives from Source systems and write the data into the table as well as write in the.xml file thru reading the data from table as per the client needs. I am stranger to this area. Since, please provide some examples how to approach the same.
    Thanks in advance !!
    Regards.
    Vissu.....

    The XML DB forum is better suited to your question.
    It also has a FAQ which details how to read and shred XML into tables as well as other common XML based questions...
    XML DB FAQ

  • How to open and read data from text file in PL/SQL

    We have a project ,need to open a file containing entries of data
    ,then process those data records one by one to update the
    database.This operation shoulbe be done in the database
    enviroment. Is there any hint about the file operation in
    PL/SQL? How to open the file and get one record ,maybe one line,
    and parse and get the data field ?
    thanks
    defang

    There was also a question on this over at AskTom
    (asktom.oracle.com) about a week ago complete with sample code.
    The pointer to the sample code is here:
    <A HREF="http://asktom.oracle.com/pls/ask/f?
    p=4950:8:::::F4950_P8_DISPLAYID:464420312302
    TARGET=_blank>http://asktom.oracle.com/pls/ask/f?
    p=4950:8:::::F4950_P8_DISPLAYID:464420312302</A>
    Admittedly it's about Win95, but the principles should apply.
    Yours faithfully, Graham Reeds.
    [email protected] | http://omnieng.co.uk/

  • HOW TO WRITE AND READ FROM A TEXT FILE???

    How can I read from a text file and then display the contents in a JTextArea??????
    Also how can I write the contents of a JTextArea to a text file.
    Extra Question::::::: Is it possible to write records to a text file. If you have not idea what I am talking about then ignore it.
    Manny thanks,
    your help is much appreciated though you don't know it!

    Do 3 things.
    -- Look through the API at the java.io package.
    -- Search previous posts for "read write from text file"
    -- Search java.sun.com for information on the java.io package.
    That should clear just about everything up. If you have more specific problems, feel free to come back and post them.

  • How can i write and read the same data

    hi,
             i have attached my program to this mail. i have some problems in this program.
    problems:
    1. I want to select the threshold for the rms,varience and s.d.
    But what i used is not doing that. i want to fix the upper threshold value and lower threshold value.
     when ever the input crosses upper threshold value i want the output and it will remains uptill the value above the lower threshold value.
    Once it come down the lower threshold value the output should be stopped.
    2. I want to write this in to a  file and i want to read this file. is this possible or not. 
                please try to help me i am very new with lab view6i
           REGARDS
    CHAMARTHY KOMAL DILEEP.
       [email protected]
    Attachments:
    dileep.vi ‏93 KB

    The easiest way to perform a certain action (such as file I/O) based on a certain condition (such as whether a value has passed a certain threshold) is to use a comparison VI in combination with a case structure. Then you can specify that if your rms, standard deviation and variance are above a threshold then perform a certain action.
    Also consider using shift registers to keep track of data from the last loop. If I understand you correctly, you want to start logging data when an upper threshold has been passed. Then you want to continue logging data until a lower threshold is passed. I have attached a non-functional but explanatory VI that will help explain how to implement logic to that effect. It also demonstrates that you can indeed write and read from the same file in a loop. The best way to do this is to open the file before the loop, do all the necessary writing and reading in the loop, and then close the file after the loop.
    Hope this helps!
    Jarrod S.
    National Instruments
    Attachments:
    dileep_example.vi ‏61 KB

  • DAQ vi to perform digital write and read measurements using 32 bits binary data saved in a file

    Hi
    DAQ vi to perform digital write and read measurements using 32 bits binary data saved in a file
    Two main
    sections:
    1)     
    Perform
    write and read operations to and fro different spread sheet files, such that
    each file have a single row of 32bits different binary data (analogous to 1D
    array) where the left most bit is the MSB. I don’t want to manually enter the
    32 bits binary data, I want the data written or read just by opening a file
    name saves with the intended data.
          2)     
    And
    by using test patterns implemented using the digital pattern generator or  build digital data functions or otherwise, I need to
    ensure that the     
                binary data written to a spreadsheet file or any supported file type
    then through the NI-USB 6509 is same as the data read.
    I’m aware I can’t use the simulated
    device to read data written to any port but if the write part of the vi works I
    ‘m sure the read part will work on the physical device which I’ll buy later.
    My Plan
    of action
    I’ve
    created a basic write/read file task and a write/read DAQ task for NI USB 6509
    and both combine in a while loop to form a progress VI which I’m confuse of how
    to proceed with the implementation.
    My
    greatest problem is to link both together with the correct functions or operators
    such that there are no syntax/execution errors and thus achieve my intended
    result.
    This
    project is one of my many assignments for my master thesis, so please i’ll
    appreciate every help as I’m not really efficient with LabVIEW programming but
    I prefer it because is fun and interesting if I get to know it.
    Currently I’m
    practicing with LabVIEW 8.6/NI DAQmx 8.8 Demo versions and NI USB 6509
    simulated device.
    Please see
    the attached file for my novice progress, thanks in
    advance for the support
    Rgds
    Paul
    Attachments:
    DIO_write_read DAQ from file.vi ‏17 KB

    What does your file look like?  The DAQmx write is expecting a single U32 value, not an array of I64. 
    Message Edited by vt92 on 09-16-2009 02:42 PM
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal

  • How to combine both DAQ AI signal, write and read file in single VI

    Hi
     I am the new user of LabVIEW version 7.1 for testing automation application. I have to measure 33 signals ( mostly analog like temp, pressure, etc...) from NI USB 6210 DAQ system and write in master file for future verfication.From real data or from master file back up have to write  one more file if only the signal reaches steady state , which will used for analysis and same signals to be read from this file parallely & make a waveform and/or table display format.
    Pl. help me to shortout this problem 
    note: I have plan to ugrade labVIEW version 2011 shortly, so let me know doing parrel acquistion write and read file for data analysis in same VI in version 7.1...... 

    Parallel operations in LabVIEW are very simple.  Just code it in parallel and it will work.
    Try taking a look at some of the examples in the NI Example Finder (Help > Find Examples).  There you will find example for writing to and reading from files, as well as data acquistion in parallel with other operations.
    You might need a producer/consumer architecture is you are acquiring data very quickly.
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • What is the best software programs that I can use to read, write and modify data / files on external HD (NTFS format i.e.  Windows) ?

    Hi guys,
    I’m new to Mac and have a MacBook Pro Lion OS (10.6.8 I think !!!) with Parallels 7 (Windows 7) installed. Can someone please tell me what is the best software program that I can use to read, write and modify data / files on external HD (NTFS format) from the Mac OS ? I heard of Paragon and Tuxera NTFS. Are they free ? Are they good ? Are there any other software programs out there ? I heard that some people have issues with Paragon.
    Thanks.

    Your best bet would be to take the drive to the oldest/compatible with that drive Windows PC and grab the files off, right click and format it exFAT (XP users can download exFAT from Microsoft) and then put the files back on.
    Mac's can read and write all Windows files formats except write to NTFS (and in some cases not read) so if you can change the format of the drive to exFAT (all data has to be remove first) then you will have a drive that doesn't require paid third party NTFS software (a license fee goes to Microsoft) for updates.
    Also it's one less hassle to deal with too.
    .Drives, partitions, formatting w/Mac's + PC's

  • Options for having cFP write and read file

    I have a cFP VI that runs on a cFP 2110 controller for doing process automation on a custom piece of equipment.  It seems that each month we use the same equipment for a slightly different automated process routine.  What I have done in the past is to make a copy of my VI's and real-time project and then make the changes in the code for the new process.  Most of the changes to the code between processes are just changes to numeric controllers to change ramp and slope times or the number of times the code repeats a set of steps.  I have been playing around with writing a sort of configurations page to my VI to allow the user to change some numeric controls, save them to a file using the Read Key.VI and Write Key.VI.  In the simple tests I have done, this works If I have a target VI on the cFP 2110 and a host VI where I can have the configurations page and save the file to my computer's hard drive. 
    The configurations file I would create would probably have 15-30 numeric controls and maybe some string commands.  I have a couple of questions about doing this.  Do I need to go back and create both Target and Host VI and communicate between the two using shared variables, or can I just keep my current VI and write a subVI that would save my files to the cFP controller?  If I save the files to the cFP controller, can user set the numeric controller and save the file and/or  likewise call-up any of say one of say 10 differnet files to populate the various sub-VI and run? 
    Finally, provided that I can write and read these small configuration numeric controller files to the controller, is there any advantage to writing the files to one method or the other: writing to the controller vs, creating a target and host VI to load the data?
    Thank you for the help. 
    Danny
    Attachments:
    Test read write key.vi ‏58 KB

    StepanieO,
    I finally had a change to play around with the cFP file write and read again.  I was able to write a the cFP and read the file back using write to spreadsheet and read from spreadsheet.  The one problem I can't seem to figure out is how you browse the cFP to select a file.  If I enter the file name and path into the string command it works.  But If I try to browse the cFP, the browse button only shows the computer hard drives.  Is there a way to browse the cFP controller for a specific file?
    Thank you for the help.
    Danny
    Danny
    Attachments:
    Write to spreadsheet.vi ‏18 KB

  • Uploading Excel File and Reading Data from that File

    <b>Hi
    Can anyone Please tell me how to upload an Excel File in to the Web Dynpro Application and After that i want to read the data from that uploaded excel file in the Web Dynpro Application to the Web Dynpro table.
    Plz help me to solve this.......
    Regards
    Chandran</b>

    Hi,
    Upload Excel file using File Upload UI
    1)Add jxl jar folder in the lib folder of ur project.
    2)Go to properties of ur project and add jar to ur project.
    3)Using the File upload ui ,browse and upload the file.
    4)Write the read file in to ur server location using fileoutput stream.
    5)then using code u can read the excelfile from the server location itself.
    Here is the code:
         IWDAttributeInfo attInfo =wdContext.getNodeInfo().getAttribute("upload");
    /** get the name of excel file and storing it in the server with the same name and extention****/
    binaryType=IWDModifiableBinaryTypeattInfo.getModifiableSimpleType();
    fileuploaded = binaryType.getFileName();
    byte b[] = wdContext.currentContextElement().getUpload();
    File filename =new File("
    <Server name>
    <folde name>
    " + fileuploaded);
    try {
    FileOutputStream out = new FileOutputStream(filename);
    out.write(b);
    out.close();
    } catch (FileNotFoundException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    /**Readind from the server**/
    int iRows = 0;
    try {     Workbook wb = null;
         Sheet sheet = null;
         wb = Workbook.getWorkbook(filename);
         sheet = wb.getSheet(0);
         int iColumns = sheet.getColumns();
          iRows = sheet.getRows();
         int i = 0;
        //get Cell contents by (COLUMN, ROW);
        for (int r = 0; r < iRows; r++) {
       for (int c = 0; c < iColumns; c++) {
         Cell cell = sheet.getCell(c, r);
         characterarray<i> = cell.getContents();
    //wdComponentAPI.getMessageManager().reportSuccess("Row"r characterarray<i>);
    i++;
    wb.close();
    Declare Globally
    //@@begin others
    String fileuploaded;
    IWDModifiableBinaryType binaryType;
    String characterarray[] = new String[1000];
    //@@end
    Also look at this blog too  /people/perumal.kanthan/blog/2005/03/21/reading-excel-data-from-java-using-hssf-api
    Thanks and Regards,
    Arun

  • Closing a serial port after executing a for loop of write and reads.

    Hello,
    Labview is opening and then closing each write to the port. I have tried to leave the close outside of the for loop, but labview wont allow it. What do I need to change to make all the writes and reads execute on 1 open and close of the serial port.?
    Thanks.
    Attachments:
    Controller.vi ‏27 KB

    J_es--
         The program that you posted looks to be ok for the most part, you might consider putting an open after your configure (but that's trivial). The other thing that is a minor issue is the loop tunnel coming out of your for loop is currently being auto-indexed.  This function is used to index data for each interation of the loop.  You are using a static address (not an array) and so you don't need this.  If you right-click and remove the auto-index the broken wire will go away. Other than that it should be ok.
         I would suggest looking at one of the shipping examples that come with LabVIEW.  "Basic Serial Read and Write" is essentially the same thing that you are doing and is tested here and might save you a bit of time.  Anyway, take a look if you have a second. Best of luck with your application!
    John H.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • How to find and replace data in form fields in acrobat xi, its not allowing to do so while trying, a

    how to find and replace data in form fields in acrobat xi, its not allowing to do so while trying, asking for adobe livecycle to get installed. please help.

    Easiest way to do it is the following:
    - Open the PDF file in Acrobat.
    - Go to Tools - Forms - More Form Options - Export Data.
    - Save the form data as an XML file somewhere on your system.
    - Open XML the file in a plain-text editor (I recommend Notepad++).
    - Let's say you want to replace all the years in the dates from "2013" to "2014". Do a global Search&Replace of "2013-" to "2014-" (I added the dash just to make sure that only date fields are edited).
    - Save the XML file (maybe under a new name).
    - Go back to the PDF file, and now go to Tools - Forms - More Form Options - Import Data.
    - Select the edited XML file and import it.
    - Done!

Maybe you are looking for