Need Help! Trying my hand at Macro's for the first time, Need some input on an issue


Results 1 to 6 of 6

Thread: Trying my hand at Macro's for the first time, Need some input on an issue

  1. #1
    Registered
    Join Date
    Oct 2012
    Location
    USA
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default Trying my hand at Macro's for the first time, Need some input on an issue

    So I'm working on hooking up a Yuasa SUDX indexer to a FAdal 4020 with the 88HS controller. I have 3 sample programs, 2 from Yuasa and one pulled from a post on here.

    the problem that I'm having is that the sample programs from Yuasa either aren't typed correctly, or I'm not writing them out correctly since I get errors.

    This is the sample program:

    %
    N1O1(TEST INDEXER TEST PROGRAM O1
    N2* LOAD VAR V1 FOR INDEX POSS.
    N3* THEN CALL SUB 9998
    N4* # V1=45.
    N5* M98 P9998
    N6G0G80G90G17G40
    N7T1M6
    N8S100M3
    N9X0Y2.
    N10Z-5.
    N11#V1=90.
    N12M98P9998
    N13G1Z-6.F60.
    N14G0Z-5.
    N15#V1=270.
    N16M98P9998
    N17G1Z-6.
    N18G0Z-5.
    N19M2
    %

    I've never seen anything with asterisks as posted on N2-N5. If I leave the asterisks there, the program won't upload to the controller. So I changed N2 and N3 to parentheses as shown below:


    %
    N1 O3333(TEST INDEXER TEST PROGRAM O3333)
    N2 (LOAD VAR V1 FOR INDEX POSS.)
    N3 (THEN CALL SUB 9998)
    N4 # V1=45.
    N5 M98 P9998
    N6G0G80G90G17G40
    N7T1M6
    N8S100M3
    N9X0Y2.
    N10Z-5.
    N11#V1=90.
    N12M98P9998
    N13G1Z-6.F60.
    N14G0Z-5.
    N15#V1=270.
    N16M98P9998
    N17G1Z-6.
    N18G0Z-5.
    N19M2
    %

    The problem is that it doesn't execute the program. I hit start and it just sits's there in limbo.

    For reference, here's the Sub program that's calling out to it:

    %
    N1O9998( UDNC-100 MACRO, RS232 MACRO PROGRAM O9998 )
    N2 (WE USE V1 THRU V4)
    N3 #V4 = 0
    N4 #WAIT
    N5 #SPRINT"A0EF1000G90B",V1,"M30S"
    N6 #:LOOP
    N7 #SPRINT"YYYYYYYYYYYYYYYYYYYYYYYYY"
    N8 # SINPUT V2
    N9G4P1000
    N10 #V4 = V4 + 1
    N11 #WAIT
    N12 #V3 = 0
    N13 #IF V2 GE (V1 - .0015) THEN V3 = 1
    N14 #IF V2 LE (V1 + .0015) THEN V3 = V3 + 1
    N15 #IF V4 = 20 THEN :ERROR
    N16 #IF V3 NE 2 THEN :LOOP
    N17M99
    N18 #:ERROR
    N19G4P65000
    N20 #PRINT" CHECK INDEXER IT IS NOT IN POSITION"
    N21 #PRINT" PRESS SLIDE HOLD, MANUAL THEN RESTART PROGRAM"
    N22 #WAIT
    N23 #GOTO :ERROR
    N24 #END
    %

    When I try just running the sub program, I get the same problem. It just stays in limbo. I have to hit Slide hold in order to stop the program. So I'm starting to question if Macro B even works on the Fadal. So for kicks, I try another sample program that isn't related to the indexer.

    %
    N1 O8001(.75 RADIUS ON FRONT EDGE
    N2 M6 T1 (1.00 INGERSOLL W/ .06R
    N3 G70 G90 G0 S2500 M3 F60.
    N4 G43 H1 Z3. X1.3 Y-1.85 (initial position for X,Y)
    N5 Z.1 (.1 above the part)
    N6 #V1=.75 'the radius to be cut on the part
    N7 #V2=.06 'the corner radius on the tool
    N8 #V3=0 'the start angle
    N9 #V4=90 'the finish angle
    N10 #V5=15 'the step angle
    N11 #V7=-.5 'the distance from Y0 to the center of the radius
    N12 #V8=-.75 ' the distance from Z0 to the center of the radius
    N13 #V10=TN 'sets V10 to the current tool number
    N14 #V11=D(V10)/2 'sets V11 to the radius of the current tool
    N15 #V12=V1+V2 'the actual arc thats calculated
    N16 #:LOOP
    N17 #R1=V7-V11+V2-(SIN(V3)*V12) 'calculates the Y position
    N18 #R3=V8-V2+(COS(V3)*V12) 'calculates the Z position
    N19 G1 Z+R3 (moves to Z-level
    N20 Y+R1 (feed in to radius
    N21 X-1.3 (cut along edge
    N22 G91 G0 Z.05 G90 (short retract [YES, G91/G90 can be on the same line]
    N23 X1.3 Y-1.85 (return to initial position
    N24 #IFV3GEV4THENGOTO:END 'if at the finish angle goto end
    N25 #V3=V3+V5 'increase the step counter
    N26 #IFV3GEV4THENV3=V4 'step counter should not be more than finish angle
    N27 #GOTO:LOOP
    N28 #:END
    N29 G0 Z.1 M5 M9
    N30 G49 Z0
    N31 M2
    %

    Sure enough, this program works like a charm! So now I'm stuck as to why the first two programs don't work. I hook up the indexer and try running them with no luck. I'll double check my cable, but I wanted some input if the first two programs have an error in the Macro thta I just don't see?

    Any input from someone would be great while I keep looking into this, thanks!

    Matt

    Similar Threads:


  2. #2

    Default Re: Trying my hand at Macro's for the first time, Need some input on an issue

    Have you tried renumbering your program NU command ?



  3. #3
    Registered
    Join Date
    Oct 2012
    Location
    USA
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default Re: Trying my hand at Macro's for the first time, Need some input on an issue

    Yes, no change.



  4. #4

    Default Re: Trying my hand at Macro's for the first time, Need some input on an issue

    I took your program copy and paste as it is % to % and it loaded into my fadal no problem. the asterisk or parenthesis is used on fadal for comment no problem. Most all of my posted programs use the asterisk. So i loaded the O1 program and your Sub program O9998. Hit auto and it ran up to the #Wait and waited i do not have a indexer control box so i figure thats the reason its waiting for the completed signal. But all in all it seemed to want to run the way you have posted.



  5. #5
    Registered
    Join Date
    Oct 2012
    Location
    USA
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default Re: Trying my hand at Macro's for the first time, Need some input on an issue

    I really appreciate that!

    Thats where it get's hung up as well, and I have it hooked up to the control box. I'm starting to wonder if I need a PCB0007 or PCB0008 board in order to use the control box through the RS232 port?



  6. #6

    Default Re: Trying my hand at Macro's for the first time, Need some input on an issue

    You need an M-funtion board and a 4pin cable for the indexer box. the RS232 port is just for uploading/downloading programs to the indexer control. (i believe)

    ITS: M Function, PCB-0008

    and the cable i believe

    ITS: Wire Harness,5C Indexer;MTR To CNTRL, WIR-0178



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

Trying my hand at Macro's for the first time, Need some input on an issue

Trying my hand at Macro's for the first time, Need some input on an issue