S7-1200 RS232 to Heater

NoName

Member
Join Date
Sep 2003
Location
Domžale
Posts
273
Hello all.
I'm trying to control a heater with a S7-1200 CPU with the CM1243 communications processor. The two devices are connected with a null modem cable. So far all my efforts to send commands to the heater were not successful. So now I'm thinking that the data that I send to the heater isn't correct. The heater's manual describes the commands likeso:

A transfer sequence consists of:
• command
• space (⇔; Hex: 20)
• parameter (the character separating decimals in a group is
the period)
• end of file (↵; Hex: 0D)
The commands are divided into in or out commands.
in commands: asking for parameters to be displayed
out commands: setting parameters
􀀩 The out commands are valid only in remote control mode.
Command to set the working temperature > SETP 1< to 55.5 °C
out_sp_00 ⇔ 55.5↵
Command to ask for the working temperature > SETP 1<
in_sp_00↵
Response from the circulator:
55.5↵

So i have tried to send the command for the working temperature, but there is no response from the heater.
I send the data as an struct of characters with the Send PTP block. But I am not shure that this is correct, because I don't know what the symbol at the end is. I have even tried converting the hex value stated above (0D) to a string and put it at the end but it doesn't work. I've also tried to send a complete HEX value to the heater but again there is no reply. I have also tried to send these commands with a hyper terminal and a RS232 analyzer but it is the same. I have run out of ideas now, so any help on this topic would be great.
I've also checked if I get any data on the heaters connector with a RS232 analyzer, and the data is equal to what I send with in the PLC. So now I'm out of ideas.

Any ideas folks?
Cheers.
 
Hi!
I would stick to the hyperterminal until I got some kind of response from the unit.
Firstly only trying to read a value, not to write.

What about the character format?
Start bits? 1 presumably?
Data bits? 7 or 8?
Parity bit? None, Even, Odd ?
Stop bit(s)? 1, 1.5, 2?
Bitrate?

And the HW handshake signals?
Latching RTS-CTS and/or DSR-DTR?


Serial communications also requires a lot of coffee and loud swearing.;)

Kalle
 
are you trying to speak RS232? The CP1243-1 is a DNP3 protocal over ethernet speaking device. The CP1243-5 is a profibus master (so it woudl have a db9 connector). if this is a standard RS232 serial device you need the cp 1241.
 
Hello all, thanks for the answers so far.

These are the settings character format?
Start bits isn't defined in the manual
Data bits 7
Parity bit Even
Stop bit 1
Bitrate 9600

Latching RTS-CTS and/or DSR-DTR? Again not defined in the manual, I can choose software or hardware handshake.

This is the pinout of the heater:
Pin 2 RxD Receive Data
Pin 3 TxD Transmit Data
Pin 5 0 V Signal GND
Pin 6 DTR Data terminal ready
Pin 7 RTS Request to send
Pin 8 CTS Clear to send



This is the CP that I have CM 1241 (RS232)_1, I re-typed it wrong at the first post.

My first step is also to try to read the temperature, but as I said I get no response from the heater.

So far you are correct, there has been loud swearing and allot of coffee consumed and a few beers to(friday's) :)
 
You have to use Point-to-Point communication (PtP) to talk with the heater.
Most important is to set up the port on the card with the instruction PORT_CFG. With this instruction you set all the parameters for communication, and the block tell when the connection is establish.

Then use the SGN_GET or SGN_SET (depend on the your heater) to set up line for RS232 communication.

It is a lot to do with parameters and set both end correct.
So manual and a lot of coffee

Look in the System Manual on page 565 (chapter 12.3) for how set up a PtP connection: http://support.automation.siemens.co...ew/en/36932465


Also look here:
http://www.automation.siemens.com/W...ow.aspx?HTTPS=REDIR&PostID=218510&language=en
 
You have to use Point-to-Point communication (PtP) to talk with the heater.
Most important is to set up the port on the card with the instruction PORT_CFG. With this instruction you set all the parameters for communication, and the block tell when the connection is establish.

Then use the SGN_GET or SGN_SET (depend on the your heater) to set up line for RS232 communication.

It is a lot to do with parameters and set both end correct.
So manual and a lot of coffee

Look in the System Manual on page 565 (chapter 12.3) for how set up a PtP connection: http://support.automation.siemens.co...ew/en/36932465


Also look here:
http://www.automation.siemens.com/W...ow.aspx?HTTPS=REDIR&PostID=218510&language=en

Thanks for your input JERA. I'll read through the manual and try to get a better understanding of the communication. I thought that it's enough just to set the same settings on the heater and in the hardware configuration of the CPU and the CM, but I guess I've got to push the configuration to the heater also? I' ve read the topic on the Siemens support forum, and there was no mention of the port configuration function or the SGN_GET or SGN_SET functions. Even in the example program they are not used, so that's why I didn't use them. But I'll try now.

Also at first I will play around with the hyper terminal to get the darn thing to even respond. It'll be easier I think to get a basis there and work my way through to implement it in my PLC. If anyone has any helpful tips and trick's regarding the hyper terminal I would be grateful.

Cheers.
 
Last edited:
I am a happy man right now!

I cracked it! I control the heater with the PLC! As it's Friday and almost 7 PM here in ( the :) ) Europe, I'm going out for a beer! I'll post how I solved the problem tomorrow!

Thanks for all the help guys!
 
I am a happy man right now!

I cracked it! I control the heater with the PLC! As it's Friday and almost 7 PM here in ( the :) ) Europe, I'm going out for a beer! I'll post how I solved the problem tomorrow!

Thanks for all the help guys!

(y)
 

So here goes...I'm not really good at explaining things :)

At first as you guys suggested I started playing around with the hyper terminal. I was sending commands to the heater like it's stated in the manual, but I didn't have any luck, I was connected to the heater through the cable that I made.
So I figured that it might be the configuration of my cable that was wrong. So I connected my USB to COM adapter directly to the heater and tried again but again no luck. After that I found this program( http://www.232analyzer.com/232default.htm ) on line that really helped me.
With It you can see what outputs (DTR,RTS,CTS) are set by the heater, send data in various formats. So I read the siemens manual how the signals states must be from the sending device to the receiving device (heater) in order that it is ready to receive the data. After that I simulated this conditions with the RS232 analyzer, and started to send data to the heater. I stared sending strings to the heater but I couldn't add the break simbol (like it is stated in the manual) at the end of the command so the heater didn't respond. I then looked at the options of the data format. With RS232 Analyzer you can send data in dec, bin, oct and ASCII. So I decided to try and convert my string with the break at the end to dec format. I found a great online conversion tool ( http://www.asciitohex.com/ ) which gave me the correct dec value of the string with the correct end symbol. As soon as I sent this converted value to the heater it responded, and I could set/read every parameter from the heater.
I then corrected my cable configuration and checked with the RS232 analyzer that I see the same outputs being set from the heater. Once I had this I connected this cable to the CM of the PLC and started sending data to the heater and of course it was working.
Because with the PLC I could send hex values to the heater I made the arrays of chars with setpoints that I needed and started sending them to the heater. From then on it was just a case of implementing all this to my PLC code, which I did yesterday. Of course there were some obstacles to overcome here but I managed to work it all out.

So I hope it's described good enough to understand how I got it to work and that it can be useful for anyone else.

Thanks again to all of you who helped me to go in the right direction!
 

Similar Topics

Hi to all, I have a power supply "gwinstek" PSP-2010, with rs-232, so I want to control it with S7-1200 "1212acdcrly with CM-1241 RS-232 module...
Replies
2
Views
1,444
Hi all! If I want to connect two S7-1200 CPUs with RS232 ports on both CPUs, and implement a Modbus RTU communication, what is the cable pinout...
Replies
2
Views
3,127
For a small project I need some digital I/O's and a serial communication with a weight measurement. Also an ethernet connection to an MP277...
Replies
1
Views
3,025
I am trying to communicate between a Micrologix 1200 and a vision system VB program. Current situation is that clear the buffers (ACL) and send a...
Replies
0
Views
2,594
Does anyone have the pinout for the RS232 cable used on AB panelview 1200's?
Replies
4
Views
6,913
Back
Top Bottom