J
Hello,
I am fairly new to Eclipse and Java, however I have an application at work where I need to read about 2000 modbus registers from one of our PLC's, and store it in a text file. I then need another program to write these register values back to the PLC on request.
I have the reading from the PLC into a file working correctly using the Jamod library, however I can not get the writing working. I cant find any examples of write multiple registers either.
Basically I am just wondering if anyone knows of anywhere there is a specific example of using the "WriteMultipleRegistersRequest" function/method/class etc, that would be great.
I have the program reading in each line of the file, and breaking the line up into variables. I know the number of lines etc, its just the part of storing each of the variables into a usable format for this WriteMultipleRegistersRequest function to use, I am having problems with.
I have defined a Register[] array, and created a new array, however I am not sure how to populate each position of the array with the integers I have from my file.
I assume that once I have done this, I basically can run the trasaction, and it will write the contents of the array to the PLC, starting at the modbus address I specify - and stopping when it reaches the end of the array?
If anyone is able to help and show me how I can populate the array, or whatever I need to populate, with each integer I am reading off the file, that would be a huge help.
Do I even need to define a Register[] array? If not, how do I put my values into something usable for this WriteMultipleRegistersRequest to use?
Any help would be appreciated. I have only done a touch of java when I was at uni, and havent used it for about 7 years.
Regards
James
I am fairly new to Eclipse and Java, however I have an application at work where I need to read about 2000 modbus registers from one of our PLC's, and store it in a text file. I then need another program to write these register values back to the PLC on request.
I have the reading from the PLC into a file working correctly using the Jamod library, however I can not get the writing working. I cant find any examples of write multiple registers either.
Basically I am just wondering if anyone knows of anywhere there is a specific example of using the "WriteMultipleRegistersRequest" function/method/class etc, that would be great.
I have the program reading in each line of the file, and breaking the line up into variables. I know the number of lines etc, its just the part of storing each of the variables into a usable format for this WriteMultipleRegistersRequest function to use, I am having problems with.
I have defined a Register[] array, and created a new array, however I am not sure how to populate each position of the array with the integers I have from my file.
I assume that once I have done this, I basically can run the trasaction, and it will write the contents of the array to the PLC, starting at the modbus address I specify - and stopping when it reaches the end of the array?
If anyone is able to help and show me how I can populate the array, or whatever I need to populate, with each integer I am reading off the file, that would be a huge help.
Do I even need to define a Register[] array? If not, how do I put my values into something usable for this WriteMultipleRegistersRequest to use?
Any help would be appreciated. I have only done a touch of java when I was at uni, and havent used it for about 7 years.
Regards
James