I am trying to write multiple lines high

I have LV 5.0, PCDIO-24 card & WinME
I am trying to write multiple lines high, but when I write one high
the others reset. I read about the 8255 chip problem & found an
example vi on NI's website that maybe a work-around, but it won't run
with 5.0. I am somewhat new to Labview and request help! How can I
open "Write to Multiple Digital Lines.vi" with 5.0,
or does someone have an similar example vi?
My vi has 3 different delay timers that try to write data high when
they countdown to zero. They work fine one at a time but not when I
put them into a single vi and run them all at once.
Thanks,
MikeB

Dennis Knutson wrote in message news:<[email protected]>...
> I think your problem is that you're using something like Write to
> Digital Port.vi which writes to all lines. Use the lower level
> function DIO Port Write.vi and set the line mask. The line mask is
> used to determine which lines to write to and which lines to leave
> alone. For example, if at one point you just want to write to bits
> 5,6,7, set the line mask to 1110000 (assuming 8 bit port). If at
> another point, you just want to write to bits 0,1,2, you would set the
> line mask to 00000111.
When I try to set the line mask of "DIO Port Write.vi", it won't allow
me to have a 0 as the first digit. If I enter 00001111 for example,
the zeros dis
sappear as soon as I click the check-box. (the line mask
box will reset to 1111). What am I doing wrong?
Thanks for the help!
MikeB

Similar Messages

  • RandomAccessFile: How do I Clear the txt file and write multiple lines of..

    Hello all,
    I am a 6th grade teacher and am taking a not so "Advanced Java Programming" class. Could someone please help me with the following problem.
    I am having trouble with RandomAccessFile.
    What I want to do is:
    1. Write multiple lines of text to a file
    2. Be able to delete previous entries in the file
    3. It would also be nice to be able to go to a certian line of text but not manditory.
    import java.io.*;
    public class Logger
    RandomAccessFile raf;
    public Logger()
         try
              raf=new RandomAccessFile("default.txt","rw");
              raf.seek(0);
              raf.writeBytes("");
         catch(Exception e)
              e.printStackTrace();
    public Logger(String fileName)
         try
              raf=new RandomAccessFile(fileName,"rw");
              raf.seek(0);
              raf.writeBytes("");
         catch(Exception e)
              e.printStackTrace();
    public void writeLine(String line)
         try
              long index=0;
              raf.seek(raf.length());          
              raf.writeBytes(index+" "+line);
         catch(Exception e)
              e.printStackTrace();
    public void closeFile()
         try
              raf.close();
         catch(Exception e)
              e.printStackTrace();
         }

    Enjoy! The length of the code is highly attributable to the test harness/shell thingy at the end. But anyway seems to work nicely.
    import java.io.*;
    /** File structure is as follows. 1st four bytes (int) with number of live records. Followed by records.
    <p>Records are structured as follows<ul>
    <li>Alive or dead - int
    <li>Length of data - int
    <li>Data
    </ul>*/
    public class SequentialAccessStringFile{
      private static int ALIVE = 1;
      private static int DEAD = 0;
      private int numRecords, currentRecord;
      private RandomAccessFile raf;
      /** Creates a SequentialAccessStringFile from a previously created file. */
      public SequentialAccessStringFile(String filename)throws IOException{
        this(filename,false);
      /** Creates a SequentialAccessStringFile. If createnew is true then a new file is created or if it
          already exists the old one is blown away. You must call this constructor with true if you do
          not have an existing file. */
      public SequentialAccessStringFile(String filename, boolean createnew)throws IOException{
        this.raf = new RandomAccessFile(filename,"rw");
        if(createnew){
          truncate();
        this.currentRecord = 0;
        this.raf.seek(0);
        this.numRecords = raf.readInt();
      /** Truncates the file deleting all existing records. */
      public void truncate()throws IOException{
        this.numRecords = 0;
        this.currentRecord = 0;
        this.raf.setLength(0);
        this.raf.writeInt(this.numRecords);
      /** Adds the given String to the end of this file.*/
      public void addRecord(String toAdd)throws IOException{
        this.raf.seek(this.raf.length());//jump to end of file
        byte[] buff = toAdd.getBytes();// uses default encoding you may want to change this
        this.raf.writeInt(ALIVE);
        this.raf.writeInt(buff.length);
        this.raf.write(buff);
        numRecords++;
        this.raf.seek(0);
        this.raf.writeInt(this.numRecords);
        this.currentRecord = 0;   
      /** Returns the record at given index. Indexing starts at zero. */
      public String getRecord(int index)throws IOException{
        seekToRecord(index);
        int buffLength = this.raf.readInt();
        byte[] buff = new byte[buffLength];
        this.raf.readFully(buff);
        this.currentRecord++;
        return new String(buff); // again with the default charset
      /** Returns the number of records in this file. */
      public int recordCount(){
        return this.numRecords;
      /** Deletes the record at given index. This does not physically delete the file but simply marks the record as "dead" */
      public void deleteRecord(int index)throws IOException{
        seekToRecord(index);
        this.raf.seek(this.raf.getFilePointer()-4);
        this.raf.writeInt(DEAD);
        this.numRecords--;
        this.raf.seek(0);
        this.raf.writeInt(this.numRecords);
        this.currentRecord = 0;
      /** Removes dead space from file.*/
      public void optimizeFile()throws IOException{
        // excercise left for reader
      public void close()throws IOException{
        this.raf.close();
      /** Positions the file pointer just before the size attribute for the record we want to read*/
      private void seekToRecord(int index)throws IOException{
        if(index>=this.numRecords){
          throw new IOException("Record "+index+" out of range.");           
        if(index<this.currentRecord){
          this.raf.seek(4);
          currentRecord = 0;     
        int isAlive, toSkip;
        while(this.currentRecord<index){
          //skip a record
          isAlive = this.raf.readInt();
          toSkip = this.raf.readInt();
          this.raf.skipBytes(toSkip);
          if(isAlive==ALIVE){
               this.currentRecord++;
        // the next live record is the record we want
        isAlive = this.raf.readInt();
        while(isAlive==DEAD){
          toSkip = this.raf.readInt();
          this.raf.skipBytes(toSkip);
          isAlive = this.raf.readInt();     
      public static void main(String args[])throws Exception{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("Create a new file? y/n");
        System.out.println("(No assumes file exists)");
        System.out.print("> ");
        String command = br.readLine();
        SequentialAccessStringFile test = null;
        if(command.equalsIgnoreCase("y")){
          System.out.println("Name of file");
          System.out.print("> ");
          command = br.readLine();
          test = new SequentialAccessStringFile(command,true);     
        }else{
          System.out.println("Name of file");
          System.out.print("> ");
          command = br.readLine();
          test = new SequentialAccessStringFile(command);     
        System.out.println("File loaded. Type ? for help");
        boolean alive = true;
        while(alive){
          System.out.print("> ");
          command = br.readLine();
          boolean understood = false;
          String[] commandArgs = command.split("\\s");
          if(commandArgs.length<1){
               continue;
          if(commandArgs[0].equalsIgnoreCase("quit")){
               test.close();           
               alive = false;
               understood = true;           
          if(commandArgs[0].equalsIgnoreCase("list")){
               System.out.println("#\tValue");
               for(int i=0;i<test.recordCount();i++){
                 System.out.println(i+"\t"+test.getRecord(i));
               understood = true;
          if(commandArgs[0].equalsIgnoreCase("truncate")){
               test.truncate();
               understood = true;
               System.out.println("File truncated");
          if(commandArgs[0].equalsIgnoreCase("add")){
                test.addRecord(commandArgs[1]);
                understood = true;
                System.out.println("Record added");
          if(commandArgs[0].equalsIgnoreCase("delete")){
                int toDelete = Integer.parseInt(commandArgs[1]);
                if((toDelete<0)||(toDelete>=test.recordCount())){
                  System.out.println("Record "+toDelete+" does not exist");
                }else{
                  test.deleteRecord(toDelete);
                  System.out.println("Record deleted");
                understood = true;
          if(commandArgs[0].equals("?")){
               understood = true;
          if(!understood){
               System.out.println("'"+command+"' unrecognized");
               commandArgs[0] = "?";
          if(commandArgs[0].equals("?")){
               System.out.println("list - prints current file contents");
               System.out.println("add [data] - adds data to file");
               System.out.println("delete [record index] - deletes record from file");
               System.out.println("truncate - truncates file (deletes all record)");
               System.out.println("quit - quit this program");
               System.out.println("? - displays this help");
        System.out.println("Bye!");
    }Sample output with test program
    C:\>java SequentialAccessStringFile
    Create a new file? y/n
    (No assumes file exists)
    yName of file
    mystringsFile loaded. Type ? for help
    add appleRecord added
    add orangeRecord added
    add cherryRecord added
    add pineappleRecord added
    list#       Value
    0       apple
    1       orange
    2       cherry
    3       pineapple
    delete 5Record 5 does not exist
    delete 1Record deleted
    list#       Value
    0       apple
    1       cherry
    2       pineapple
    add kiwiRecord added
    list#       Value
    0       apple
    1       cherry
    2       pineapple
    3       kiwi
    quitBye

  • Trying to create multiple lines of radio buttons on the same page. how do i do that??

    Greetings. I'm brand new to this, and am trying to create a form with multiple lines of radio buttons on a single page to send to my students.  How can I do this??  I currently have a table that I want the students to fill out and return, but every time I put radio buttons in, the form only allows selection of one of the 12 - I want students to be able to select one on each row.........

    Each group of three radio buttons for a row should have the same field name and different "Radio Button Choice" (see Options tab). So if you copy & paste the first row, be sure to rename the new ly added radio buttons.

  • Error trying to use multiple lines from a PO in a Goods Receipt PO

    I get the following error when I try to add 2 lines from a PO to a single Goods Receipt PO (code below):
    -5002 One of the base documents has already been closed  [PDN1.BaseEntry][line: 1]
    I can create the Goods Receipt PO if I use 1 line or lines from multiple PO's???
                   SAPbobsCOM.Documents poReceipt2 = (SAPbobsCOM.Documents)_diApi.SboCompany.GetBusinessObject(BoObjectTypes.oPurchaseDeliveryNotes);
                   poReceipt2.CardCode = "ALL";
                   poReceipt2.DocDueDate = DateTime.Now;
                   poReceipt2.Lines.Quantity = 5;
                   poReceipt2.Lines.ItemCode = "HAMSHA";
                   poReceipt2.Lines.BaseEntry = 11;
                   poReceipt2.Lines.BaseLine = 0;
                   poReceipt2.Lines.BaseType = 22;
                   poReceipt2.Lines.Add();
                   poReceipt2.Lines.Quantity = 5;
                   poReceipt2.Lines.ItemCode = "LAMFIL";
                   poReceipt2.Lines.BaseEntry = 11;
                   poReceipt2.Lines.BaseLine = 1;
                   poReceipt2.Lines.BaseType = 22;
                   poReceipt2.Add();
    Any help is appreciated!
    Thanks,
    Daniel

    Hi Louis, thanks for the post...
    However the PO document that I am refercing definately has both lines open, if I use 1 of those lines it works fine, but the error occurs if I use 2 lines from the same PO.  I am also definately using the docentry not the docnum for the GetByKey() method.
    Can anyone run the same basic logic through the DI API?  That is create a PO with 2 lines on it, then run the code as above to make a Goods Receipt PO and reference the 2 lines from the 1 PO document?  (It works if I add multiple lines referncing lines from multiple PO docs??)
    Thanks,
    Dan
    Message was edited by: Daniel Archer

  • HELP - Trying to make multiple lines one single object

    I have tried everything and to no avail. I know it's due to my lack of experience w/ PS CS3. Any help you can offer and quickly, would be greatly appreciated!
    I've traced/drawn an ice machine with the line tool. There are about 20 individual lines that make the shape. All are in one layer. I want to group the lines so that I can make it one object so that I can move it all together. When I select all of the individual lines and then click Combine, some of my lines disappear.
    Please help.
    Thank you.

    Which option?

  • Write one line of numbers to a text-file or write multiple lines each iteration?

    Hi,
    I'm currently working on an application that has a few different while-loops running at the same time. One loop acquires the data (DAQloop), another shows the data (raw and processed data) on graphs (Graphsloop) and yet another stores the data in an open ascii text file (Storageloop).
    The data is passed on from the DAQloop to the Storageloop through a queue. At this moment I let the Storageloop take up the first element of the queue (the oldest) to store it in the textfile each iteration. I was wondering however whether it would be better to let the Storageloop take up all the elements currently available in the queue to store it in one go.
    Does anybody have any ideas on this? Which would be better performancewise? The textfile is already opened and is just passed on as a refnum.
    Thx!
    Giovanni Vleminckx
    Using LabVIEW 8.5 on Windows7
    Solved!
    Go to Solution.

    With the normal LabVIEW file primitives, you will get your best disk speed when you write about 65,000 bytes to disk at once (or read, for that matter).  When I write similar code, I include a string buffer in the write loop.  Every time I get write data, I add it to the string.  When the string hits 65,000 bytes, I write to disk.  You could break this into three loops, as well - a read, buffer, and write.  Depending upon you current chunk size, you could see over an order of magnitude change in disk write speed.  This write operation is often throttled by the conversion from binary to ASCII, not the disk I/O.  If you do this, be careful with your buffer.  You can get some serious slowdowns depending upon how you implement it.  This post has some details and examples.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Can't write to multiple lines to file...please help

    Hi all ,
    The following is trying to write to message receive from UDP packets. The problems is data_output can only write a single line of message to the file "serverlog.txt". How can write multiple line of message to the file?
         private void processUDPPackets(SelectionKey selectionKey){
              DatagramChannel datagramChannel = (DatagramChannel) selectionKey.channel();
              try{
                   file_output = new FileOutputStream("serverlog.txt");
                   data_output = new DataOutputStream(file_output);
                   while(datagramChannel.receive(byteBuf) != null) {
                        byteBuf.flip();
                        charBuf = decoder.decode(byteBuf);
                        data_output.writeChars(charBuf.toString());
                        data_output.writeChars("\n");
                        byteBuf.clear();
                   charBuf.clear();
              }catch(IOException e){
                   selectionKey.cancel();
                   System.out.println("Logout:: Server port:" + datagramChannel.socket().getLocalPort() +
                                            ". Client: " + datagramChannel.socket().getInetAddress() + " / " +
                                            datagramChannel.socket().getPort());
         }

    Hi,
    Instead of data_output.writeChars("\n");, do data_output.writeChars(System.getProperty("line.separator"));Rgds,
    Andre'

  • How to write to multiple lines in text item?

    I tried to write 2 lines in the text item, however only return one line:
    :myqueues.queue :=      'hello' || chr(10) ||'world';
    It gives me only 'hello' in the first line and nothing else in the 2nd line.
    Is there any settings needs to be activated in the property of text item?

    I'm reading a file and imports the strings:
    DECLARE
         v_filename VARCHAR(50);
         v_handle text_io.file_type;
         readline varchar(50);
    BEGIN
         v_filename := get_file_name(file_filter=>'All files(*.*)|*.txt|');
         v_handle := text_io.fopen(v_filename, 'r');
    text_io.get_line(v_handle, readline);
    :myqueues.queue := rtrim(readline);
    text_io.get_line(v_handle, readline);
    :myqueues.queue := :myqueues.queue || chr(10) || rtrim(readline) ;
    text_io.get_line(v_handle, readline);
    :myqueues.queue := :myqueues.queue || chr(10) || rtrim(readline) ;
         text_io.get_line(v_handle, readline);
    :myqueues.queue := :myqueues.queue || chr(10) || rtrim(readline) ;
         text_io.fclose(v_handle);
    END;
    This function reads the file and returns 4 strings, each of which takes one line in one record of text item.
    My question is: can I get 4 records, assigning each with one string from the input file?
    Thanks a lot.

  • Word property with multiple lines

    Good Morning,
    I have a Document Library with an Word template, I fill some properties of the library so I can put this properties in the template. I am trying to write a line break, Any idea?
    Thanks.

    Hi,
    According to your post, my understanding is that you want to use Word property with multiple lines.
    Per my knowledge, you can remove two updates: KB2760769 and
    KB2760758.
    The working version of office is 14.0.6129.5000.
    Here is a similar thread for your reference:
    http://sharepoint.stackexchange.com/questions/77759/inserting-multi-line-text-field-quick-part-from-sharepoint-crashes-word
    More information:
    Office 2010 Update KB2760758 Incorrectly Checks Multi-Line Columns
    As this question is more relate to Word, I suggest you post it to the corresponding forum, you will get more help and confirmed answers from there.
    http://social.technet.microsoft.com/Forums/en-US/home?forum=officesetupdeployprevious
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Writing XML in multiple lines

    Hi,
    I am running into a glitch when i tried to write multiple XMLs into 1 file (each XML on each line).
    I am using XMLWriter and trying to use CompactFormat (in XMLWriter).
    Let me first explain my problem. I am trying to write several XML lines (let's say orders) into 1 file and i want each order to be in a single line. My problem is that all the xml orders are coming in the same line because i am using the compact format.. How can i make each order xml go into different lines in the same file?
                        try
                             OutputFormat format = OutputFormat.createPrettyPrint();
                             format = OutputFormat.createCompactFormat();
                             format.setSuppressDeclaration(true);
                             fileOutputStream = new FileOutputStream("C:\\CODE\\FINAL\\test.txt");
                             xmlWriter = new XMLWriter(fileOutputStream, format);
                        } catch(Exception e)
                             System.out.println("File not found");
                        }After this, i will prepare XML using DOM4J APIs and write that to this file using XMLWriter.
    Please help me how to write into different line..
    Thanks in advance

    One way is to first convert each XML into a string, e.g. via
          * Prints a textual representation of a DOM object into a text string..
          * @param document DOM object to parse.
          * @return String representation of <i>document</i>.
        static public String toString(Document document) {
            String result = null;
            if (document != null) {
                StreamResult strResult = new StreamResult(new StringWriter());
                try {
                    Transformer t = TransformerFactory.newInstance().newTransformer();
                    t.setOutputProperty(OutputKeys.ENCODING, "iso-8859-1");
                    t.setOutputProperty(OutputKeys.INDENT, "yes");
                    t.setOutputProperty(OutputKeys.METHOD, "xml"); //xml, html, text
                    t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
                    t.transform(new DOMSource(document.getDocumentElement()), strResult);
                } catch (Exception e) {
                    e.printStackTrace();
                result = strResult.getWriter().toString();
            return result;
        }//toString()then remove all line separators and add the result to the file followed by a line separator.

  • How do i add multiple lines in a cell (like a list) in Excel for MAC?

    I'm trying to add multiple lines (in the form of a list) in a individual cell in Excel for MAC.  I used ALT Enter on my PC but that doesn't work on the iMac.  Does anyone know how to do this?
    Thanks!

    It's been a while but I think you hold SHIFT while typing a page break (RETURN) to make a new line without shifting to another cell.
    However, as Excel isn't an Apple product, I am sure you will get a faster and more current answer by using Microsoft's Office:Mac forums here:
    Office for Mac forums
    They are very good.

  • Multiple Lines in a Jtable Cell

    I am trying to place multiple lines in a single cell of Jtable
    The text Of the cell comes from the database.I am trying to do it using a JLabel .If anyone can help me please do so
    thanks
    kishore
    [email protected]

    It can be done but it is quite a lot of work. Basically you have to produce your own cell renderer and use that instead. A good book on swing will tell you how to do it.

  • Script issue with multiple lines printing

    Dear All,
    I'm trying to print multiple lines of my internal table in a script.
    But only the last line is being printed all the time in all the lines.
    Attached is my code.
        CLEAR GS_REGUP.
        LOOP AT GT_REGUP INTO GS_REGUP.
    * Start the Form
          CALL FUNCTION 'START_FORM'
            EXPORTING
              ARCHIVE_INDEX = TOA_DARA
              FORM          =  'ZFORM'                                    "T042E-ZFORN
              LANGUAGE      = SY-LANGU                          "T001-SPRAS
              STARTPAGE     = 'FIRST'
              PROGRAM       = 'ZPROG'.
    * Net Amount
          CLEAR GV_NETWR.
          GV_NETWR = ( GS_REGUP-WRBTR - GS_REGUP-PSSKT ).
    * Print the Content
          CALL FUNCTION 'WRITE_FORM'
            EXPORTING
              ELEMENT  = '525'      "Header
              FUNCTION = 'APPEND'
              TYPE     = 'BODY'
              WINDOW   = 'MAIN'.
    * End the Form
          CALL FUNCTION 'END_FORM'
            IMPORTING
              RESULT = ITCPP.
          IF ITCPP-TDPAGES EQ 0.       "Print via RDI
            ITCPP-TDPAGES = 1.
          ENDIF.
        ENDLOOP.
    Please let me know the flaw in it.
    Regards,
    Deepu.K

    Dear All,
    As i Mentioned in my earlier post, the same coding working fine in Quality server --> Printing multiple lines in script output.
    But now, I have the same reqt. in another window.
    So, I did the same coding.
    But, this time it's printing the last line of the internal table in all the lines.
    This is happening in Quality Server only.
    The only difference between the previous internal table and this int. table is:
    1. The first int. table content is printing in MAIN Window. ---> working fine
    2. The second int. table content is printing in VARIABLE window. ---> NOT WORKING.
    Can any one tell me what's the issue with this ?
    Regards,
    Deepu.K

  • What is labview digital write-to-line logic high voltage?

    i'm using a pci-6503 daq hardware and cb-50lp.I'm currently doing a project to interface a labview vi to a programmable chip(downloaded with a vhdl program),using the daq hardware.The chip must function according to the labview program.I'm using 2 digital write-to-lines and 6 digital read-from-lines to interface to the chip.
    Problem:
    the 6 digital read-from-lines are able to read from the chip,but the 2 digital write-to-lines are unable to reach a logic high of 5v.This means that the labview vi can only read and unable to write to the chip to function(only one way communication).In the daq wizard,when using the test panel to test the individual lines of port a,b and c,it is able to write a good
    logic low and good logic high(5v),even when all the lines are being used altogther.But when the labview vi is being run, the write-to-line cannot write a good logic high,thus unable to interface completely with the chip.
    Please advise.Urgent!
    grays

    LabVIEW does not do anything different to the PCI-6503. NI-DAQ outputs the same 5V from MAX and LabVIEW. Are you sure the FPGA isn't driving 0V on the same line? You could test this by putting a small resistor between the FPGA and the DAQ card. See what the voltage is across the resistor.
    Even at 2.5mA, the 6503 should output 3.7V.

  • I want to write the name (label) of push_button in multiple lines.....

    I have a push button, I want to write the name of it in multiples lines because its too long so how can we do it... I mean I think there's some coding or any thing else. Just if we want to label a button we take it properties and in the label properties we write its name but if the name is too long then it does not come from the next line..We have to maximize the button so the full name comes....How we can do this thing that the name comes from the next line or in multiple lines....

    Also, you could make a text item, with raised bevel and a when-mouse-click trigger:
    Re: Changing caption of a single row button in multi-record block

Maybe you are looking for

  • Where did my music go.

    My computer crashed. I replaced the hadrdrive. I logged back into iTunes and behold all my music listings were there, however, there is an exclamation point prior to each song. And when I go to play the song a dialog box says it cannot play the song

  • Why is CS6 on trial when I've had it for a year

    Last year i started my game programming course and got a CS6 master collection code that I used and then a few months later they told me to create an account which I did. I then used my code again attaching it to my account instead of just my compute

  • PO Fields and tables

    Could any one help me finding the tables and fields for the following purchase order information? 1. Purchase Order Number 2. Order Date 3. Supplier code – code representing supplier or vendor 4. Deliver to code - code representing complete name and

  • Prevent save Message when there is an error

    Hi all, Please help me out here. I want to prevent saving a new Support Desk Message when there is an error in the message. Kind regards, Remy Piets

  • Problem with screen size in Premiere Pro CS5?

    I'm making a movie in Premiere Pro CS5 and I've ran into a problem with the screen size. The source screen shows my footage in widescreen (16:9) but my project screen is playing the widescreen footage in standard size (4:3) so it is cutting off some