WC8 questions

bedi

Member
Hi, I need some help/have questions regarding WC8.
I purchased the board with firmware 3.03.19; did some PLC programming; it looks like most of the stuff work except few things.
In order to debug the program I need to understand few things:
 
1. In my application, 2 events occur simultaneously (heater ON, then current sense that heating element is ON) so 2 notification emails should be sent almost at the same time. The program send one email for each event.
In fact, I get 2 the same emails with delay of 5 seconds one from another (that from the current sense); I do not get email that heater turned ON. It is strange, because that email should be sent at the same time with switching OP1 to 1 (turning the heater ON); it is just one line after another in PLC program. In fact, I do get OP1 to 1 but do not get the email!
Here is that portion of the code:
    BNZ RAM1 LOOP1  
    SET RAM1 1  
    EMAIL EM1   
    SET OP1 1  
    DELAY 2000   
    GOTO LOOP1
There is no other place in the code where OP1 set to 1. But SET OP1 1 line works, whereas EMAIL EM1 does not!
All emails setup correctly; test emails work (I get email when I test EM1). In the manual I read that WebControl internally only has queue for up to four emails; If PLC logic made such a call too fast, the newer email will overwrite the older ones in the queue. But there are only 2 emails, so in theory it should work?
 
2. Output 1 controlled by PLC program. If I set the status of output 1 manually via web interface, will it terminate the PLC program? If not, how can I make the PLC program to take into account that I manually changed OP1?
 
3. If there any command to re-boot the Webcontrol from internet? There is no such possibility in a web interface; it would be nice to have one. I understand there is a command to reboot in PLC command system but I am talking about re-booting via web interface or command from outside (internet).
 
4. In the spec there is written that the maximum current that can be sourced or sinked by one of these outputs at a time is 20mA. But in fact, outputs cannot even drive ULN2003 input! To control relay from output 1, I had to use MOSFET.
 
5. I tried to use UROM1 value as a non-blocking delay but it did not work: that entry was deleted from the program after uploading into PLC.
Here is what I tried:
TSTEQ IP1[UROM1] 1
I set a number in urom1 in general setup page. But after uploading into PLC, [urom1] erased from the program; it became: TSTEQ IP1 1
Is that normal? If yes, please add possibility to set the delay as urom1 variable.
 
Thanks!
 
 
EMAIL sending is not instant, although it did capture all the values when email is queued.  The reason the email is not instant, because PLC logic queued email, then move on to next line. Email queue then started sending max half second later. When email sending is slow, it could take longer time to send out email.
 
From the code section, it seems there is only one email sending. Could you please also show us the code of the other email sending code?  If you don't want to show all the code to everyone, you can send it to us directly at [email protected]
 
There is a later firmware for your board. Would you please update the firmware to your board? Although email logic is not changed in newer firmware, it is worth to get to the latest one, so that the board runs on latest firmware.
 
manually set output value will not stop PLC operation, however, PLC change it without really care if user changed it, unless in your code, your logic reads the output value first and handle it that way.
 
TTL output current is fixed by the output buffer IC, that is per IC manufacture. If ULN2003 can not drive relay, you will need to check the relay current requirement.
 
UROM value can be referenced, but not being used as a variable to index others.  So that non-blocking delay does not work in that way.
 
Since you are a new member on this forum, it does not allow you to use the email system yet.  We tried to send this following direct message to you but the forum does not allow.
Code:
It is not likely a firmware problem, since EMAIL queuing logic does not have bug -- we checked that again. (Older firmware 3.02.18 at hw rev 2.2.2 board had email queue problem, but that was fixed in 3.02.19.  hw rev 2.3.x board firmware does not have that problem from its initial release 3.03.19.) 
We like to see your complete PLC code, that can help us to understand the problem you have experienced.
 
Hello CAI Support,
 
Thank you for quick reply!
I think that the problem with emails caused by some noice/spike once the relay turned ON. It controls water heater that has internal temp control inside. So if the water was cold, the heating element turns ON at the same time as the voltage applied to the heater (when OP1 turns the relay ON); at that time I got these 2 the same emails from current sense. But if he water was already hot at the time when OP1 turns relay ON, I get the correct notification that the heater turned ON. Then, when heating element turns ON by internal temp switch, I get another notification about that.
So I changed the PLC code so that it would be more immune against noise: I added delays to each input: TSTEQ IP3[500] 1. This 500ms delay should help. If I still see problem, I will send you email with the complete code.
 
Regarding output current issue: ULN2003 can drive relay. The problem is that the board cannot drive ULN2003. When I connect input of ULN2003 to output of the board, that output drops from 5V without load to about 1.5V Therefore I had to use mosfet to drive the relay (Mosfet does not need current from output, so it works). Not a big deal, bit worth to mention that outputs cannot drive current up to 20mA
 
Please explain in which cases I can use UROM values? Please add the ability to use that variables for delays.
 
I also asked about possibitity to re-boot the board by command from outside (via Internet). is that possible?
 
Thanks!
 
You can't directly reboot the WC8 but if you hit Network update button the board reboots. You don't have to make any changes.
I've used that method multiple times.
One thing it does not do is power cycle the 1-wire bus so if it is in a weird state still need to cycle power.
I'm using older firmware so 1-wire behavior may be different with the latest and greatest FW.

I've never used the WC8 to drive a darlington array directly.
I bet things are OK and you are just seeing the base/emitter voltage of the input transistor.
I typical use SSRs for AC power control, easier to drive then a mechanical relay and being zero crossing generate less noise.
Use a 7407 to buffer the WC8 and power the relay from 9 or 12V.
A lot of the Chinese SSRs don't like control voltage below 5V or so even though the nameplate says 3V.

/tom
 
Hi Bedi,
 
If you do not have current limiting resistor between TTL output and your ULN2003, it will basically short output through a diode to the ground. Luckily, it did not burn out yet.  You will need to have a current limiting resistor between TTL output and ULN2003 input, so that max output current is within the limit of the  WC8 spec.  Most ready to use relay board out there having current limiting resistor already.  They are very reasonable priced.
 
We do recommend to update firmware to the latest one, so that when we support, we can be sure the PLC code running at customer site is the same as the boards running in our lab.
 
Guys, I do understand in electronics :)
What I see is not base-emitter voltage.
 
Will you please check ULN2003 datasheet? You will read the following:
 
"ULx2003A devices have a 2.7-kΩ series base resistor
for each Darlington pair for operation directly with
TTL or 5-V CMOS devices."
 
So there is no need in additional resistor there if output is capable of driving of TTL load. Apparently, it does not.
 
Hi Bedi,
 
You are correct the ULN2003A datasheet saying 2.7kOhm input resistance. I am sorry I did not read that careful enough.
 
WC8 output buffer IC is 74LV245 chip with direct wiring to the TTL output terminals.  That is marked as U5 on board.
74LV245 is made by TI. Its TTL output is powered by 5V.
Its datasheet states the limiting current is 35mA.
 
Is that possible to measure what kind of current each TTL output sending to ULN2003 input?
Another thing, did you removed J9 jumper on board?  That jumper is designed to provide shut off U5 output during power on. This is a new feature in 2.03.x boards.
 
I cannot measure anything now since that board is thousand miles away (in Hawaii).
I purchased 2 boards, for 2 projects. When I used it for a first time (first board), I found out the issue with output current, so I put mosfet; it worked.
 
The issues with emails  happen with the second board; that time I put mosfet to drive the relay from the beginning; I did not play with ULN2003 array again.
That board is also not near me at this time and it is impossible to disassemble the project to find out what the current is.
 
74LV245 does capable of driving 35mA, based on datasheet. It is strange why it did not work with ULN2003 but I cannot re-test it again. May be that particular board has issues.
I did not remove/insert any jumpers. May be there was no jumper there?
 
CAI Support, you can check this easily, just put 2.7k resistor  between output and ground and see if that output holds 5V. It should work unless there is some problem with enable input of 245 chip.
 
Hi   Bedi,
 
If J9 missing or removed, during power on, the output will be on and off once. If you did not experience that, that means J9 is not missing.
We have a customer even drove a little motor directly from the TTL output, which we did not recommend, that worked till the TTL output gate burnt out. In your case, mosfet working means the TTL output gate is fine.  We have a relay board here for testing, which has a 1K resistor with a transistor driving the relay, and that is working fine.  Even the load is 1K, the current is less than 5mA, for 2.7K, the load is like 2mA or so, way below the chip spec.
 
Putting components together to drive relay, that means you are a capable person with electronics. However, we just do not have ULN2003A to test it.
 
Are both boards running the same PLC code?  If possible, you can send us the PLC code, so that we can take a look to see what could be the cause. If the mosfet caused problem, it might be the power supply not powerful enough.  Although boards working fine most time, if power supply is marginal, it could easily have power jitter impacting board CPU, or brown out caused CPU to restart.  In our lab, we tested with relay drawing current from 5V on WC8 board, that did not cause any problem in our tests. We have heard some customers had problems with their power supply, they thought the problem was the board first. Once they replaced with a better power supply, all the problems fixed.
 
Thanks, I am very competent in electronics. I know that power supply is the first most important thing. This is not the case here.
MOSFET does not cause any problem, it works.
 
No, the first board actually does not have any code as for now- I just use it to turn the relay ON/OFF over internet via Web interface..
 
The second board is in different location, controls water heater, with PLC code.
If I have that problem again with emails, I will send you a PLC code and email I get with I/O status.
 
Bedi,
 
Great. Keep us posted. We want to make sure everything is working fine. If there is any problem, we will fix it for you. WC8 has been in the market for almost 10 years. The board you purchased is our latest batch with many hardware improvements. There are few hundreds of this batch boards running out there.  PLC execution and email sending are firmware handled, that part is same as previous generation hw boards. We have not heard from other customers about this problem.
 
In 3.03.21 firmware, we freed some RAM from previous version, so that email will run little faster.  If you have chance to update their firmware, please try that.  Firmware update requires tftp utility.  Firmware update best runs in the local wired network.  That might be a problem for you, since boards are not local to you.
 
Back
Top