Understanding output control at boot time.

barrys

New Member
This is my first post so please bear with me...
 
I was having trouble understanding why my output 8 would go on every time my board cycled.
I was using it (switched on and off) in a PLC program.  So, I cleared out the PLC program and still it would come on during boot and stay on unless I turned it off in my program.  This made no sense to me so I did all kind of analysis and gave up and called Wayne (the genius) at WC.  It seems that the WC goes through quite a bit to try to do the right thing with the outputs at startup which is complicated and can lead to what seems to be non-intuitive behavior.
 
The one that got me is that if you save any output states (with the "Save States" button on the output control page), the board will try to bring the output back to that state at startup.  I must have been showing off for friends and thought it was good to click that button -- duh!
 
So, after talking with Wayne, here's what the WC does at with the outputs at boot time.
1. Check to see if the outputs are set to inverted (like mine were for my cheapo relay board).
2. Restore any saved output states (saved with that "Save States" GUI button).
3. Set other outputs to real off (depending on the inversion setting).
4. Start running your PLC program which will likely do something with the outputs.
 
Wayne, if there's anything incorrect or misleading in here, let me know and I'll edit the original post.
 
Love the forum, love the WC...
 
If I remember correctly from my testing you also need to take into account output
state before the WebControl code executes. I assume uP I/O is programmable as input
or output and defaults to input at power up. So it floats high until WC code
configures it as an output and set WC configured state prior to user code being
executed.

The attached timing chart shows powerup. Trace 1 is the output of an external reset
controller used to insure external logic is held off during power cycle. Trace 2 is
output 1 of the WC. Trace 3 indicates when WC begins to enumerate the 1-wire bus.

CAI support can verify if this interpretation is correct.

/tom
 

Attachments

  • WindowVentilatorPowerUp.jpg
    WindowVentilatorPowerUp.jpg
    99.5 KB · Views: 10
Barry's relay board is zero triggering relay board.  To make that board working correctly in the PLC code so that when
SET OP1 1
WC will turn on relay connected to TTL output 1, user need to setup OUTPUT inverse on the OPx connected to the zero triggering relay inputs.
 
In 2.3.x WC8 board, firmware during boot will make TTL output stay float. This is done by internally pull up GPIO1 during boot.
Once the board is done booting, it will set the OPx states based on user saved states.  In most cases, user do NOT need to save state on TTL output.
However, if one did save state for the TTL output, WebControl will bring the output to that state once board finished booting.
 
WC8 2.3.x board specially designed to allow both positive triggering and zero triggering relay boards work with it.   To avoid problem false triggering the relay board, in the case of zero triggering relay, it is best to have relay board and WC8 sharing same power supply. In this way, when power supply lost power, both relay board and WC8 lost power, when power coming back, it will not false trigger.
 
For positive TTL level 1 triggered relay board, this consideration is not needed.
 
Back
Top