You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old September 23rd, 2010, 06:16 PM   #1
Nickolassc
Member
United States

Nickolassc is offline
 
Join Date: Sep 2010
Location: Maine
Posts: 5
Help me connect a process display to a serial port via RS232

Hello! I have an issue I hope the experts here can help me with. I've been working on connecting a Baumer PCD41 process display to my laptop via an RS232 3 wire connection (ground, TxD, RxD) but I can't seem to get it to work correctly and I think it's one of three issues. I was hoping I could get some feedback on these.

The first issue, Baumer technical support could not tell me whether the process display was a DCE or DTE device, which is necessary for wiring TxD and RxD correctly. I would assume that a process display/PLC would generally be considered a DTE device, is that correct?

The second issue, which I think is my problem, is finding a good software program for reading the data input. Does anyone have a good software program they recommend for data input?

The third issue is configuring the ports on the computer. I know the process display is putting out the following signal: 4800 Baud, 1 stop bit, even parity, I am not sure on the flow control but I assume there is none, and I'm not sure on the data-bit rate, but I'm assuming it's 8 bit. Do those sound right and do I need to go into the control panel in windows xp and configure the serial port to match the settings for the process display?

Thanks,
Nick
  Reply With Quote
Old September 23rd, 2010, 06:31 PM   #2
sthompson
Lifetime Supporting Member + Moderator
Canada

sthompson is offline
 
sthompson's Avatar
 
Join Date: Jan 2007
Location: Vernon, BC
Posts: 1,725
Quote:
Originally Posted by Nickolassc View Post
Hello! I have an issue I hope the experts here can help me with. I've been working on connecting a Baumer PCD41 process display to my laptop via an RS232 3 wire connection (ground, TxD, RxD) but I can't seem to get it to work correctly and I think it's one of three issues. I was hoping I could get some feedback on these.

The first issue, Baumer technical support could not tell me whether the process display was a DCE or DTE device, which is necessary for wiring TxD and RxD correctly. I would assume that a process display/PLC would generally be considered a DTE device, is that correct?

The second issue, which I think is my problem, is finding a good software program for reading the data input. Does anyone have a good software program they recommend for data input?

The third issue is configuring the ports on the computer. I know the process display is putting out the following signal: 4800 Baud, 1 stop bit, even parity, I am not sure on the flow control but I assume there is none, and I'm not sure on the data-bit rate, but I'm assuming it's 8 bit. Do those sound right and do I need to go into the control panel in windows xp and configure the serial port to match the settings for the process display?

Thanks,
Nick
Can you give us a link to the Manual for the Display?

Stu.....
__________________
There's never time to do it right, but there is always time to do it over!
No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced.
  Reply With Quote
Old September 23rd, 2010, 06:36 PM   #3
Nickolassc
Member
United States

Nickolassc is offline
 
Join Date: Sep 2010
Location: Maine
Posts: 5
Quote:
Originally Posted by sthompson View Post
Can you give us a link to the Manual for the Display?

Stu.....
Here's the link to the product's technical data and general overview, thanks!

http://motion.baumer.com/motion/prod...untry=&header=
  Reply With Quote
Old September 23rd, 2010, 07:19 PM   #4
sthompson
Lifetime Supporting Member + Moderator
Canada

sthompson is offline
 
sthompson's Avatar
 
Join Date: Jan 2007
Location: Vernon, BC
Posts: 1,725
Problem 1:

Are you using a real Serial Port with a DB9 Connector or a USB to Serial Converter? I can provide you with a Wiring Diagram. It should be the same wiring either way.

Problem 2:

I don't have a suggestion for a Communications Program at this point. I would start with HyperTerminal. What Version and Service Pack of Windows are you using?

Problem 3:

The RS-232 Parameters are set on Lines 51 to 54. You will have to set your PC the same, or Visa-Versa. Flow Control is either none, or XOn/Xoff, but probably none.

Stu......
__________________
There's never time to do it right, but there is always time to do it over!
No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced.
  Reply With Quote
Old September 23rd, 2010, 07:30 PM   #5
danw
Member
United States

danw is offline
 
danw's Avatar
 
Join Date: Oct 2004
Location: midwest, USA
Posts: 1,998
http://motion.baumer.com/motion/prod...ttst_DE_EN.pdf

1) I don't know how DCE, DTE makes a difference. If you're connecting to a PC COM port, Tx connects to Rx on either side and the signal grounds connect to each other.

2) If the manufacturer doesn't offer a software program, then why would anyone else?. The interface manual (link above) spells out the protocol. It appears to be a roll-your-own write your own program situation.

3) "Transmission is effected character by character in ASCII code. Each character consists of 8 bits. The 8th bit is the parity bit; in case of "no parity", the 8th bit will always be transmitted as a zero."

That means words are 7 bits, not 8 bits. (ASCII is 7 bit)

I would avoid no parity since no parity is forced to a zero bit. It's too easy to set even or odd parity.

Most programs that talk serial have a comm setting.

Without a software program, setting comm settings is just an exercise.
  Reply With Quote
Old September 23rd, 2010, 07:47 PM   #6
Nickolassc
Member
United States

Nickolassc is offline
 
Join Date: Sep 2010
Location: Maine
Posts: 5
Quote:
Originally Posted by sthompson View Post
Problem 1:

Are you using a real Serial Port with a DB9 Connector or a USB to Serial Converter? I can provide you with a Wiring Diagram. It should be the same wiring either way.

Problem 2:

I don't have a suggestion for a Communications Program at this point. I would start with HyperTerminal. What Version and Service Pack of Windows are you using?

Problem 3:

The RS-232 Parameters are set on Lines 51 to 54. You will have to set your PC the same, or Visa-Versa. Flow Control is either none, or XOn/Xoff, but probably none.

Stu......
Thanks for the advice, I am using a real serial port with a db9 connector and not a serial to usb adapter. On the wiring, I've connected it as RxD (PD) to TxD (PC) and TxD (PD) to RxD (PC) assuming both the computer and the process display are DTE devices.

I'm using windows XP SP3, I tried using Eltima data logger to collect data, but I haven't been able to succesfully log any data input. I think it's because I have the communication settings wrong. Here is the program I tried using:

http://download.cnet.com/RS232-Data-...-10497745.html

I left the Process Display parameters on the default settings and changed the com port settings in window xp control panel device manager and the data logger program to match the default settings of 4800 baud, 1 stop bit, even parity. I've tried running through different combination of the settings for the bit rate and the flow control, but haven't had much luck yet receiving a signal. Thank-you for looking at this for me.
  Reply With Quote
Old September 23rd, 2010, 08:46 PM   #7
sthompson
Lifetime Supporting Member + Moderator
Canada

sthompson is offline
 
sthompson's Avatar
 
Join Date: Jan 2007
Location: Vernon, BC
Posts: 1,725
Your Serial Wiring looks ok. If you have not done it already, you need to download the PCD41 Interface Manual. I looked at the RS-232 Data Logger, and it appears to just passively listen. Looking at the PCD41 Interface Manual, you have to Poll it with the Line Number you want to read. In other words, before it will send you anything, you have to send it a command to do so.

Grab the Interface Manual, and for the time being, use HyperTerminal, and send the PCD41 a simple Command, and see what it spits back at you. At least you can confirm your Serial connection that way.

Stu......
__________________
There's never time to do it right, but there is always time to do it over!
No trees were killed in the creation of this message. However, many electrons were terribly inconvenienced.
  Reply With Quote
Old September 23rd, 2010, 08:59 PM   #8
danw
Member
United States

danw is offline
 
danw's Avatar
 
Join Date: Oct 2004
Location: midwest, USA
Posts: 1,998
Quote:
Originally Posted by Nickolassc View Post
On the wiring, I've connected it as RxD (PD) to TxD (PC) and TxD (PD) to RxD (PC) assuming both the computer and the process display are DTE devices.
Connect the RS-232 GND to the PC's signal ground (pin 7?). Lack of a ground reference will revent comm from running.

Quote:
Originally Posted by Nickolassc View Post
I've tried running through different combination of the settings for the bit rate and the flow control,
Flow control involves the RS-232 control signals like RTS, DSR, CTS. Those don't exist in the hardware.
So flow control = none; or it's regulated by the software keeping track of when the transmission is complete and then sending the next command.
  Reply With Quote
Old September 24th, 2010, 07:38 AM   #9
Nickolassc
Member
United States

Nickolassc is offline
 
Join Date: Sep 2010
Location: Maine
Posts: 5
Thanks for the tips so far. I have the ground wire connected to the 5th pin, according to the db-9 pinouts I've seen, this should be the correct pin. I tested the connection by crossing the RxD and the TxD wires and using the terminal to send commands. Each letter I typed in the terminal appeared twice, once for sent and once for receive, so I believe I have that part working correctly.

When I wire up the process display and send a few commands, I'm not getting any response back in the terminal and the control commands I'm sending to the process display are appearing to have no effect.

I sent the following command with no response:
<STX>35IT<ETX>
Which according to the programming manual, I should have a response of:
<STX>35BPCD41 01<ETX><CR>

Does it sound like the connection parameters aren't setup correctly?

Thanks,
Nick
  Reply With Quote
Old September 24th, 2010, 06:33 PM   #10
danw
Member
United States

danw is offline
 
danw's Avatar
 
Join Date: Oct 2004
Location: midwest, USA
Posts: 1,998
I've found the Hyperterminal on XP rapidly 'forgets' its comm settings and reverts to 8-N-1, which is problematic for ASCII comm using 7 bit words.

And, as I recall, resetting comm isn't easy, it requires closing Hyperterminal and re-launching it. I have been unable to get Hyperterminal to save a setup using 7 bit ASCII and have it recall the setup correctly. It always reverts to 8-N-1.

Make sure you're really set up for 7 bit ASCII.
  Reply With Quote
Old September 24th, 2010, 06:56 PM   #11
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 10,664
Just going to toss this in: I don't use Hyperterminal for terminal applications anymore. I've seen it do too many plain-weird things (deleting every three repeated characters in VT100 mode, the aforementioned forgetting serial settings, etc).

RealTerm is an open-source alternative. It's a little hairy looking at first and not perfectly intuitive, but I like the display options for unprintable characters, as well as the capture and append to file feature. I've used it as my quick-and-dirty data logger as well as a terminal.

http://realterm.sourceforge.net/

Does the target device support an "echo" command of any type ? That's often a simple way to prove serial connectivity.
  Reply With Quote
Old September 25th, 2010, 09:33 AM   #12
lakesidebc
Member
Canada

lakesidebc is offline
 
lakesidebc's Avatar
 
Join Date: Dec 2008
Location: Chilliwack, BC
Posts: 26
Quote:
Originally Posted by Nickolassc View Post
<snip>
I sent the following command with no response:
<STX>35IT<ETX>
Which according to the programming manual, I should have a response of:
<STX>35BPCD41 01<ETX><CR>

<snip>
How are you sending the <STX> and <ETX>, you realize those are 02H and 03H respectively. How would you send those characters in ascii? You're not typing in "<"+"S"+"T"+"X"+">" in ascii right?


Read-out of tachometer value (Line=01, Displayed value=1500)
Polling: <STX>3501<ETX>
Answer: <STX>3501R001500<ETX><CR>

Now, this is going to sound like a crazy question...

The examples in the comms manual use the ADDRESS = 35 for their examples, which you have used for yours. In fact the factory default ADDRESS = 00 as shown in the manual.

You can change the unit number to whatever you choose through the front panel of the device by the look of it. When you send a serial command to the device, if the address at the beginning of the command does not match the address of the device it will just ignore the command (no response). It's assuming the query was for someone else.

See your programming manual for the PCD41, page 37.

Line 54 54 00
Address * from 0 to 99


Good luck!
Paul
__________________
Paul
  Reply With Quote
Old September 25th, 2010, 09:59 AM   #13
lakesidebc
Member
Canada

lakesidebc is offline
 
lakesidebc's Avatar
 
Join Date: Dec 2008
Location: Chilliwack, BC
Posts: 26
Quote:
Originally Posted by Ken Roach View Post
Just going to toss this in: I don't use Hyperterminal for terminal applications anymore. I've seen it do too many plain-weird things (deleting every three repeated characters in VT100 mode, the aforementioned forgetting serial settings, etc).

RealTerm is an open-source alternative. It's a little hairy looking at first and not perfectly intuitive, but I like the display options for unprintable characters, as well as the capture and append to file feature. I've used it as my quick-and-dirty data logger as well as a terminal.

http://realterm.sourceforge.net/

Does the target device support an "echo" command of any type ? That's often a simple way to prove serial connectivity.
+1

This is going to be required to send your HEX <STX> <ETX> etc...

What is the "end-game" for this application? Other than it's a fun diversion? ie. once you have your comms working, then what?
__________________
Paul
  Reply With Quote
Old September 25th, 2010, 10:13 AM   #14
danw
Member
United States

danw is offline
 
danw's Avatar
 
Join Date: Oct 2004
Location: midwest, USA
Posts: 1,998
<stx> <etx>

I found this note on implementing control characters in Hyperterminal. I can not vouch for its accuracy, because I've never had to use it.

0x means 'hex'

---------- implementing <STX> <ETX> ----------
It is a common misconception that you can't send hex values using hypertermimal.

One way to send STX and ETX is by using the CTRL key.
You can send STX as CTRL+B and ETX as CTRL+C.

A-Z map to 1-26 respectively so for example CTRL+O would be the equivalent of sending (0x0F).

Another method you can use to send any hex value between 01-FF is done using the ALT key and the decimal equivalent of the value you want to send.

Holding down the ALT key and entering 02 and releasing the ALT key will send STX (0x02).

Note for hyperterminal you need to add the leading zero so to send 0xFF you would use ALT+0255. If you enter anything larger than the maximum for a 1 byte value it will just roll over so ALT+0257 will give you 0x01.
---------------------------
  Reply With Quote
Old September 27th, 2010, 10:33 AM   #15
Nickolassc
Member
United States

Nickolassc is offline
 
Join Date: Sep 2010
Location: Maine
Posts: 5
Thanks for all the tips so far. I am using the address of 18 for the device and I have been sending the commands as <STX>18ID<ETX>. I will attempt to send the first and last characters as Hex, I am using the terminal program Termite 2.4 right now, I'll try the open source alternative that was linked. Thanks for your help so far! Once I poll the process display to ensure it works I'm shipping it off to our programmer. He is going to write a VB program to capture data from a laser distance sensor.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Zelio Serial Port Baud rate etc. etomami LIVE PLC Questions And Answers 4 June 1st, 2013 06:55 AM
Cellular Modem to SLC 504 via serial port RKaighen LIVE PLC Questions And Answers 0 March 14th, 2008 07:59 AM
Serial Port Expander for PLC-5 Original Platform ckchew666 LIVE PLC Questions And Answers 4 July 14th, 2005 03:40 PM
Simulator, Simulation, Shadow Code Terry Woods LIVE PLC Questions And Answers 1 January 2nd, 2005 01:40 PM
Need PLC to control via serial port ... LIVE PLC Questions And Answers 9 February 28th, 2003 07:01 AM


All times are GMT -5. The time now is 09:01 AM.


.