thiagoralves / OpenPLC_v3

OpenPLC Runtime version 3
1.02k stars 421 forks source link

Trying to load blinky program on to chinese MEGA 2560 board #202

Closed BikiniBottomsVeryOwn closed 1 year ago

BikiniBottomsVeryOwn commented 1 year ago

I tried loading blinky onto my offbrand MEGA 2560 board from AliExpress.

Got this error when I tried to upload program to board via the default Arduino Mega setting:

plc_prog.st:3-5..3-28: 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

BikiniBottomsVeryOwn commented 1 year ago

I also mapped the blink variable (bool) to pin number 2 on the mega which is an analog output.

thiagoralves commented 1 year ago

As the error clearly tells you, bit size of data (BOOL) is incompatible with bit size of location (INT). You cannot assign an analog output to a BOOL variable.