|
@@ -85,30 +85,15 @@ Error_manager Snap7Clamp::updata_receive_buf()
|
|
|
{
|
|
|
std::unique_lock<std::mutex> t_lock1(m_receive_buf_lock);
|
|
|
std::unique_lock<std::mutex> t_lock2(m_data_lock);
|
|
|
-// static unsigned short heart;
|
|
|
+
|
|
|
memcpy(&plcData, m_receive_buf_map[0].mp_buf_obverse, m_receive_buf_map[0].m_size);
|
|
|
|
|
|
Error_manager ret = Error_code::SUCCESS;
|
|
|
-
|
|
|
-// if (heart == m_heart) {
|
|
|
-// printf("---Debug %s %d : heart not change %d ---> %d\n", __func__, __LINE__, m_heart, heart);
|
|
|
-// ret = Error_code::FAILED;
|
|
|
-// }
|
|
|
-// m_heart = heart;
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
Error_manager Snap7Clamp::updata_send_buf()
|
|
|
{
|
|
|
- std::unique_lock<std::mutex> t_lock1(m_send_buf_lock);
|
|
|
- std::unique_lock<std::mutex> t_lock2(m_data_lock);
|
|
|
-
|
|
|
- if (plcData.pingpong != 0) {
|
|
|
- plcData.info();
|
|
|
- }
|
|
|
-
|
|
|
- memcpy(m_send_buf_map[0].mp_buf_obverse, &plcData, m_send_buf_map[0].m_size);
|
|
|
-
|
|
|
return Error_code::SUCCESS;
|
|
|
}
|
|
|
|