Author Topic: Communication with serial port  (Read 13727 times)

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Communication with serial port
« on: November 01, 2012, 01:22:21 AM »
Hi. I have a computer A that outputs commands through comtrol rocketport to computer B. Computer A will send signal A, B or C and wait for reply like PASS A, PASS B, or PASS C, before it moves on to the next task. Can I use a 888 to replace computer B? All the codes of the computer is in C++. How do I do it?

Thank you.
« Last Edit: November 01, 2012, 06:25:09 AM by can »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Communication with serial port
« Reply #1 on: November 01, 2012, 08:42:45 AM »
If computer A send command via serial port (RS232) you certainly can program a FMD88-10 (which is a T100MD888+ successor) to receive the serial commands and act on it.

What you need to know is the command format of the serial command from computer A and what each command mean so that you can program an FMD88-10 to take over the job of computer B.

There are some limitation which is that FMD88-10 supports only the following common baud rate with most PC:

9600, 19200,38400, 57600, 115200, 230400.

Also the PLC has a serial circular buffer of 256 bytes only. Presumably a single command from Computer A can fit into 256 bytes then you should be ok.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Communication with serial port
« Reply #2 on: November 01, 2012, 09:16:08 AM »
hi. from what i see, the commands are in strings and one at a time. How can i do it? thanks

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Communication with serial port
« Reply #3 on: November 01, 2012, 11:26:43 AM »
If the command in sent in CR-terminated strings of less than 70 characters then you can use the INPUT$(1) command to read from COMM1 (RS232 port) that is attached to the computer A. (of course you must set the PLC baud rate to that of the PC).  You can then interpret the command by extracting characters from known position using command such as MID$. You can convert string into integer using commands VAL and HEXVAL (for hexadecimal representation in String). Once you get the final data you can use it to make decision such as turning out output, display something on LCD, or make a connection to an external webpage or send an email, etc etc.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS

can

  • Full Member
  • Posts: 160
  • I'm a llama!
    • View Profile
Re:Communication with serial port
« Reply #4 on: December 06, 2012, 11:52:30 PM »
Hi. I'm wondering if it can be used as a baud rate converter where an equipment will send data through the com port at 9600bps while 888 will send out the same data to a printer at 19200bps. Is it possible? Or is there a cheaper alternative? The original data converter is obsolete. Thank you.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Communication with serial port
« Reply #5 on: December 07, 2012, 04:26:08 PM »
Yes it is possible.

T100MD (EOL) and its replacement model such as the FMD88-10 can be programmed to received serial data from one port (using the INCOMM command) and then send the same serial data out of the second COMM port. The two COMM port can be of different baud rate so it is possible to do what you want - to use it as a baud rate converter.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS