Sign in to follow this  
Followers 0
star123

Serial communication between Siemens PLC-1200 and Arduino

1 post in this topic

Hello Everyone, I want to have a serial communication using Siemens S7-1200 with CM 1241 (RS-232) and communicate with my Arduino. Here is the setup of the communication. I have 2 temperature sensor and one Led connected to my Arduino, and on the PLC side I have S7-1200 from Siemens and CM-1241. Arduino and my PLC are connected just by using Tx and Rx pin no handshake is done. I am sending the temperature data from both the sensor to the PLC. on the PLC side i decide when to turn on the Led connected to my arduino depending on the different temperature values. I have assigning a ID to both the sensors before sending out the data. This is how the transmitted data from Arduino looks like $AOPT_TEMP1_20_TEMP2_21 . So far its good, I am receiving serial data on my PLC using RCV_PTP (received data are placed on the buffer) and sending data using SEND_PTP. I have also implement a filter on the PLC which will only accepts the serial data starting with '$AOPT_'. Now, I want to receive the temperature value from two temperature sensor TEMP1 & TEMP2 and then control the Led. For instance if (TEMP1>TEMP2 ) then turn ON the Led else turn OFF. I am able to receive the data on the PLC from Arduino but now I don't know how to proceed with comparing the received information. How do i extract the only required data from the received buffer? Any suggestions will be highly appreciated. Thanks in advance....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0