V
Hello Everyone,
I am currently working on a project to log data from two serial ports. The serial ports are connected to two PLCs (Scada devices). Serial port-1 is connected to the Master PLC and Serial Port-2 is connected to the Slave PLC. I have a USB to two port serial converter device connected to my laptop.
I want to create a "C" program in Linux that can take data from Port1 (Master) log it in the proper format(MODBUS ASCII/RTU mode) into a file on my laptop, send it to Port2 (Slave). This process should happen the other way around also. I was successful in creating a program to act as a null modem. But I am clueless as to how I can get the data and store it in the right format in a file.
Can you guys provide me with suggestions and guide me in the right direction on how to do this? I did read the documents on the modbus website and I know how to detect the starting and end of characters in ASCII and RTU mode. But I am still confused.
I am currently working on a project to log data from two serial ports. The serial ports are connected to two PLCs (Scada devices). Serial port-1 is connected to the Master PLC and Serial Port-2 is connected to the Slave PLC. I have a USB to two port serial converter device connected to my laptop.
I want to create a "C" program in Linux that can take data from Port1 (Master) log it in the proper format(MODBUS ASCII/RTU mode) into a file on my laptop, send it to Port2 (Slave). This process should happen the other way around also. I was successful in creating a program to act as a null modem. But I am clueless as to how I can get the data and store it in the right format in a file.
Can you guys provide me with suggestions and guide me in the right direction on how to do this? I did read the documents on the modbus website and I know how to detect the starting and end of characters in ASCII and RTU mode. But I am still confused.