rodrigo_rolle
Hello!

I'm using OpenPLC with ESP8266 board (on Windows host). I was able to set up everything, the system is running. My problem is: when I load the Hello World project using the input %IX0.0, the LED output %QX0.0 is always high. It happens because the pin D4 (that corresponds to %IX0.0) is always high, no matter what is connected to the pin. I just moved to another input port and the project worked propperly. Is there something that I have to change in the firmware in order to get normal response from pin D4?

Thanks in advance!
Rodrigo
Reply 0 0
rodrigo_rolle
Thanks a lot!
I separated the loops for digital inputs and outputs, so that I can read all outputs while updating only the inputs I want:

for (int i = 0; i < 8; i++) //set number of inputs to be updated by Simulink
      {
        if (bool_input[i/8][i%8] != NULL) *bool_input[i/8][i%8] = plc_data->digitalIn[i];
        }
      for (int i = 0; i < DIGITAL_BUF_SIZE; i++)
      {
        if (bool_output[i/8][i%8] != NULL) plc_data->digitalOut[i] = *bool_output[i/8][i%8];
      }


I'm able to get all outputs (actually I want to compare ESP outputs to Simulink ones) and it's working fine. My example is running perfectly for both sides.
One last (off-topic) question: how fast can I set my Task Cycle parameter on PLCOpen Editor while using ESP? You use 50ms for your applications... Can I set a lower value?
Reply 0 0
Reply