585,971 active members*
4,162 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > DNC Problems and Solutions > Fadal CNC 88 - RS232 - VB.Net Communication Problem
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2012
    Posts
    0

    Fadal CNC 88 - RS232 - VB.Net Communication Problem

    I have been hired contract to interface a Fadal CNC 88 connected to VMC 4020 machine. I am not a tool worker, and not a CNC person, though I may learn the language from this project. The Windows computer has the Fadal software program that communicates via RS-232 port. I have written a VB Net program that also communicates to the CNC using the same RS-232 port. This VB Net program is being written to stay memory resident in the Windows computer and will be connected and on through the RS-232 port UNLESS the Fadal software program needs to connect to the CNC to initiate a measuring session. The problem is that my VB Net program and the Fadal program can not be open to the CNC RS-232 port at the same time.

    The owner wants this to be an automatic operation, that when the Fadal program needs to communicate it automatically closes the port that is being used by VB Net, and then reopens the port when it's job is finished.

    Everything else should be pretty easy to get working, but this is a problem!

  2. #2
    Join Date
    Apr 2012
    Posts
    0
    I am trying to communicate via text box to the CNC control. The program has been loaded with NCFadal. My VB program opens the RS-232 port and also opens NCFadal and opens the NC file to send to the CNC 88.

    Below is VB.Net code to load the file

    Code:
    'Load the NCFadal program BT-5May2012
    
    System.Diagnostics.Process.Start("C:\Program Files\NCFadal\NCFadal.exe", "c:\CAMS\1one1probe.CAM")
    Is there a way to send send the 1one1probe.CAM file to the CNC as a command line parameter, for instance?

  3. #3
    Join Date
    Apr 2012
    Posts
    0
    This is what I did yesterday with VB .Net and CNC 88. It is very important to be able to have on the PC screen the tasks to be done on the VMC drilling machine. The CNC 88 an older, but very reliable and useful controller can't keep all the data files in memory. Now I used a port sniffer to watch how NCFadal communicates via the RS-232 program and how my VB program works. So I mimiced exactly the same characters (ASCII), so that if the NCFadal sent a carriage return but not a line feed, I did the same! What is throwing me for a loop, is when I initiate sending 'A' as the NCFadal program does, I immediately get returned an 'A'. But, then what happens is different. I immediately send the characters as you can see below, but the CNC 88 sends back several characters first! When this is done with the NCFadal program there are no more characters from the CNC 88 until the program data is sent by the PC!

    Okay, I made progress. I installed Serial Port Monitor 3.31 and found out interesting data on handshaking between the CNC 88 and the computer. I have tried to mimic the data. I will put down below the beginning part of the NCFadal listing followed by Jan's program that I have modified to send the test file. The beginning and ending parts are what are not the same. When the CNC is in command mode is when data transfer can occur. What starts is an 'A' or 41H sent from the computer. The CNC 88 returns an 'A'. When the CNC 88 sends the 'A' back then the PC starts it's transmission. Now when my program sends an 'A' the CNC 88 also sends back an 'A', BUT before my program can start sending it's data, the CNC 88 manages to sneak in a few more characters first. (See below)

    The logic shows that it should work, but apparantly there is something a bit different, I am just not seeing it. So I am going to work on a different project for the time being, but want to get this figured out, because a lot of guys/gals can be doing productive work, including myself if this succeeds. It's part of the getting the jobs back to America because it was America that made these machines!


    This is the way it is supposed to go:
    Code:
    Port opened by process "NCFadal.exe" (PID: 3536)
    
    Request: 5/10/2012 3:14:36 PM.01864 (+27.0630 seconds)
    
     41                                                A 
    
    Answer: 5/10/2012 3:14:36 PM.01864 (+0.0000 seconds)
    
     41                                                A 
    
    Request: 5/10/2012 3:14:36 PM.01864 (+0.0000 seconds)
    
     40 0D 54 41 2C 31 0D 0A 25 0D 0A 4F 37 37 37 0D   @.TA,1..%..O777.
     0A 28 53 54 4F 43 4B 2F 42 4C 4F 43 4B 2C 30 2E   .(STOCK/BLOCK,0.
     30 30 30 2C 30 2E 30 30 30 2C 30 2E 30 30 30 2C   000,0.000,0.000,
    Here is my program *
    Code:
    Port opened by process "COM Port Terminal.exe" (PID: 2596)
    
    Request: 5/10/2012 3:12:27 PM.35964 (+60.0324 seconds)
    
     41                                                A 
    
    Answer: 5/10/2012 3:12:27 PM.56264 (+0.2031 seconds)
    
     41 44 56 0D 0A 0D 0A                                    ADV.... 
    
    Request: 5/10/2012 3:12:29 PM.67264 (+1.2344 seconds)
    
     40 0D 54 41 2C 31 0D 0A 25 0D 0A 4F 37 37 37 0D   @.TA,1..%..O777.
     0A 28 53 54 4F 43 4B 2F 42 4C 4F 43 4B 2C 30 2E   .(STOCK/BLOCK,0.
     30 30 30 2C 30 2E 30 30 30 2C 30 2E 30 30 30 2C   000,0.000,0.000,
    And I am sending the block immediately after I send my 'A' (41H)

  4. #4
    Join Date
    Apr 2012
    Posts
    0
    The programming has gone well. I am able to send programs to the CNC 88 controller, with VB.Net successfully, getting the message 'TAPE INPUT TERMINATED', though I want to add a Chksum at some stage. I had no stop bit and should have had 1 stop bit. Also, I eliminated the characters A, and @ and just send the TA,1 command followed by carriage return, linefeed and then % ...

    Now I have created a program that puts the CNC 88 into an infinite loop. Below is the code.


    %
    O100(100.NC)
    #SPRINT "THIS IS AN INFINITE LOOP"
    #SPRINT "YOU MAY HAVE TO USE MY PROGRAM"
    #SPRINT "TO STOP IT, PRESS SLIDE HOLD"
    #SPRINT "THEN SEND TA,1 <ENTER>"

    #:IDLELOOP
    #SPRINT "IDLELOOP"
    #SPRINT "MORE"
    M15 P0 (VERTICAL CUTTING)
    #GOTO :IDLELOOP

    #:ENDOFPROGRAM
    %
    I need to be able to breakout of the program to check the status of an operation, before moving onto a new program, the reason for the idle loop.

    I have tried to increment a variable to allow me to escape to :ENDOFPROGRAM: something simple, but can't get my variable to increment. I have tried using R7 #100 variables that I read in the manual or on the Web, but not figuring this out. I know this has to be simple as incrementing a variable is not hard?

  5. #5
    Join Date
    Apr 2012
    Posts
    0
    The End, but really just The Beginning!


    I figured out the increment, using macros. Below is my code. Just now I discovered that I can't use brackets on the CNC 88 machine, as a web search showed but rather as the manual shows '>' symbol like I am used to, #IF R7 > 4 THEN GOTO :ENDPRGM. I am happiest when I'm programming! :banana:

    Below id

    Code:
    %
    O101(101.NC)
    #SPRINT "THIS IS AN INFINITE LOOP"
    #SPRINT "TO STOP IT, PRESS SLIDE HOLD"
    #SPRINT "THEN SEND TA,1 <ENTER>
    
    #R7=0
    
    #SPRINT R7
    
    #:IDLELOOP
    #SPRINT "IDLELOOP"
    M15 P0 (VERTICAL CUTTING)
    #R7=R7+1
    #SPRINT R7, " AFTER INCREMENT"
    #IF R7 > 4 THEN GOTO :ENDPRGM
    #GOTO :IDLELOOP
    #:ENDPRGM
    #PRINT "THE END"
    #SPRINT "THE END"
    %
    Back to work! If this helps someone else, that's cool!

  6. #6
    Join Date
    Apr 2012
    Posts
    0

    How to run multiple programs

    In my last post I have the idle program which was requested, and though the program doesn't do much, may need to be in. My question is it possible to enable a new program to run after the idle program has run and it's determined that it okay to go to the next step, without having to press the 'Start' button on the CNC 88 controller? I have been able to use AU,0,0,1,1 so that I don't have to press the Auto key.

Similar Threads

  1. RS232 Communication Problem
    By Fighter in forum Dynapath
    Replies: 18
    Last Post: 07-23-2020, 10:25 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
  •