Bgeneral
Hi OpenPLC, I built a circuit board for outputs of the Arduino Mega 2560. I followed the I/O numbering documentation on this site.  
All works great, but when the Arduino board first powers up, outputs 20(SDA/%QX0.6) and 21(SCL/%QX0.7) go high for one half  second (1/2).
I need to use all of the outputs that OpenPLC assigned. Is there a way to keep these outputs from going high during the power up cycle? Thank you.
Reply 0 0
thiagoralves
This could be something related to Arduino bootloader or something else. The first thing OpenPLC does at initialization is turn off all outputs 
Reply 0 0
Bgeneral
Thank you for replying. So, at this point, you have no idea where to look or how to find a solution?  The Arduino I am using, Mega 2560 R3 ATmega2560-16AU Development Board Geekcreit for Arduino.  Also states "Works with Arduino boards".  Ordered from Alexnld.com. This is the only Arduino I could find that does not have built-in headers.  OpenPLC seemed to connect to this board and it loaded what looked like a library, but did not show DONE.  I checked the com port and board type, it was correct. I used the Arduino IDE and loaded a blank sketch and then I was able to load the OpenPLC program as it displayed DONE. As I said It works as expected, but the two(2) outputs go high and low. Thank you.
Reply 0 0
thiagoralves
This could be an issue with this particular board or the bootloader that it uses. You can try removing those pins from the I/O Config list in the upload dialog, which will make OpenPLC completely ignore those pins. If the pins are still going high/low, then most certainly the issue is not with OpenPLC   
Reply 0 0
Bgeneral
Ok. I'm not sure how to remove the two pins from the I/O Config list. Is this the area at the top of the OpenPLC software where you can set names, class and type?
I loaded the same program into an Official Arduino Mega 2560 R3. With the inputs tied to ground through a 10k resistor and with an LED connected to Output pin 20 and powering the board I get a dim LED for 8 seconds and after that time period the output starts working normally. I programed pin 20 to go high when pin A14 goes
high in the ladder program. In this 8 second window the output pin 20 will not go high with input A14 high until the 8 seconds time is over. I followed the I/O numbering system as you show in the 2.4 physical addressing for Mega/Due. Is there a way to clear the cpu and reload the bootloader that would not create this problem? It appears that both Arduino boards from different manufacturers are having the same issue. As you know a PLC can not have outputs that can turn on during a power up cycle. Can you do a test  to see if you get the same problem? I hope we can work together on this problem as all my work will be in vain if this issue can not be fixed.
Please let me know if you will be able to look into this? Thank you again. Bill
Reply 0 0
Bgeneral
Ok. I removed the Outputs (SDA) %QX0.6 and (SCL) QX0.7 from the I/O config list. When I power it up the two outputs go high and back to low. I guess the I2C is trying to see if there is any communication on these two lines. So can you look into this I2C and let me know if it indeed can be removed? 
Reply 0 0
Bgeneral
Well this is a work in progress. I connected the Official Arduino Mega 2560 R3 board to my circuit board and both of the Outputs (SDA) %QX0.6 and (SCL) %QX0.7 did go on and back off. This is with the two outputs in the I/O configuration list removed. We now can conclude it must be the two I2C lines trying to see if there is any information on these two lines. Now, how do we remove this testing that the I2C is trying to do? As I mentioned before you setup all the 2.4 physical addressing for Mega/Due. Have you not tested this in any Arduino boards? Looking forward to your knowledge in this field. I will also do some research in this area. Thank you in advance. 
Reply 0 0
thiagoralves
No, I didn’t test all pins. This seems to be some default behavior of the Arduino board. As I said before, removing the pins from the I/O Config list takes away OpenPLC control from them, so OpenPLC is not the one driving them high 
Reply 0 0
Bgeneral
Yes I understand that it is not OpenPLC that is making the outputs go high. Are you willing to look into this problem and a possible fix? Are you still backing OpenPLC? Has this never come up before? 
Reply 0 0
thiagoralves
I don’t think I can do much on this. For a final test, you could upload a blink sketch using Arduino IDE to verify that those pins indeed go high during boot up. If they do, then you can check with Arduino guys if there is any possible solution since this is more tied to their platform than to OpenPLC 
Reply 0 0
Reply