584,837 active members*
5,305 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Okuma > Access data (common variables)
Page 1 of 2 12
Results 1 to 20 of 22
  1. #1
    Join Date
    May 2018
    Posts
    74

    Access data (common variables)

    Hello All,
    Something just comes across my mind so I decided to post it here to see you can give me your input.
    Is there any way to access data. I meant read and write all common variable data from the machine via PC? If yes what is the program language are we going to use??
    We have OKUMA OSP500L, 5000L. Old machines
    Thanks

  2. #2
    Join Date
    Jun 2015
    Posts
    4131

    Re: Access data (common variables)

    hy nodochau if you wish, i will share soon such a program, that once executed, will create a file with common variables values

    that file, if you wish to send to a pc, you need a dnc , mt connect, or something for file transfer

    thus, i can help with creating the file, but i can't help you with file transfer

    if i may, why do you wish to record those values ? kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #3
    Join Date
    May 2018
    Posts
    74

    Re: Access data (common variables)

    Hi deadlykitten,
    I came across the API application on gosier website but that app works on new okuma machines (window base) only. It is a great app to send, read and write data from pc to machine.
    So I think there should be some ways to access machine data and write the data to the machine via pc with older models. Our machines are old but still working great.
    Sometime the screen is too blurry so its hard to see ).
    ..
    Quote Originally Posted by deadlykitten View Post
    hy nodochau if you wish, i will share soon such a program, that once executed, will create a file with common variables values

    that file, if you wish to send to a pc, you need a dnc , mt connect, or something for file transfer

    thus, i can help with creating the file, but i can't help you with file transfer

    if i may, why do you wish to record those values ? kindly

  4. #4
    Join Date
    Jun 2015
    Posts
    4131

    Re: Access data (common variables)

    I came across the API application on gosier website but that app works on new okuma machines (window base) only
    hy nodochau api is not an app ... is a library of programing procedures

    It is a great app to send, read and write data from pc to machine
    api can be accesed via programing, so to create custom applications; api, on its own, is not going to do a thing

    if installed on the controller, together with a custom app, it can create a file with custom variables values, but that file will be located on the cnc, thus it won't be sent to an external pc

    to send the file to a pc, or to write the file to a storing device <> osp hdd, then is needed to change the output path, inside the custom app

    So I think there should be some ways to access machine data and write the data to the machine via pc with older models
    yup : create the file ( with common variables values ) by using a *.min program, and after that send the file to a pc, using a file transfer software

    again, i can help you with the *.min file, but i can't help you with the file transfer

    also, if i may, common variables are not machine data, but osp data; machine data includes axis data, cinematics, efforts, etc, something related straight to cutting/operating

    Our machines are old but still working great
    there is nothing like an old bone

    Sometime the screen is too blurry so its hard to see
    but why do you wish to export those values ? you edit them inside the machine, why bother to record the values ? kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  5. #5
    Join Date
    May 2018
    Posts
    74

    Re: Access data (common variables)

    I want to edit them outside the machine since I don't see anything on machine screen. Is it crazy :=))
    That is why I record - transfer - edit - transfer back to machine.

  6. #6
    Join Date
    Jun 2015
    Posts
    4131

    Re: Access data (common variables)

    i guess you need to fix that monitor do you have a file transfer software ? do you transfer files to/from the cnc ?
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  7. #7
    Join Date
    Apr 2009
    Posts
    1262

    Re: Access data (common variables)

    Should be able to do what you want using get out read write functions over your rs232 port.
    Experience is what you get just after you needed it.

  8. #8
    Join Date
    May 2018
    Posts
    74

    Re: Access data (common variables)

    Sounds good OkumaWiz.
    Can you show me what do I need?
    Thanks

  9. #9
    Join Date
    Apr 2009
    Posts
    1262

    Re: Access data (common variables)

    See the attached section from the programming manual:

    You will still need a cable to tie to your PC thru the RS232 if that is what you are looking to do.

    Best regards,
    Attached Files Attached Files
    Experience is what you get just after you needed it.

  10. #10
    Join Date
    May 2018
    Posts
    74

    Re: Access data (common variables)

    Thanks a lot OkumaWiz. I found the chapter in my Manual Book and it was exact what you gave me.
    I am confused about the text file which is written so that the data can be transferred to the machine. Where is the text file is supposed to be saved into? I think the PC.
    I have to have the DNC software that I can get it but the text file in the sample at page 354 made me confusing. That text file has to be saved and updated some where so that the machine can get the update...
    A Compensation Yes/No = 1 Offset No. = 3 OX = 0.02 OZ = -0.31

    1 5 10 15 20 25 30 40

    (a) (b) (c) (d)

  11. #11
    Join Date
    Apr 2009
    Posts
    1262
    You are not actually creating a file and no additional software is needed for the machine. When you read from the pc a short text string is sent from the pc and then stored in the read buffer. Then you get data and store it to common variables. As you describe the first character you get may be yes/no. The next set of characters may be an Offset or other data that you store in the next Variable. Continue parsing the string of data until finished.

    Then process your variables in the program as needed.

    Put and write are used to send data back to the pc in similar fashion.

    This is commonly used to communicate with a post process gauge.
    Experience is what you get just after you needed it.

  12. #12
    Join Date
    May 2018
    Posts
    74

    Re: Access data (common variables)

    Quote Originally Posted by OkumaWiz View Post
    You are not actually creating a file and no additional software is needed for the machine. When you read from the pc a short text string is sent from the pc and then stored in the read buffer. Then you get data and store it to common variables. As you describe the first character you get may be yes/no. The next set of characters may be an Offset or other data that you store in the next Variable. Continue parsing the string of data until finished.

    Then process your variables in the program as needed.

    Put and write are used to send data back to the pc in similar fashion.

    This is commonly used to communicate with a post process gauge.
    OK. It sounds a little bit clearer. "When you read from the pc a short text string is sent from the pc and then stored in the read buffer" you meant the machine (program) reads the short text string from the pc? I guessed. So we have to create that short string in Notepad under CNC or txt? And the program will read the string as soon as you open Notepad app and type the string in? Then after the program processed we will get all data from machine put in the pc (Shown on screen of pc) if we want? If it is true then it is very awesome though. I definitely will give it a try.

  13. #13
    Join Date
    Jun 2015
    Posts
    4131

    Re: Access data (common variables)

    yes, very nice questions nodochau, you are definetly on the right way


    please mr wizard, using 232 is only to transmit data, not also files ? for example, if the file is created inside md1, can it be transfered to the pc with 232 ? or 232 only sends the write_buffer, which is saved on the pc ?

    i see no reason to use 232 to transfer content, whose size is lower then osp program capacity

    of course, i believe this will work for nodochau, but is there a method to transfer a file while the machine is running ? 232 seems too intrusive / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  14. #14
    Join Date
    Jun 2015
    Posts
    4131

    Re: Access data (common variables)

    "When you read from the pc a short text string is sent from the pc and then stored in the read buffer" you meant the machine (program) reads the short text string from the pc? I guessed.
    hy nodochau, actually the machine will receive a buffer, and that buffer contains alphanumericchars : 0-9 az AZ

    like this, content may be sent to / from the machine

    buffer size is circa160chars; so if a file has:
    ... <160chars, it will be sent in one shot
    ... >160chars, it will be sent in small portions of 160chars, thus there will be small packages, divinding the content into smaller sizes, that can be managed by the controller packages will arrive one after the other, so some " hand shake / parity " parameters will need to be set, to avoid the case where packages will rush one over the other

    So we have to create that short string in Notepad under CNC or txt?
    you dont have to think about that ' short string '; i mean you can simply create a file on the pc, and it will be breaked automatically into smaller packages, during the transfer sequence

    And the program will read the string as soon as you open Notepad app and type the string in?
    no, not quite : let's say that you have the file tmp.txt on the pc, and it has one line : " 123 456" ( 6 blanks, 6 chars )

    program inside the machine will be similar to this :

    FOPENA tmp.txt
    READ 0 ( open 232 chanel )
    GET , 3 ( read 3 blank chars )
    GET V1 , 3 ( read next 3 chars, thus read 123, and initialize V1 with 123 )
    GET , 3 ( read 3 blank chars )
    GET V2 , 3 ( read next 3 chars, thus read 456, and initialize V2 with 456 )
    CLOSE 0 ( close the chanel )

    i am not sure, since i never used 232 / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  15. #15
    Join Date
    May 2018
    Posts
    74

    Re: Access data (common variables)

    Quote Originally Posted by deadlykitten View Post
    hy nodochau, actually the machine will receive a buffer, and that buffer contains alphanumericchars : 0-9 az AZlike this, content may be sent to / from the machinebuffer size is circa160chars; so if a file has:... 160chars, it will be sent in small portions of 160chars, thus there will be small packages, divinding the content into smaller sizes, that can be managed by the controller packages will arrive one after the other, so some " hand shake / parity " parameters will need to be set, to avoid the case where packages will rush one over the other you dont have to think about that ' short string '; i mean you can simply create a file on the pc, and it will be breaked automatically into smaller packages, during the transfer sequenceno, not quite : let's say that you have the file tmp.txt on the pc, and it has one line : " 123 456" ( 6 blanks, 6 chars )program inside the machine will be similar to this :FOPENA tmp.txtREAD 0 ( open 232 chanel )GET , 3 ( read 3 blank chars )GET V1 , 3 ( read next 3 chars, thus read 123, and initialize V1 with 123 )GET , 3 ( read 3 blank chars )GET V2 , 3 ( read next 3 chars, thus read 456, and initialize V2 with 456 )CLOSE 0 ( close the chanel )i am not sure, since i never used 232 / kindly
    So the filename.txt is saved in pc already and I have to open it up so that the data can be transferred to machine, right?Example my file has one line and there is one space between the two values2.1252 2.1253 And I want to set v1=2.1252, v2=2.1253How is the program written.

  16. #16
    Join Date
    Jun 2015
    Posts
    4131

    Re: Access data (common variables)

    maybe something like this :

    Code:
       FOPENA tmp.txt
       READ 0
       GET V1 , 6
       GET    , 1
       GET V2 , 6
       CLOSE 0
       // file content : '2.1252 2.1253'
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  17. #17
    Join Date
    Jun 2015
    Posts
    4131

    Re: Access data (common variables)

    hy nodochau, i see you started digging about how to use 232; good luck with that, i can't help with 232

    i just wanna say this : if you modify just a bit the program from previous post, replacing '0' with 'A', like this :

    Code:
       FOPENA tmp.txt
       READ A
       GET V1 , 6
       GET    , 1
       GET V2 , 6
       CLOSE A
       // file content : '2.1252 2.1253'
    then the file can be located not on a pc, but on the machine, in MD1 folder ( or whatever is your main system device ), thus you can read directly from a file located on the machine

    like this, there is no longer needed to tranfer the file content from the pc in real time

    this method has the benefit that it does not require to 'pair' the pc with the machine, but it requires a method to transfer the file passively; i work like this, and main advantage is that the machine can run whatever program, and the files may be transfered while the machine is running

    is better to be able to manage files regardless of the cnc state ( executing a program, waiting, etc ) / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  18. #18
    Join Date
    Apr 2009
    Posts
    1262

    Re: Access data (common variables)

    Got thinking about this some more and I think there’s an easier way.
    Your vintage of machine should have the DATA PIP function on it.

    With this it’s possible to punch out machine settings for backup purposes. You can also read back in the backup to set the data. This will create the variable “text file” that you are after.

    Commands would be as follows:

    From parameter mode:
    DATA PIP
    PUNCH
    CN0: VAR.TOP,P2
    Prepare PC to receive file using up/download software
    WRITE

    This will create a text file of your variable on the PC that you can edit.
    Make your changes and then pull it back in using DATA PIP as follows:

    DATA PIP
    READ
    CN0: VAR.TOP
    WRITE
    Send the file back from the PC.

    Look in your operation manual for more details on DAT INPUT/OUTPUT.

    I use it for setup backups all the time and it should work for what you want as well.

    Best regards,
    Experience is what you get just after you needed it.

  19. #19
    Join Date
    Jun 2015
    Posts
    4131

    Re: Access data (common variables)

    hello nodochau, i also have been thinking about this ... so you wish to read / load the custom variables from the pc, but you don't have a conection between the machine and the pc

    also, your screen monitor is not ok, you can not see ok, but you use variables inside your programs ...

    if you allready use variables inside the programs, why do you wanna save them to the pc ?

    Sometime the screen is too blurry so its hard to see
    so, your screen is ok sometimes, but not always ? and when it is broken, your only problem is reading the variables ? there is a missing puzzle piece in all these / kindly

    Got thinking about this some more and I think there’s an easier way.
    Your vintage of machine should have the DATA PIP function on it.
    hi mr wizard, what about replacing "datapip"+ sending to the pc, with a *.min that saves the file, with variables, on the machine ? in both cases may be needed to rename the file, only that using a *.min to save all the variables does not require a conection to the pc / kindly
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  20. #20
    Join Date
    May 2018
    Posts
    74

    Cool Re: Access data (common variables)

    Quote Originally Posted by deadlykitten View Post
    hello nodochau, i also have been thinking about this ... so you wish to read / load the custom variables from the pc, but you don't have a conection between the machine and the pcalso, your screen monitor is not ok, you can not see ok, but you use variables inside your programs ...if you allready use variables inside the programs, why do you wanna save them to the pc ?so, your screen is ok sometimes, but not always ? and when it is broken, your only problem is reading the variables ? there is a missing puzzle piece in all these / kindly hi mr wizard, what about replacing "datapip"+ sending to the pc, with a *.min that saves the file, with variables, on the machine ? in both cases may be needed to rename the file, only that using a *.min to save all the variables does not require a conection to the pc / kindly
    Hi Deadlykitten,I don't want to save all variables into pc. I just want to see them in the pc screen if we can out put the data. And If I can see them then I want to know are we able to put the data from the pc back to the machine.I just ordered the cable and study some parameters to hook the pc up to the machine. Don't know yet but will see. Regarding your code so I think what need to be done are: (If I hook the pc up successfully)Create a text file name test.txtProgram read/Write...Run the code .. so The question is the file needs to be opened on the pc screen? Sorry if it is a dump question

Page 1 of 2 12

Similar Threads

  1. Activate macro variables common #550 to #999
    By VicEd in forum USA Club House
    Replies: 1
    Last Post: 12-07-2017, 08:13 PM
  2. Replies: 12
    Last Post: 02-14-2011, 12:34 AM
  3. Fanuc OM - M99 Clears Common Variables
    By ED209 in forum Fanuc
    Replies: 12
    Last Post: 07-11-2009, 07:31 AM
  4. Common Variables
    By viorel26 in forum G-Code Programing
    Replies: 3
    Last Post: 10-02-2007, 10:09 PM
  5. Need help with IF ,THEN,AND GOTO USING COMMON VARIABLES.
    By XRACERJB in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 2
    Last Post: 08-31-2007, 02:08 PM

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
  •