Configuring Siemens CP340 for comms

Johnny T

Member
Join Date
Jul 2003
Location
Fife, Scotland
Posts
642
Hi

I'm trying to configure my Siemens S7-312 to talk to some MAC servo motors.

I've got a Cp340 module (RS 232C) connected to the rack but, all I get on the front, is the red SF led.

I've configured the motors using two free pieces of software (MAC talk, MAC reg I/O).

MAC talk allows me to set up the addresses and behaviour of the servo's (ie. positional control or vector control etc).

MAC Reg I/O, allows me to talk directly to the motors. I have successfully talked to the motors by sending a string out.

The string I need to send (for this test) is:
<52><52><52><02><FD><03><FC><04><FB><90><6F><5F><A0><01><FE><00><FF><AA><AA><50><50><50><02><FD><03><FC><AA><AA>

I put this string in a data block and tried to use FB3 to send it to the motor when I0.0 is high.

Unfortunately, all I'm getting is the red SF light on the CP340 module and I can't understand why...

I've tried putting the example CP340 program into the PLC and I still get the red SF light on the CP340 but also the SF light on the PLC.

I've attached an archive of my project to this post. Can anyone point me in the right direction for getting started?

Many thanks

JT :)
 
If all you are getting is a red light, then you most likely have a wiring problem. The CP340 is very sensitive to grounding and voltage on the receive and transmit pins.

Have you tried connecting it to your laptop and seeing if the red light goes away? You've got to get rid of that red light before any message can be sent.
 
S7Guy

Thanks for the reply...

Update.. the red light has gone now. It was a wiring problem.

I've configured the FB3 with the following info:
REQ - I0.0
LADDR - 272
DB_NO - 50
DBB_NO - 0
LEN - 40

If I understand this correctly I should be sending 40 bytes of information starting at DB50.DBB0 when I0.0 is true. The LADDR is the starting input address of the CP340 unit.

My DB50 is set up with 10 DWORDS that have the values...
DWORD 0 = 5200
DWORD 4 = 5252
DWORD 8 = FE01
DWORD 12 = FC03
DWORD 16 = FB04
DWORD 20 = FF00
DWORD 24 = BF40
DWORD 28 = FE01
DWORD 32 = FF00
DWORD 36 = AAAA

The first 52,52,52 tell the motor to expect incoming data.
The rest of the double words have their respective opposites attached to them as part of error checking by the motor. ie. 01 opposite is FE. and 00 opposite is FF etc.

The final AA AA is to tell the motor that the transmission has stopped.

When I trigger I0.0, the transmit and receive led's on the CP340 flash 7 times. ie. the amount of times its set up to retry transmission.

The motor doesn't do anything.

I've connected the CP340 into hyperterminal to see what I was receiving and the strange thing was that I was only receiving 1 ASCII character every time it transmitted (instead of receiving all the data block). This makes me think I haven't set up the transmit part of the code correctly (ie. FB3)

Any ideas?

Cheers

JT :)
 
Right... another update...

I've found that I can configure my CP340 card in ASCII mode and then monitor the output via Hyperterminal and it sends out the right string.

The only problem I've got now is that ASCII mode only goes up to 9600 baud and my motors run at 19200. Is there any way of increasing the ASCII baud rate? The motors are fixed.

OR.. I've noticed the 3964(R) protocol does go up to 19200 but when I select that, all I get in hyperterminal is a load of gibberish. Unfortunately, I know very litte about the ins and outs of various protocols. Is there a way to send the same information as ASCII but via the 3964(R) protocol??

Cheers

JT :))
 
Right.. according to Siemens Tech Help, its impossible to get the CP340 card to talk ASCII at 19200 baud.

They also say they don't know what I'm on about when I asked if it was possible to send out the same info via the 3964(R) protocol.

I then asked if there was a Siemens card that would send ASCII out at 19200 baud and they haven't got back to me.

Does anyone else know the answer? (I don't particularly trust Siemens tech help as they tend to say anything that will get them off the phone and enable them to stick the support ticket in the 'Done' bin)

Cheers

JT :)
 
S7Guy

Does it support ASCII at 19200 baud?

I only bought the CP340 because my supplier (Parmley Graham) said that it support ASCII at 19200....

They said that the CP341 was overkill because the baud rate for that was up in the 70k's

Cheers

JT
 
S7Guy

Thanks for that mate.

I'll have to fork out for one of those then!!

It amazes me how Siemens can charge £700 for a comms card and you can buy one from Mitsi for £30 that does the same thing...

Someone, somewhere, is getting very very rich

JT
 
Johnny T said:
S7Guy

Thanks for that mate.

I'll have to fork out for one of those then!!

It amazes me how Siemens can charge £700 for a comms card and you can buy one from Mitsi for £30 that does the same thing...

Someone, somewhere, is getting very very rich

JT
&700 for a cp340? you must be fooled by somebody.
 
Stanley

You're right, just priced up the CP341 from Parmley Graham and its £581 which is still a hell of a lot for a 232 comms card in my book...

Cheers

JT :)
 
Johnny T said:
Does it support ASCII at 19200 baud?

Yes, a CP341 does support ASCII at 19200 baud, the baud rate is selectable in the protocol properties (same as the CP340)

Johnny T said:
I only bought the CP340 because my supplier (Parmley Graham) said that it support ASCII at 19200....

They said that the CP341 was overkill because the baud rate for that was up in the 70k's

They lied!

Paul
 
Paul,

Your right.. although in fairness to them I've just phoned them and explained the situation and they'll give me a credit note for the CP340 and swap it for the CP341 if I give them the extra £300.

JT :)
 

Similar Topics

I am working with an Emerson CPL410 PLC that is connected to a Siemens AI 8xU/I/RTD/TC ST (6ES7531-7K00-0AB0) via Profinet (and a Siemens Scanner...
Replies
2
Views
1,537
Hi all, Now I am working with Sicam P50 multi function meters. It have 2 sets of Analogue outputs. I want to know how we can check its working or...
Replies
0
Views
1,514
Hi Guys, We had a siemens 6es7138-4cb11-0ab0 "Power Monitor" module either fail, and/or lose its configuration today. According to the manual, it...
Replies
0
Views
1,980
For one of the projects, Customer has Profibus Network as below, Profibus Master 1 - PRM Module (Schneider) addressed (1) Profibs Master 2 -...
Replies
0
Views
3,336
Hi there. I'm new to the Siemens world. I'm trying to set up the PLC using the STEP 7 Software. Ultimately, after I've created a configuration...
Replies
8
Views
12,543
Back
Top Bottom