Com between VB5 and Siemens CP340 Modbus

B

Thread Starter

Balou

I got the Siemens protocol: FB1 (internal MODBUS), FB2(internal receive RS232), FB3(internal send RS232), DB13(internal MODBUS), DB17(bolc MODBUS used), DB18(bolc MODBUS receive), DB19 (bolc MODBUS send).
This protocol is running for one application wrote on C++. I need to rewrite this application under VB5. But first, I tried to write a simple source (VB5) using the control MScomm, but nothing work : I don't send/I don't receieve.

Do I need to use a special function or convertion to be able to set up the protocol MODBUS through VB5 ?

Anybody is welcome to give me some suggestions or maybe some sources (VB5).

Any information concerning the set up of the SIEMENS Modbus blocs FB, DB, will be so helpfull.

Thanks in advance.
Balou
 
H

Hakan Ozevin

CP340 is a low cost module that is used for simple communication tasks, like ASCII file exchange, or printer interface.
As far as I know, it does not support Modbus. If you want to use Modbus, you should use CP 341 and buy the loadable driver for Modbus or you can use CP340 and write your own protokol.

Good luck

+++++++++++++++++++++++++
Hakan Ozevin
 
First of all, thank you very much for your answer.

I have a S7-300 at home and I got for free a CP340. I just want to exchange some information
between my PC and my S7 through this CP340. You're right, forget about the Modbus.
Do you know how to write a protocol by yourself on S7 ? I personally don't know.
Could you help me ?

Thanks in advance.
Balou
 
H

Hakan Ozevin

You must have the configuration CD that is delivered with the CP340. With this package, you can configure the CP340 as a simple ASCII driver. In the package there are STEP 7 function blocks like SEND, RECEIVE with which you will make the data exchange with the CPU. For example, if you call the function block SEND, the CP340 automatically takes the data from the CPU and sends it to the serial port. You have to read the comm port of your PC and take the data in ASCII format. Of course using the PC you can FETCH and RECEIVE data too.
You will get more information in the manual which you can download directly from:

http://www4.ad.siemens.de/csinfo/livelink.exe/fetch/1137332/CP340_e.pdf?func=doc.Fetch&nodeid=1138427

Good luck
+++++++++++++++++++
Hakan Ozevin
 
Hakan,

Thanks again for your information. I don't have the CP340 configuration CD, because I didn't buy it, somebody gave this card.
I went to the web site www4.ad.siemens.de, I download this manual and printed it.
The chapter 9 is the most interesting, there is a programming example, but I don't have this floppy then I can't check this project.
Do you have it ? if yes, could you attach it with your answer.

Thanks for your support.

Balou
 
H

Hakan Ozevin

You can download it from Siemens product support web site.

Entry ID#:5666115

+++++++++++++++++
Hakan Ozevin
 
Top