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)