GET with FOPENA


Results 1 to 5 of 5

Thread: GET with FOPENA

  1. #1
    Registered ghyman's Avatar
    Join Date
    Feb 2005
    Location
    USA
    Posts
    303
    Downloads
    0
    Uploads
    0

    Default GET with FOPENA

    I am trying to dump some info to a file on MD1 with FWRITC and PUT / WRITE. It is working just fine, everything is as expected.

    However, I am also trying to read from the same file using FOPENA and GET and have hit a wall.
    The FOPENA is working just fine, as is CLOSE A.
    But no matter what variations on GET I use, I receive an error 2323 (Buffer Over).
    I have tried every syntax I can imagine, including 'GET 1' but I still receive the error.

    The file format seems to be good, it is (at this point) simply 2 sets of numbers, like this:
    4.8556496, 3422345

    The manuals do not do a very good job of explaining the error other than to say "The number of received data sets is larger than read pointer value."

    Has anyone had success with reading from a local file?
    Just an example of some working code would be very helpful; I'm pretty certain I am missing something obvious.

    Thanks.

    Edit - changed a word.

    Last edited by ghyman; 04-24-2015 at 07:57 AM. Reason: Extra word


  2. #2
    Registered ghyman's Avatar
    Join Date
    Feb 2005
    Location
    USA
    Posts
    303
    Downloads
    0
    Uploads
    0

    Default Re: GET with FOPENA

    Answering my own question...

    Writing is the easy part... FWRITC MD1: takes care of that.
    Reading, however, took me a few steps before I found the issue.
    FOPENA MD1: opens the file for input,
    then the control must receive a pointer to the input channel so that GET commands know where to look for the input... this is done by READ A
    Once the READ A is given, then the first line of the file can be input using GET. In the example below, GET ,26 will read in the first 26 characters of the first line and do nothing with it.
    Following this, the next READ A is saying "OK, we're reading in a new line on channel A"
    Then, each GET command will either read in and ignore characters (GET ,2 reads 2 characters, GET V11,2 reads in the next 2 characters and writes them into V11, etc.)



    FWRITC MD1:fname.TXT;C
    PUT ,4
    PUT '** '
    PUT 'TOOL OFFSET DATA'
    PUT ' **'
    PUT $0D0A
    PUT 'N='
    PUT V1,2
    PUT ' X='
    PUT VTOFX[V1],8
    PUT ' Z='
    PUT VTOFZ[V1],8
    PUT $0D0A
    WRITE C
    CLOSE C
    M0
    FOPENA MD1:fname.TXT
    READ A
    GET ,26
    READ A
    GET ,2
    GET V11,2
    GET ,3
    GET V12,8
    GET ,3
    GET V13,8
    CLOSE A
    M2



  3. #3
    Member broby's Avatar
    Join Date
    Apr 2006
    Location
    Australia
    Posts
    822
    Downloads
    0
    Uploads
    0

    Default Re: GET with FOPENA

    hahaha just sent you a PM with this answer in it.
    Did not realise it was your post I had found.
    Good to see you have found an answer.
    Brian.



  4. #4
    Registered ghyman's Avatar
    Join Date
    Feb 2005
    Location
    USA
    Posts
    303
    Downloads
    0
    Uploads
    0

    Default Re: GET with FOPENA

    lol!!

    I've been out in the shop playing with this.
    Very cool function to tap into.
    I think the control is going to be able to give us a certain amount of built-in 'intelligence.' (Maybe not SkyNet, but one step closer!!)



  5. #5
    Member broby's Avatar
    Join Date
    Apr 2006
    Location
    Australia
    Posts
    822
    Downloads
    0
    Uploads
    0

    Default Re: GET with FOPENA

    Does make you wonder where we can go with this type of functionality.
    The sky is the limit!
    Brain is flipping out with the possibilities.



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

GET with FOPENA

GET with FOPENA