pls, a few questions about file read / write


Results 1 to 10 of 10

Thread: pls, a few questions about file read / write

  1. #1
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default pls, a few questions about file read / write

    hello pls, what is the difference between FOPENA and FOPENB ?

    also, why is there an "A" : FWRITC coords.txt;A ? kindly

    Similar Threads:
    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  2. #2
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: pls, a few questions about file read / write

    hey, thx kurmay that image makes sense : it seems that is possible to have active simultaneously 2 buffers for reading + only one for writing

    i was looking for double buffering when writing, not when reading

    i just discovered that these 2 work : FWRITC file-name.txt;A and FWRITC file-name.txt;C, but i have no clue what's the difference between A & C

    also, in that image, instead of " read file a , read file b , read file c ", should be " read file a , read file b , write file c " or " file a opened , file b opened , file c opened "

    a file can be opened for both "write" or "read" actions

    thx again ...

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  3. #3
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: pls, a few questions about file read / write

    that info is not in my lathe manuals

    pls, what are the append modes ? can you share more infos ?


    aaa, i just found something into the mill manuals ... again, the lathe team vs mill team

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  4. #4
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: pls, a few questions about file read / write

    yeah .. however, in the manual is nothing more about the ;A, besides what you shared ... i still have no clue about FWRITC file-name.txt; + "nothing" or "A" or "C"

    maybe is not that important Azerbaijan ? not bad ...


    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  5. #5
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: pls, a few questions about file read / write

    comparing to a linear code, using a single read-buffer ( only fopena ) will lead to an execution time +10%; using 2 read-buffers ( fopena&fopenb ) will hit into +17%

    thus is better to concatenate data into a single file, or just create a linear code

    i think that these functions are from a period when okuma tried to move over the dnc, by putting the source data file into the controller, so to speed up the data transfer

    absolute difference, for the code tested, between linear and fopen* codes was arround 0.04-0.06 seconds/block, is not much, but it sums up if the code is longer


    i mess with such values, because i have an operation log, from which i extract data about operation duration and day-moment of execution

    i try to keep the load on the system as minimal as possible : for example i load data into the buffer until i almost fill it up, and only after that i write it to the file : this reduces the "data write" events : a "write" event may occure after several operations ( eq after 1.5 cycles ), and when it writes down, it writes data about all the operations that had passed

    is a way to create a machinig log for series, with minimal cycle downtime / kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  6. #6
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: pls, a few questions about file read / write

    Quote Originally Posted by deadlykitten View Post
    i still have no clue about FWRITC file-name.txt; + "nothing" or "A" or "C"
    hello past self of my self

    fwritc requires an append mode :
    ... A : data is added to the file, thus allready existing content is preserved; this mode is ok for log-files
    ... C : data is rewriten to the file, thus allready existing content is gone; this mode is ok for single-sessions, for example shopping-lists : now, you have to buy this, and you can trash away the shoping-list from previous week

    of course, if something has to be added to the list, while you are shopping, then append A mode is required : honey, you should have bought all those junks + cat food; why did you bought only the cat food ? what will we eat now ? your mind is always at that hungry pu55y cat ... duuh / got it ?



    C mode is there to avoid increasing the file size, especially when data from previous session is no longer required / kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  7. #7
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: pls, a few questions about file read / write

    hello please, any idea why next program does not work on osp200 ? it seems it can't read a negative value / kindly

    Code:
    
    
        V1 = -123.456
    
    
        FWRITC abcdef.txt;C
        PUT V1 , 9
        WRITE C
        CLOSE C
    
    
        FOPENA abcdef.txt
        READ A
        GET V2 , 9
        CLOSE A
    
    
    M02


    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


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

pls, a few questions about file read / write

pls, a few questions about file read / write