I am creating a java Desktop Application. I want to write the data into the register of a device. As per my project document, size of the register is 16-bit long. I am using EasyModbusJava jar to write data into the register. Till now I have written some integer data on the device's register. Now I want to write the ascii of 32 characters at 16 consecutive register(2 Character per Register). But issue is that the available methods for writing on the registers takes int as an argument. If am passing the short(int) array of ascii values then it needs to be typecast which means that it will no longer be acquiring the size of the short data type.
There are two methods are available to write into the registers address.
For Writing at Single Register
public void WriteMultipleRegisters(int startingAddress, int[] values){...}
For Writing at Multiple Register
public void WriteMultipleRegisters(int startingAddress, int[] values){...}
Suggest some way to resolve my issue.
Below is the link of the jar file documentation which I am using in my project. Docs of Jar File.