TygerDawg
Full Member
  
Offline
Posts: 230
|
 |
« Reply #1 on: February 25, 2011, 02:46:26 AM » |
|
I checked a previous application and tried to remember the details, here is the setup if I remember correctly:
1. Assume you call the serial / ethernet port "sioMyPort", an sio variable must be set in the sio data section 2. Assume you set up a port via the pendant and call it "PortX", with all the correct baud rates etc. Save the app & transfer it back to your PC...it will now have a new entry in the "io" library. 3. In a program you must initialize the port & port name declaration with the statement "sioLink(sioMyPort, io:PortX)" 4. When you want to write a string to the port, is done with the statement "sioMyPort=sMyString" 5. Receive strings with the statement "sMyString=sioMyPort" 6. Usually it is necessary to parse through the string to select characters you need using the delete(), toNum(), and toString() functions. Or you can simply test the string as a whole.
I used freeware TeraTerm to test the comm commands between CS8 Emulator & PC, from there is simple to extend to real workcell. Method notes: 1. Start TeraTerm, make New Connection with settings (a) TCP/IP checked ON, (b) Host = whatever is stated at left bottom of CS8 Emulator Window, typically = "127.0.0.1", (c) Service= "other", (d) TCP Port # = 1301 or whatever port is set on Emulator, (e) Protocol = UNSPEC. 2. You can use TeraTerm to comm to a VAL3 program, send & receive simple commands to verify communications, stop characters, eprogram statements necessary to strip away excess characters (which may be hidden), etc. All the fun parts of communications programming. 3. Another useful freeware that I used to verify characters was TCP/IP Builder. This helped me "see" hidden characters that were embedded in the string.
|