CyrusLinux
Hi =) ,

I would need help calculating the temperature in celcius of the LM35 DZ temperature sonsor.

In Arduino language, I use this formula: Temp = (5.0 * volt * 100.0) /1024.0.

Except that I adapted this formula for openplc.

from the data in the datasheet, I find this:  Temp = (65535 * %IW100.0*0.01)/1024.0

 is it this ?

Amicably,
Quote 0 0
thiagoralves
I don't know this sensor, but judging from the Arduino formula, the correct way to translate this over to OpenPLC (assuming you're still reading it on an Arduino board connected to OpenPLC, or any other board with 5V ADC):
Temp = (5.0 * volt * 100.0) /65535.0

From the shape of this formula, this is actually giving you the input reading voltage multiplied by 100 (assuming that "volt" is actually the raw reading number you're getting from %IW100.0)
Quote 0 0
CyrusLinux
Perfect it's good!

I have another question but I do not know if it will be for you or on the ScadaBR site but I said it, it is:

When I am on ScadaBR, I have to create a Point (example: Led, button , etc) but I don't know how to calculate or determine this value (offset 0-base), I have however looking on the openPLC site in the reference part but this part remains still obscure for me, do you have documentation for better understand this configuration part? According to my research would be the modbus protocol of the DATA part but after I find nothing that would allow me to understand how to determine the choice of the value to indicate on the ScadaBR site.

Thank you for your help.
Quote 0 0
thiagoralves

That’s easy. For digital inputs and outputs just use the formula:
%QX[major][minor] or %IX[major][minor]
Modbus Address = 8*[major] + [minor]

So, for example, %QX100.3 becomes Coil 100*8+3 = 803

For analog inputs and outputs, the mapping is linear, i.e. %QW103 = Holding Register 103

Quote 0 0
CyrusLinux
Oh super easy !!

I love it, I am going to have fun with my motors and proximity sensors. This software is really practical, I will find out which automatons are compatible with your software in order to optimize my project. Thank you very much for your responsiveness and have a good evening😉
Quote 0 0