Chas
I am trying to read analog pin #34 on my ESP-32 board. I would assume that the data type is an integer. But when I transfer it to the ESP-32 board an error pops up and says :
Bit size of data type is incompatible with bit size of location.
In section: PROGRAM ESP_example_01_I_O
0049: ANALOG_IN AT %IX0 : INT;
 
I have tried every variable type and the only one that works is BOOL. But this does not make any sense since it should vary.
 
I have made an Arduino sketch an uploaded to the same pin_34 and displayed the value using analogRead. The number that comes back varies from 0-4095.
 
What am I doing wrong to make the OPEN PLC work?
Reply 0 0
thiagoralves
Analog inputs are at %IW locations, not %IX locations. In IEC code, X stands for bit, where W stands for word.
Reply 0 0
Chas
Thanks- I should have caught that myself. I went and tested it both ESP32 board 12bit and UNO 10 bit. It works well now.
Analog inputs are at %IW locations, not %IX locations. In IEC code, X stands for bit, where W stands for word.
Reply 0 0
Reply