git commit -m "first commit for v2"

This commit is contained in:
2025-12-29 16:21:22 +07:00
commit aa3d832d5c
1807 changed files with 307078 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
#include <ros/ros.h>
#include <boost/thread.hpp>
#include "delta_modbus/delta_modbus_tcp.h"
#include <diagnostic_msgs/DiagnosticArray.h>
/**********************************************************************
* MAIN
***********************************************************************/
int main(int argc, char** argv) {
ros::init(argc, argv, "test_delta_modbus_tcp");
ros::NodeHandle nh("~");
std::string node_name = ros::this_node::getName();
ROS_INFO("node_name: %s", node_name.c_str());
DELTA_NAMESPACE::PLC *plc = NULL;
std::string IP = "192.168.1.5";
int PORT = 502;
plc = new DELTA_NAMESPACE::PLC(IP, PORT);
plc->connect();
uint16_t D101;
bool M[2];
plc->getD(1, D101); plc->mulGetM(1, 2,M);
ROS_INFO("D1 %d M1 %x %x", D101, M[0], M[1]);
ros::spin();
plc = NULL;
delete(plc);
return 0;
}