CP340 Rs422 with CPU 317

njvr

Member
Join Date
Jan 2007
Location
vancouver
Posts
13
I am new to S7.
I am trying to send string from CP340 to my PC. A 422-232 converter is used at PC end.
But I coudn't able to do it. Anybody has sample program.
Thanks
njvr
 
Hello NIR;

I can only suggest you look at the different manuals for the CP340 from Siemens, on the following link:
http://support.automation.siemens.com/WW/llisapi.dll?query=cp340&func=cslib.cssearch&content=skm%2Fmain.asp&lang=en&siteid=cseus&objaction=cssearch&searchinprim=0&nodeid0=4000024&x=19&y=11
In the PTP manual for the CP340 (CP340_e.pdf) you have expalnations and examples for each function block required to establish connection with a point-to-point partner. Study it attentively.
Hope this helps,
Daniel Chartier
 
NVJR, you could also post the code you've already tried, and maybe the problem will be obvious. Sending data with the CP340 is pretty straight forward using the standard Siemens FBs.
 
Please fnd code which i tried

CALL "P_SEND" , "DB_P_SEND"
REQ :=TRUE
R :=FALSE
LADDR :=288
DB_NO :=10
DBB_NO:=0
LEN :=10
DONE :=#bDone
ERROR :=#berrir
STATUS:=#strStatus



In DB 10 I have a string 'ABCDEFGHIJ' which is 10 charecters.
The above code is in a function which is called by OB1. I read from manual that if REQ=true, then it will sends data only one time, after we have to reset.
When I am sending data from My PC RXD is blinking. When PLC is in run mode, TXD is blinks once.
SF LED is off if COM port is open.

Thanks
njv
 
njvr

I assume that the problem you are having is that this is only being sent once.

You did state that you read that the 'REQ' pins need to be true, that is correct, but the P_SEND function is triggered by a positive edge on the REQ pin, if you want this to work correctly you need to continually trigger the REQ pin.

You could use a 'clock pulse' to trigger this or some other form of logic that will trigger the block when the 'DONE' pin is true.

Paul
 
A couple of other notes: Depending on how you added the string in DB10, it could be that your data isn't initialized. Open a VAT tabel and look at the DB that way to verify this.

Also, I noticed you enterred DBB0 as the starting point. If you entered a string in the DB (as opposed to an array of CHARs), the actual characters in the string will start at byte 2. Do a help search on S7 strings and you'll see what I mean.
 
Thanks for your replies.

Today I installed S7 V5.3 SP3.
Then the following error I am getting CP340 module information

"Event 1 of 9: Event ID 16# F1C8:0701
IF 1: Transmitting the first repeat since error or negative acknowledgment has been detected Incoming event"

I am totally new to S7, can you send me some sample prog just to send string from CP340 RS422/485 module.

Thanks
njv
 

Similar Topics

Hallo, I have Tia Portal V16 and I'm upgrading an older machine. That machine has a component running on rs232. The machine has still the old...
Replies
7
Views
951
Hi all, i have a module from b&r automation and i am want to get the data from it, but the com port is already taken. Is it possible to monitor...
Replies
1
Views
1,156
Hi, I am planning to use the 300 series in redundacy by using two cpus, and IM153 modules in Profibus DP. I am having some problems with my...
Replies
0
Views
1,194
Hi, been looking everywhere for this info but cant find it. Does anyone know if the CP340 RS232 card supplies 5v to Pin 9. Thanks
Replies
2
Views
1,418
Hello, We have a Sartorius CP scale connected via RS232 to the PLC. All was working well but when the scale was replaced with a newer version...
Replies
8
Views
2,547
Back
Top Bottom