517,858 active members
4,350 visitors online
Register for free
Login
Page 2 of 3 123
Results 21 to 40 of 54
  1. #21
    Registered
    Join Date
    May 2009
    Posts
    393

    Lightbulb Hi

    Hi Sinha.

    Thanks for that PDF attachment. I understood the framework of While Loop Function.

    But as per the format (which i attached previously ), it is expressed that this loop prg will be a subprogram. The Main Program defines the Series of Variables to be Output.

    How the Loop function is linked to the DPRNT Function ?

    (I know that u don't use DPRNT function, But Any Guess ?)




    Also as u stated before, it should be 5021 as contrast to 5041. 5041 captures location in absolute Mode with Respect to G54 offset.

    But it can be Controller Dependent (& Stevo may be having that controller), so he mentioned the Same.

    Ash.

  2. #22
    Registered
    Join Date
    Feb 2006
    Posts
    1770
    One can use macro functions anywhere: main program or a subprogram or a macro.
    If the given example is to be used as a macro or a subprogram, replace M30 by M99 in the end.
    Then, it can be called from any program by G65 P8004.
    M98 P8004 would call it as a subprogram.
    G65 may or may not have arguments (M98 cannot have any argument). This example does not need any argument. It will calculate summation of first 10 numbers.
    However, if you want summation up to a specified number, call this macro by
    G65 P8004 C100
    after deleting #3 = 10 block in the macro.
    This macro call will assign a value of 100 to #3, and summation up to first 100 numbers would be calculated.

    If you use DPRINT in a loop, data would be DPRINTed in every execution of the loop, with the current values.

  3. #23
    Registered
    Join Date
    Feb 2009
    Posts
    64

    DPRNT Loop

    I'm assuming you are asking about the format and loop specifically for the DPRNT macro you referenced in the thumbnail.

    The macro, as written in the example, will use #1 as a counter that will do two things, it will keep track of how many iterations are left and what variable we are sending at the time. Variables #4 and #5 are the range that a user will specify during the call - #4 being the lowest numbered variable and #5 being the highest.

    for example : if you were to use variables #101 - #199 to store your information, variable #4 would be assigned 101 and variable #5 would be assigned 199. #1 would first be set to zero before the loop. At the start of the loop, so long as #1 is less than 199 - 101, the loop would run.


    Next, the program creates 2 more variables - #2 and #3 to keep track of which variable we are on (#3) and what the value of that variable is (#2).
    In this case, the value of the variable we are interested in is the 'name' of the variable.

    #2 = #[#4 +[#1]] uses the counter to keep track of the name of the variable.

    #3 = #4 + #1 keeps track of the order.

    The next line deals with output. We are telling the control to output 2 things - the number of the variable referenced at this point in the loop (#3), and the information stored in that variable. The numbers in [] in this line deal with the format used.

    Take this line DPRNT (VAR #1[AB]) - the letter 'A' represents the number of spaces before the decimal to display, while 'B' specifies the number after the decimal place. If only 1 number is present in the brackets, then we are only going to show whole numbers.

    DPRNT (VAR #3[5] ***DATA #2[57]) - we can be reasonably sure that the number of the variable is going to be a whole number (#3) so only 1 number is listed in brackets. ***DATA indicates that the next variable is stored information, [57] limits the information to 5 places before and 7 places after the decimal.

    #1 is then increased by 1 and the loop continues.

    The actual line to call the macro would look like this:
    G65 P8200 I(#4). J(#5).;

    I don't use RS232 so cannot post an example. On my machine, i t is possible to manually send the value of saved variables to a flash card using the List Programs feature. I am not able to do so with a macro, althoutgh some manufacturers may have this option available.

  4. #24
    Registered
    Join Date
    May 2009
    Posts
    393

    Lightbulb Gr8

    Really Thankful for the Program Interpretation. Thanks James.

    Meanwhile i have done provision of RS232C port output on My Machine.

    I will check the Program by Executing It.

    Ash.

    Thanks for your TIME, PATIENCE & WONDERFUL SUPPORT.

  5. #25
    Registered
    Join Date
    May 2009
    Posts
    393

    Hi

    Hi James L,

    had a minor doubt. Where should assignment of #4=101 & #5=199 values should be commanded. Are they need to be commanded in Main Program or at the start of Subprogram..( before POPEN Command ) or where else ?.

    Ash

  6. #26
    Registered
    Join Date
    Feb 2009
    Posts
    64

    Assigning variables

    In macros you assign the variables when you call the program. Sinha mentioned them when he spoke of sending 'arguments' to the macro. In this macro we need #4 and #5. These are recognized by the control as I and J, respectively. So when you call the macro, use the syntax :

    From main program or MDI screen :

    G65 P8200 I(whatever value you wish to assign #4). J(#5).;

    for example - G65 P8200 I101. J199.; would assign 101 to #4 and 199 to #5, and the macro would start it's loop.

  7. #27
    Registered
    Join Date
    Feb 2006
    Posts
    1770
    Quote Originally Posted by James L View Post

    G65 P8200 I(whatever value you wish to assign #4). J(#5).;

    for example - G65 P8200 I101. J199.; would assign 101 to #4 and 199 to #5, and the macro would start it's loop.
    It is definitely a good practice to use decimal points in macro arguments. But, I never use decimal points in cases where integer values are expected (e.g., number of holes), because it looks awkward. Am I asking for trouble (parameters can do strange things)?

  8. #28
    Registered
    Join Date
    Feb 2009
    Posts
    64

    Deicmals

    Most of the time a decimal is not needed in a macro. It doesn't really hurt not to use them but I like to use the same format with them as I would calling up a normal canned cycle. I usually just go by the control's requirements - if decimals are needed in canned cycles then I use them in macro arguments. In this macro, it probably would look cleaner to go without them.

  9. #29
    Registered
    Join Date
    May 2009
    Posts
    393

    Format for assigning a group of variables a common Value

    Hi All,

    I need to assign a value 0.001 to variable serial from 100 to 149, how should is command it ?

    Is that so that we have to right,Just LIKE -

    #101=0.001
    #102=0.001
    .............
    ...........
    #149=0.001

    Is there a Format or a single command to solve the above purpose?

    Ash

  10. #30
    Gold Member
    Join Date
    Jun 2008
    Posts
    1511
    Quote Originally Posted by Ashish B View Post
    Is there a Format or a single command to solve the above purpose?
    #1=0
    WHILE[#1LT48]DO1
    #[101+#1]=.001
    #1=#1+1
    END1

    Stevo

  11. #31
    Registered
    Join Date
    May 2009
    Posts
    393

    nEED Help

    Hi

    Its a long time I have fixed a RE232C cable but the connection is not yet established.

    The MACHINE Dealer says that to use DPRNT command u need a special FANUC software & it costs thousands of rupees. Is that so ?

    Can anyone write the procedure for establishment of a RE232 Connection & a clarification of whether any software (on PC ) is required or what ?

    Ash.

  12. #32
    Registered
    Join Date
    May 2007
    Posts
    966
    Quote Originally Posted by stevo1 View Post
    #1=0
    WHILE[#1LT48]DO1
    #[101+#1]=.001
    #1=#1+1
    END1

    Stevo
    You were too quick for me. Just got home a few minutes ago. Finally something I could answer, but you beat me to it!

  13. #33
    Registered
    Join Date
    May 2009
    Posts
    393

    Talking Thanks

    Hi

    Thanks Stevo for that program.

    Well can anyone address & let me know the COMMUNICATION Setup for RE232C Link?


    Thanks for you TIME, PATIENCE & SUPPORT

    Ash

  14. #34
    Gold Member
    Join Date
    Jun 2008
    Posts
    1511
    Quote Originally Posted by g-codeguy View Post
    You were too quick for me. Just got home a few minutes ago. Finally something I could answer, but you beat me to it!
    LOL…..Sorry Dale I didn’t mean to steal your thunder . I have been so busy the only things I have had time to answer are the quick easy ones.

    Ash…I have never set up the DNC on a Mitsubishi control before. I have attached a note of the settings I have from a quick guide. Also here are 2 links I found for the M50 control and the 300-500 control. I did not see anything on the M64. The wiring should be the same so I have also attached the pinout that I use.

    Mitsubishi M50
    http://www.aggsoft.com/cnc-dnc/mitsubishi-m50.htm

    Mitsubishi 300-500
    http://www.aggsoft.com/cnc-dnc/mitsubishi-300-500.htm

    Stevo
    Attached Files Attached Files

  15. #35
    Registered
    Join Date
    May 2009
    Posts
    393

    HI

    Hi Stevo,

    Thanks a lot for that VALUEABLE ATTACHMENTS

    I need to know in context of RE232C setup. I mean like does it required a software to recieve the data on PC or it will work on the HYPERTERMINAL program (which is a standard feature in Windows PC )?


    Also Stevo, can u suggest me some of the Software Names which i can google down & download & work with it.


    Ash

    Thanks for your time, support & PATIENCE.

  16. #36
    Gold Member
    Join Date
    Jun 2008
    Posts
    1511
    Ash…..you’re welcome for the info.

    There are a lot of different softwares out there that you can get for communication. I currently use Enet. I really like Dostek as I used it a lot in the past, the support was good, and it was only a few hundred bucks. Now there is free software out there but I do not know the name of it. I remember seeing a post sometime back by Al_the_man with a link to some free software so maybe a search or a PM might get that for you. Dan Fritz is the DNC guru and does have his own software and is always willing to help so it might not hurt to check that out as well.

    HyperTerminal does work for transfer and some people still use it. So all you will need is the cables.

    Stevo

  17. #37
    Registered
    Join Date
    May 2009
    Posts
    393

    Smile Hi Stevo

    Hi.

    I will check it out with those Software. Thanks Stevo.

    Also wanted to ask you that can u post for a Sample file of Output of common variables. I am searching for the same since long time.

    Ash

  18. #38
    Registered
    Join Date
    May 2007
    Posts
    966
    Quote Originally Posted by stevo1 View Post
    Ash…..you’re welcome for the info.

    There are a lot of different softwares out there that you can get for communication. I currently use Enet. I really like Dostek as I used it a lot in the past, the support was good, and it was only a few hundred bucks. Now there is free software out there but I do not know the name of it. I remember seeing a post sometime back by Al_the_man with a link to some free software so maybe a search or a PM might get that for you. Dan Fritz is the DNC guru and does have his own software and is always willing to help so it might not hurt to check that out as well.

    HyperTerminal does work for transfer and some people still use it. So all you will need is the cables.

    Stevo
    Stevo, you're the man! Guys like you make me proud to be a machinist.

  19. #39
    Registered
    Join Date
    May 2009
    Posts
    393

    Need Urgent Help

    Hi..

    Finally after a long time My Machine was IDLE & finally i took the Trial.
    The connection established perfectly & also the DPRNT command worked without any errors.

    As we disscussed before, the following format should output a set of Variables -

    Main Program -
    G65 P8200 I101 J149


    Subprogram -
    08200;
    POPEN;
    #1=0;
    WHILE[ #1 LE [#5-#4] ] D01
    #2= #[ #4+ [#1] ]
    #3= #4 + #1
    DPRNT [VAR3[5] ***DATA#2 [ 57] ]
    #1 = #1 + 1
    END1
    PCLOSE
    M99

    ====>But a Alarm Occurs as the Machine Reads POPEN..& #1 = 0...

    I have attached a Snap from the Manual of the Alarm Details.

    Can anybody tell me what should i do or is there any Setting Error ?


    ====>Also when in the Main Program when we assigned I & J to 101 & 149, i checked the Local Variable screen Display but the values 101 & 149 were not visible.

    Do i need to Screw up the setting or the Values assigned to Local Variables in the Argument Mode of G65 Command ?

    Ash

    Thanks for Your TIME, SUPPORT & PATIENCE
    Attached Thumbnails Attached Thumbnails Error.JPG  

  20. #40
    Registered
    Join Date
    Feb 2006
    Posts
    1770
    Should be VAR#3, in place of VAR3

Page 2 of 3 123

Similar Threads

  1. Mazatrol Program into a G Code Program
    By fuzzman in forum Mazak, Mitsubishi, Mazatrol
    Replies: 15
    Last Post: 09-25-2012, 04:27 PM
  2. Replies: 12
    Last Post: 03-15-2010, 02:19 AM
  3. Program Restart in mid program?
    By Donkey Hotey in forum Haas Lathes
    Replies: 16
    Last Post: 03-18-2008, 08:19 PM
  4. Need a CAM program
    By SteveD in forum Community Club House
    Replies: 3
    Last Post: 09-28-2006, 07:46 PM
  5. Replies: 11
    Last Post: 10-09-2005, 05:45 AM

Posting Permissions

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