1/8/2010 4:52 PM | |
Joined: 1/17/2007 Last visit: 8/21/2024 Posts: 1545 Rating:
|
You keep asking how do I communicate over RS485. But as I have already said that is not really the right question to be asking. It is very easy to communicate over RS485 (or any serial interface for that matter), but you have to know what protocol to use. You can easily send / receive ASCII data over RS485 by using any of the serial CP's (e.g. CP341, CP441). Firstly you would have to parameterise the CP to use ASCII point-to-point interface. To do this you would have to load in the point-to-point parameterisation software. It is available to download at:- PTP Parameterisation software Once you have set the CP to point-to-point ASCII communications you would use the correct SFC/SFB for the CP you are using to send / receive data. The CP341 uses P_SND_RK and P_RCV_RK to send and receive data respectively. The CP441 uses BSEND and BRECV to send and receive data respectively. However, I think just sending ASCII data will not do the job for you. The vacuum pump will expect to see or give out data in a specific format (this is the protocol that I speak of). How does the vacuum pump know when to send it's data? Does it do it cyclically or in response to some for of request? Again these questions are catered for in the protocol. Do you have any documentation on the vacuum pump controller? |
Last edited by: smiffy at: 1/8/2010 4:53 PMProgramming today is the race between software engineers building bigger and better idiot proof programs, and the universe producing bigger and better idiots. |
|
This contribution was helpful to
1 thankful Users |
1/11/2010 12:50 PM | |
Joined: 5/28/2008 Last visit: 7/15/2024 Posts: 1343 Rating:
|
Hi, I agree with smiffy that pump maybe has a protocol like Modbus or USS or anyting else. Then it would be easier to handle because of an existing library. But appart from that, you can handle communication via RS485 Communciation Modul by the operations SEND_PTP and RCV_PTP. For configurating the port, you can use hardware configuration and enter there fixed parameters like baud rate, parity and so on. There you can also parametrize conditions for sending and receiving messages. If you like changing these configurations during runtime, there are the operations PORT_CFG, SEND_CFG and RCV_CFG. For sending and receiving messages you need a buffer, where your data are located. The order of data in the buffer must according to protocol whatever your pump except. Mostly it has a function code, some starting address, the relevant data and maybe checksum. The answer from pump is in the same order and has to be analyzed. The datatyp is not important for sending and receiving. Here is an application Example , that can helps you. There is RS232 Modules used, but the functionality is the same like RS485. [url]http://support.automation.siemens.com/WW/view/en/38471716[/url] regards |
Follow us on