586,094 active members*
4,063 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > DPRNT- ignore if no printer connected
Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2005
    Posts
    36

    DPRNT- ignore if no printer connected

    Hi folks
    I'm fooling around with some subs to get detailed cutting and chip to chip times independant of one another. I'm almost there, but I currently have a DPRNT function in one of my subs sending through RS232, it works fine in outputting my data, but my issue is, that I don't want to have my PDA (I'm using PDA for data collection) or anything else permanently connected to the machine, only when I want to collect data. But when program hits POPEN and DPRNT commands with nothing connected or drawing data, it bombs out with error '085 NO DR SIGNAL' on POPEN or if I connect device but don't have it 'sucking' for info or connect a blank cable, it hangs on DPRNT. Is there a way I can have my sub check for RS232 connection, and if nothing there, use a simple GOTO to skip POPEN and DPRNT?
    Hope that makes sense.
    Cheers

  2. #2
    Join Date
    Sep 2005
    Posts
    767
    Make a jumper plug. Get a DB25P (male) plug and jumper pins 4 and 5 together, then jumper pins 6, 8, and 20 together. Plug the jumper into the control and let 'er rip!

    When the Fanuc control opens the serial port, it looks for a "high" signal on pins 6 (DR) and pin 8 (CD). If your 6-8-20 jumper is in place, then pin 20 will hold the other two pins high.

    Fanucs also need to see a high on pin 5 (CTS). If CTS is not high, then the control will hang up when it tries to send anything. Jumpering pins 4 & 5 together will solve this problem.

  3. #3
    Join Date
    Aug 2005
    Posts
    36
    Thanks Dan, I can do that on one machine, no problem, but we have about 60 CNC's and don't really want to make a whole heap of 'dummy' RS232 plugs. Plus we also run with totally unskilled labour and if a plug got removed for any reason, machine will hang. I'm trialling a means of taking detailed split times (Pal shuttle, chip-chip for each tool, cutting time for each tool, etc) and dumping to PDA. I'm in automotive, so every second counts and I need the minute detail. I've knocked up a series of M code triggered subs that capture all this, and was hoping I could control it all by macro, so I could just load the subs to any machine (There would be tweaks for different controls) and let it rip. The plan would then be to just plug PDA into selected machine and collect data when required. It might seem a little weird, but our business is a little weird. I was hoping there might be a system variable somewhere that shows RS232 port open or closed that I could use in a IF/GOTO line.
    It might help if I add that we mostly have 16,18 and 21M controls
    Cheers

  4. #4
    Join Date
    Sep 2005
    Posts
    767
    There's no easy way I know of that you could write a macro so that it first "tests" to see if a serial device is connected, unless you're willing to let the control alarm out, then reset it. If you perform a POPEN or DPRNT with nothing connected, it will just alarm and your macro will stop.

    Here are two alternative ideas. Maybe one of them will work for you:

    1) Use one of the "500" macro variables as a switch. In your macros, you could test if that variable is a "1" or a "0", then jump past the DPRNT functions if it's a "0". You will have to manually set this variable to "1" when you plug in your PDA, and then set it to "0" again when you unplug it. You can just MDI a "1" into this macro variable when you connect the PDA. If someone UN-plugs the PDA, you could let the control hang up only once (then run OK) with this macro:

    2) Make a short macro (as shown below) that will intentionally alarm out if the PDA is un-plugged while your "switch" variable is set to "1". Call this macro first, and let it set the variable to "0" for you as a default. For example:


    IF[#530EQ0]GOTO1
    #530=0
    POPEN
    DPRNT []
    PCLOS
    G04P100
    #530=1
    N1M99


    When you plug in the PDA and the variable #530 is a zero, you will have to MANUALLY set the variable to "1" because this macro won't do it for you. However, if someone un-plugs the PDA and the variable is set to "1", this macro will alarm out JUST ONCE and set it to "0" for you. After that first alarm, the control should not alarm out any more. The operator will just have to RESET the control and press CYCLE START again to resume without the PDA.

    Note: The G04P100 may be necessary on some Fanuc models. Many of these controls will process macro commands in a "Look ahead" manner, and you don't want #530 being set to "1" anyway if the macro alarms out. Putting in a "dummy" non-macro command will solve that. The G04 will not be called until the PCLOS is executed.

    Do any of these ideas help?

  5. #5
    Join Date
    Sep 2005
    Posts
    767
    One more idea:

    I didn't mention this idea because it's probably not practical for you. It would require a software option (Macro I/O) plus some internal wiring in the control and a jumper in your PDA cable.

    There is an option for "Macro I/O" where you can wire up to 16 input signals and control up to 16 output signals from your macro programs. One of the macro inputs could be wired through two unused pins of the serial port, and your PDA cable could have a jumper between those two pins. That way, when you plug in the PDA, the input would turn on, and when you un-plug the PDA the input would turn off. Your macros could then test that input's variable before executing the POPEN/DPRNT.

    As I said, this solution does exactly what you want, but it isn't very easy or practical.

  6. #6
    Join Date
    Aug 2005
    Posts
    36
    Thanks again Dan.
    Yeah, it looks like I won't find my ideal solution, but such is life. That could be the best I'm gonna get, I think I'll probably go with the manual 'switch' option in the 500 variable, rather than letting it alarm once, as there are only about 3 guys here who will be using this system and it's not a big deal to set one variable before using. Shame there's no way for control to see the power jumping across RS232 pins that we could use. I've enclosed the subs, just in case they're of any interest to anyone, and at the bottom is the top section of main program and first tool only, showing where the M codes would sit. (Program style might be a bit specific to us, as we have multi station fixturing and so we loop sections of machining, so my subs are geared to suit our style)
    Cheers for the help.

    O9020(TOOL CHANGE M6)

    M9
    G0G91G30Z0
    G30X0Y0
    G90
    M19

    #149=#20
    M45T#20(FETCH TOOL)

    #899=600.
    WHILE[#[#899]NE#0]DO1
    #899=#899+3.
    END1
    IF[#899GE899.]THEN#899=899(LIMIT LIST TO 300)
    #[#899]=#149

    M99

    O9021(M70)
    (ENSHU VERSION)
    (RECORD 'DEAD END' OF PROGRAM)
    (PLACE M70 IMMEDIATELY PRIOR TO M71)
    (SET #6081 TO 70)
    (#901=PAL A DEAD END)
    (#902=PAL B DEAD END)

    IF[#1000EQ1]THEN#901=#3002*3600(PAL A)

    IF[#1001EQ1]THEN#902=#3002*3600(PAL B)

    #3002=#0

    M99

    O9022(M71)
    (ENSHU VERSION)
    (PRINT TIMES)
    (PLACE M71 BETWEEN M70 AND BEFORE M60)
    (SET #6082 TO 71)

    #898=#0(RESET FOR CHIP-CHIP M73)
    POPEN
    #899=600.
    DPRNT[SHUTTLE,*,#900[23]]
    DPRNT[PAL*A*DEAD*END,*,#901[23]]
    DPRNT[PAL*B*DEAD*END,*,#902[23]]
    WHILE[#[#899]NE#0]DO1
    #895=#[#899](TOOL NUMBER)
    #896=#[#899+1.](CHIP TO CHIP)
    #897=#[#899+2.](CUTTING TIME)
    DPRNT[TOOL*#895[20],CHIP*TO*CHIP,#896[33],CUTTING*TIME,#897[33]]
    #899=#899+3.
    END1
    PCLOS

    (**********************************)
    (CLEAR ALL REQ'D VARIABLES, FRESH START)
    (#597-#903 USED)
    #1=597(START VARIABLE)
    WHILE[#1LE903]DO1(END VARIABLE)
    #[#1]=#0
    #1=#1+1
    END1
    (**********************************)

    M99

    O9023(M72)
    (ENSHU VERSION)
    (PALLET CHANGE TIME)
    (PLACE M72 IMMEDIATELY FOLLOWING M60)
    (SET #6083 TO 72)
    (#900=PAL CHANGE TIME)

    #900=#3002*3600

    #3002=#0

    M99
    O9024(M73)
    (ENSHU VERSION)
    (CHIP - CHIP TIME)
    (PLACE M73 IMMEDIATELY PRIOR TO 1ST FEED MOVE)
    (SET #6084 TO 73)

    IF[#898NE#0]GOTO1(CHECK FOR LOOP)

    #899=601.
    WHILE[#[#899]NE#0]DO1
    #899=#899+3.
    END1
    IF[#899GE899.]THEN#899=899(LIMIT COUNT TO 300)
    #[#899]=#3002*3600
    #898=#898+1
    #3002=#0

    N1
    M99

    O9025(M74)
    (ENSHU VERSION)
    (CUTTING TIME)
    (PLACE M74 IMMEDIATELY AFTER END LOOP)
    (SET #6085 TO 74)

    #898=#0(RESET FOR CHIP-CHIP M73)
    #899=602.(1ST POSS EMPTY #)
    WHILE[#[#899]NE#0]DO1(FIND NEXT EMPTY)
    #899=#899+3.
    END1
    IF[#899GE899.]THEN#899=899(LIMIT COUNT TO 300)
    #[#899]=#3002*3600(STORE TIME)
    #3002=#0(RESET TIMER)
    M99

    O8012(DEUTZ BODY 2012 MACHINE 1039 ONLY)
    (ISSUE 3)
    (JL 5/11/07)

    M98P2920(FIXTURE OFFSET CALL)

    N4000(DO NOT ALTER)
    G0G91G0G30Z0
    G30X0Y0
    G91G28B0
    G90
    G69

    M1

    M70(DEAD END TIME)
    M71(PRINT AND RESET COUNTERS)
    M60(SHUTTLE PALLETS)
    M72

    M14(THROUGH COOLANT PUMP ON)

    IF[#1000EQ1.]GOTO1000
    IF[#1001EQ1.]GOTO2000
    #3000=1(WRONG PALLET)
    M30

    N1000(OLD M61 PALLET A)
    #120=#4115
    M1

    N1M6T1(SHORT 40MM CERATIZIT 6 INSERT FACE MILL)
    (ROUGH MILL PORT FACES ,BEARING FACE & FOOT TIP)
    IF[#1000NE1]THEN#3000=1(WRONG PALLET)
    M35
    M1

    T3
    M9
    #112=3.
    WHILE[#112GE1.]DO1
    IF[#112EQ1.]THEN#115=90.
    IF[#112EQ2.]THEN#115=180.
    IF[#112EQ3.]THEN#115=270.
    #116=#115+90.(MACRO TO SIDE PORTS)
    IF[#116GE360.]THEN#116=0.
    #101=240.(METRES)
    #102=6.*.15(TEETH & FEED)
    #103=40.(DIA)
    #104=#101/[#103*3.142/1000]
    IF[#104GT13000]THEN#104=12950
    #105=#104*#102
    G0G90G54.1P[#112+9.]X6.Y-63.2S#104M3B#116G43Z250.H1
    M37
    Z3.
    M73(CHIP - CHIP)
    G1Z0.25F#105
    Y-4.
    G0Z250.

    G90G54.1P#112X0Y0S#104B#115G43Z100.H1
    M37
    Z3.
    G1F#105Z0/Z.1

    #102=6.*.075
    #105=#104*#102
    G2X-5.Y5.R5.F#105
    X0Y10.R5.
    X8.661Y-4.998R10.
    X-8.661R10.
    X0Y10.R10.
    X5.Y5.R5.
    G1X0Y0F#105
    G0Z24.384

    #102=6.*.075
    #105=#104*#102
    X34.Y29.
    G1X8.Y81.F#105
    X40.Y134.
    G0Z100.
    #112=#112-1.
    END1
    M74(CUTTING TIME)
    M19
    G91G30X0Y0Z0
    G90

Similar Threads

  1. Discussion on HAAS DPRNT
    By gar in forum Haas Mills
    Replies: 3
    Last Post: 11-24-2022, 11:18 AM
  2. Do you use DPRNT?
    By gar in forum Haas Mills
    Replies: 1
    Last Post: 10-23-2007, 04:02 PM
  3. DPRNT on a Citizen with a L25/32 CONTROL
    By mistux in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 0
    Last Post: 08-20-2007, 09:26 PM
  4. Wrong side of circle is connected.
    By rocky in forum GibbsCAM
    Replies: 3
    Last Post: 08-24-2006, 03:31 AM
  5. Macro DPRNT please help
    By MarkoH in forum G-Code Programing
    Replies: 3
    Last Post: 06-19-2006, 06:37 PM

Posting Permissions

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