Alvi
I tried to use an DS18B20 temperature sensor on arduino mega but i've problems with the code and function block and during the update on arduino i've always the same error:
 
Compiling .st file...
plc_prog.st:3-5..3-31: error: Bit size of data type is incompatible with bit size of location.
1 error(s) found. Bailing out!
Error: Couldn't find LOCATED_VARIABLES.h. Check iec2c compiler output for more information
 
I tried to connect the input pin on digital pin and analog pin but i've the same problems
Someone can explain me how works this function block?😅
My targhet is read the temperature by sensor on arduino and communicate by modbus rtu at another device.
Immagine 2023-03-15 194302.pngImmagine 2023-03-15 194809.png
 
thanks a lot
Reply 0 0
thiagoralves
PIN must receive the pin number where the sensor is connected, not a located variable
Reply 1 0
Alvi
Thanks Thiago, with pin number everything works good 😃
Reply 0 0
Reply