Read Coil Analogic Output M103
@mohamed-dounnani I am sorry, but I don't understand. You should calculate a value using the formula and the result should be between 0 - 65535. Then you should write the value into the Analog Output 1 Modbus register. By doing this, the internal circuit in the UniPi controller will set the desired output voltage between the screw connectors AO and AGND. Then you should measure this value with multimeter to verify if the actual output is equal to the desired voltage you wanted to set. Have you done so please?
I calculate value using formula and when i select 6V that is my desired volt, that formula produce 2294. I take the result and I write it to Analog Output 1 Modbus register
When I select 0V, the formula produce 0, but when i measure the output with multimeter i measure 1.066 V
Ok @mohamed-dounnani, and what happens, when you write the value 2294 into the Analog Output 1 Modbus Register? What is the actual ouput voltage on the connector?
Ok @mohamed-dounnani, I tested it on my S103, which is basically the same as yours. Mine works with the same procedure I told you. I wrote value 2178 and got 5.678V as expected. When I write 0, the output is 0V.
To investigate further, I need several informations from you:
- What SD card image do you use?
- How do you communicate with the ModbusTCP server?
- If you write 0 to the register 2, what value from the register you read back?
Thanks in advance,
I use Raspbian Stretch
I communicate with node.js using a npm library.
If i wrote 0 i receive 0 as value
Ok @mohamed-dounnani, let's try one last thing. Can you read the value of register 1019? That's the settings of the Analog Output. It should be 0, which stands for Voltage output. 1 means Current output and 3 means Resistance measurement.
I receive 0, so is for Voltage Output
To be specific I'll explain how to calculate the value to write in the analog output register.
For determinator i use: (((3.3 * deltaRef) / 4095) * (1 + (VDev / 10000)) * 3);
DeltaRef is (vref / vrefInt), if denominator is 0 i change it in 4095.
For nominator i use: ((Vdesired - (VOffset / 10000)) < 0) ? 0 : (Vdesired - (VOffset / 10000));
Then i calculate nominator / denominator.
your calculations are in order. With the tests we did above, I am afraid you received a PLC with wrong calibration data. The calibration is a way how to ensure that when you set a desired voltage through Modbus registers, it will in fact set the correct voltage on the terminal connectors. The calibration process is one of many throughout the assembly of the unit. The calibration is done on our testbenches and it means you have to send the unit back to us. We sincerely do apologize for this.
Please send me (email@example.com) your number of order for this PLC and I will get back to you with further information.
Thank you very much,