Serial communication

cnc

Member
Join Date
May 2007
Location
Göteborg
Posts
4
I am a biginner on PLC programming.
I have a CP340 on the rack and
I need to test a Serial communication with Hyperterminal on the PC.I am going to use standard ASCII codes.I found a sample project CP_340_ptp_Com_CP34x but I Don't Know how to use it.I appreciate all the help I can get!! Thanks**
 
I guess since you found the sample project that you installed the software that came with the 340 on your programming pc. Then the module should be loaded in the HW config. Then if you are going to send data to a device through the 340 you need to pull the p_send block from the sample project into your active project and download it. If you are going to recieve data from a device through the 340 you use the p_rcv. This allows you to use these blocks in your fbs or however you choose in the project. These blocks provide all the information you need to know in order to use them by looking at the help files(click on the block and press f1). Also, be sure that you have the 340 configured in the HW config for the correct communication parameters. And since you are going to use ascii codes make sure it is set to ascii in the config. Hope this helps.
 
Cp 340

I Managed to Maintain communication with Hyperterminal on the PC.How can I read ASCII value continual from a file that look like this:

3832104|09/03/2007|11:41:19| 2.3|134.5| g7cm|
 
communication with CP 340

Hi!

I managed to maintain communication with CP 340 and S7 program. I read this line in to the DB.



3832104|09/03/2007|11:41:19| 2.3|134.5| g7cm|



Article nr | date| time| weight| angle|….



I have to separate the weight and angle. I know how to do this in C# but not in S7 environment.



Regards

cnc

 
Ok, you are using the pipe as a delimiter. I would set up a loop that ripped through the message one character at a time looking for this delimiter. When I found the third one, I would copy the data for the next two fields to wherever I needed it.
 

Similar Topics

Currently,we are facing the communication go through with 422 tx+ and tx-. Mitsubishi fx5u series is used and using command rs2. But the package...
Replies
0
Views
81
I have wasted a week trying to figure out how to connect an SLC5/03 with my laptop. I do not have and can not Buy the 1747 UIC and PC3 cables. I...
Replies
14
Views
2,463
MELSEC A RS422 (25pin) <> iQR C24 Serial RS232 (9pin) - Simple PLC Communication Communication from a MELSEC-A Series CPU (RS-422 – DB 25 Pin)...
Replies
4
Views
988
Hey guys, I have a problem reading weighing data from AND AD4406 with OP-05 RS-232C Relay and Control input using Rockwell PLC Micro820. I already...
Replies
0
Views
920
I have a zebra barcode scanner connected to a ******* device master UP. They are connected by RS232. By checking the serial logs on the device...
Replies
3
Views
1,116
Back
Top Bottom