You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old December 13th, 2006, 03:11 AM   #1
drspanda
Member
India

drspanda is offline
 
Join Date: Oct 2005
Location: Damanjodi
Posts: 155
Question Intouch Application script..

Hello Everyone,

I am facing a peculiar problem with intouch...The problem is PLC Fault alarm comes and communication losts between intouch and S7-400 PLC....Only thing we do is just close the intouch application and open it...I found that plc_alarm is the item which is causing the alarm...I am completely new to intouch and I have basic programming concepts..

In the application script i found the following code:

sample_time_count =sample_time_count - 1;
time_count = time_count + 1;
IF time_count > 25 THEN
PLC_alarm = 1;
ELSE
PLC_alarm = 0;
ENDIF;
imp_min = DB_BR_GrL1_imp_min_br;
IF $AccessLevel < 9999 THEN
EnableDisableKeys(1,1,1) ;
ELSE
EnableDisableKeys(0,0,0);
ENDIF;

I want the significance of "time_count > 25"? what is 25?

Thanks in advance.
  Reply With Quote
Old December 13th, 2006, 05:15 AM   #2
OZEE
Member
United States

OZEE is offline
 
Join Date: Mar 2006
Location: Kansas
Posts: 1,695
It's a handshake system.

If you look in the PLC, you will find something that is setting the value of time_count back to 0. This method is used to detect when the PLC is not responding anymore... If InTouch keeps incrementing the counter but the PLC never clears the counter, then there is a problem with the comm link between the PLC and WonderWare.

The 25 is just some amount of time. If you'll look at the top of that application script, you'll see that it's a while_true condition. Then it will show how often to run the script while the condition is true. If it shows 1000, then it's executing every 1000 milliseconds. If the script executes 25 consecutive times without being reset, you have a problem.

plc_alarm is not causing the problem, but rather indicating that you have a problem. Now you need to determine why you're not able to communicate between PLC and WonderWare any more.

How are you attempting to communicate with WonderWare?
  Reply With Quote
Old December 13th, 2006, 06:46 AM   #3
drspanda
Member
India

drspanda is offline
 
Join Date: Oct 2005
Location: Damanjodi
Posts: 155
Hi OZEE,

I am communicating to PLC with simatic OPC net server..I dont know how to use OPC Scout to test this particular problem. Also can you explain me how then after restarting the application (i mean intouch) the problem gets rectified?
  Reply With Quote
Old December 13th, 2006, 08:39 AM   #4
ayman metwally
Lifetime Supporting Member
Egypt

ayman metwally is offline
 
Join Date: Dec 2003
Location: Cairo
Posts: 258
Greetings drspanda,

You may for an "OPC item" in your OPC server that represents the communication status. These items should be built in your OPC server.
I don't know about "simatic OPC net server", But I'm generally speaking.

Quote:
Also can you explain me how then after restarting the application (i mean intouch) the problem gets rectified?
I think that's because your varible "time_count" is being reset (equals zero) whenever you shutdown InTouch. I think also that the problem will happen again once it reachs 25.
__________________
Ayman Metwally
  Reply With Quote
Old December 13th, 2006, 07:07 PM   #5
OZEE
Member
United States

OZEE is offline
 
Join Date: Mar 2006
Location: Kansas
Posts: 1,695
Actually, it's being rectified because the comm is up again.

If your WonderWare app has the menu bar enabled, you can go to Special > Reinitialize IO > Reinitialize all and it will probably reconnect. I'm not familiar with that OPC server, but most of them quit trying after they get mad.

You can also put a pushbutton on one of the screens with the following command:

Code:
IOReinitialize();
This will do the same thing.

Quote:
Closes all existing I/O conversations and restarts the entire process of setting up I/O conversations. All I/O points are affected when this function executes.


However, the thing to realize is that this is a bandage. You really need to figure out why the comm link is dropping. It could be as simple as a bad connection. Or as difficult to identify as RF interference. Check your cable routings -- are they close and parallel to any drive or softstart wires?

Again, I'm not at all familiar with that OPC server so I can't give you any specific guidance on it. WonderWare - I know! That's been my specialty for over 10 years. Comm problems - if it has ever worked correctly - can almost always be traced back to either a bad connection someplace or electrical interferene.
  Reply With Quote
Old December 13th, 2006, 08:50 PM   #6
drspanda
Member
India

drspanda is offline
 
Join Date: Oct 2005
Location: Damanjodi
Posts: 155
Hi Ozee,

I had increased the count to 25->35...I will put the bandage (button) after observing the system for 1 or 2 days...

Also I did not find any symbol in the PLC "time_count"? I have checked this in symbol table as well as goto->location menu after selecting any symbol in LAD editor.

I suppose when the operator changes windows in intouch i mean drum level window to conveyour window...the opc server need to give data values to for the new window in this particular time (25 units) if the server cannot give this may initiate plc_alarm....Am I correct?

regards,
rajasekhar.
  Reply With Quote
Old December 14th, 2006, 07:20 AM   #7
OZEE
Member
United States

OZEE is offline
 
Join Date: Mar 2006
Location: Kansas
Posts: 1,695
Quote:
Originally Posted by drspanda
I had increased the count to 25->35...I will put the bandage (button) after observing the system for 1 or 2 days...
Did changing the count from 25 to 35 help? I suspect it just delays the shutdown -- you still have the same problem, it just takes longer to get there. I'm guessing that this is in the while-true application script. What is the timer setting for repeating the script while-true?

Just putting the button in is not going to fix the problem. It will merely give you an easier way to restart. You really need to fix the problem by finding what is causing the comm to drop out!

Quote:
Also I did not find any symbol in the PLC "time_count"? I have checked this in symbol table as well as goto->location menu after selecting any symbol in LAD editor.
You're right, you didn't. You need to open the tag definition for "time_count" in WonderWare. There you will find the corresponding address in the PLC. Then you can search the PLC and find that corresponding address and confirm that it is being reset in the PLC

Quote:
I suppose when the operator changes windows in intouch i mean drum level window to conveyour window...the opc server need to give data values to for the new window in this particular time (25 units) if the server cannot give this may initiate plc_alarm....Am I correct?
It's hard to know without having the WW application. If you'd like me to open it up and look at it, I can certainly do that for you. Feel free to Zip it up and pm or email it to me.

Quote:
regards,
rjasekhar.
Have a great day!
OZEE
  Reply With Quote
Old December 16th, 2006, 01:33 AM   #8
drspanda
Member
India

drspanda is offline
 
Join Date: Oct 2005
Location: Damanjodi
Posts: 155
Hi Ozee,

I cannot say it worked out (changing from 25->35) because the problem comes approximately once in 14 days or sometimes within 2 to 3 days...I mean we cannot tell when the problem comes exactly...I need to wait to..

I shall send the WW application to you but its size is large...it has many files with different extensions as far as i remember it has a folder called CSV containing .csv files and their size is large..So how do I send them?? I mean give me hint that what files are needed by you so that I can send them....Also where to send I mean in this site or to your email address.

Thanks for the support.
  Reply With Quote
Old December 16th, 2006, 01:45 AM   #9
drspanda
Member
India

drspanda is offline
 
Join Date: Oct 2005
Location: Damanjodi
Posts: 155
Quote:
Originally Posted by OZEE
Did changing the count from 25 to 35 help? I suspect it just delays the shutdown -- you still have the same problem, it just takes longer to get there. I'm guessing that this is in the while-true application script. What is the timer setting for repeating the script while-true?
timer setting for repeating the script while-true is 1000ms.
  Reply With Quote
Old December 16th, 2006, 11:13 AM   #10
drspanda
Member
India

drspanda is offline
 
Join Date: Oct 2005
Location: Damanjodi
Posts: 155
Question Intouch application script..

Hi Ozee,

Today I observed there is a boolean bit "life_check" which is "ON" for 10sec and "OFF" for 10sec as long as PLC is working well...and this bit is used to bring back "time_count=0"....here I am getting a doubt...if this life_check bit is OFF and during this 10 seconds time_count is becomming greater than 25 because the application script runs during that period also...Am I correct??

Also i made life_check bit zero in the plc (for test purpose only) and observed PLC Alarm has come approximately after 10 sec...Surprisingly when I made the life_check bit again normal...PLC Alarm got reset...What I mean to inform is It was not necessary to re-initialize the intouch..

I am attaching the screen shots from intouch..

Come with your ideas??
Attached Files
File Type: zip Screen shots.zip (278.1 KB, 31 views)
  Reply With Quote
Old December 16th, 2006, 12:59 PM   #11
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,983
What changes the state of life_check bit?

I have seen "heartbeat" systems set up in which a PLC resets a bit and another device sets the same bit via a communication channel. Each time the bit changes states, a timer is reset. If the timer expires, a fault is issued called something like "Communication Failure" or "Heartbeat Timeout".

So, find out what sets AND what resets the life_check bit. Chances are that two different processes (the PLC program and the wonderware app) are writing to it, and they are both watching it with timers to generate a fault should either fail.
  Reply With Quote
Old December 16th, 2006, 11:55 PM   #12
drspanda
Member
India

drspanda is offline
 
Join Date: Oct 2005
Location: Damanjodi
Posts: 155
Quote:
Originally Posted by OkiePC
What changes the state of life_check bit?

So, find out what sets AND what resets the life_check bit. Chances are that two different processes (the PLC program and the wonderware app) are writing to it, and they are both watching it with timers to generate a fault should either fail.
life_check bit is set and reset by the PLC only...and I have checked this...This is done by using two timers in the PLC program.
  Reply With Quote
Old December 17th, 2006, 12:12 AM   #13
DaveW
Member
United States

DaveW is offline
 
Join Date: Apr 2005
Location: SoCal
Posts: 366
How fast is the application script updating? I couldn't really tell from your screenshot.

Have you checked the logger to see if there's any communication errors?
  Reply With Quote
Old December 17th, 2006, 08:53 AM   #14
drspanda
Member
India

drspanda is offline
 
Join Date: Oct 2005
Location: Damanjodi
Posts: 155
Quote:
Originally Posted by DaveW
How fast is the application script updating? I couldn't really tell from your screenshot.

Have you checked the logger to see if there's any communication errors?
While running for every 1000msec. it is there in screen shot (in application script)..I do not know how to check logger can you guide me?
  Reply With Quote
Old December 17th, 2006, 09:39 AM   #15
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 9,983
So, the PLC toggles the state of life_check all by itself. The wonderware application monitors that bit and, when 0, clears the value of time_count. Once every 2-14 days you get a communication fault that causes the time_count routine in ww to reach its limit and generate a fault.

IMHO, You have an actual comunication problem and an oddly designed heartbeat logic.

What would happen if communication failed with the life_check bit in the ON state? I know nothing about ww, but it looks like you would not get a fault in that situation. When life_check is off, time_count is allowed to increment. When it is on, time_count is brought back to zero by the data change script.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
how to establish communication between InTouch SCADA application and RSEmulator500 gorillaz_sg LIVE PLC Questions And Answers 5 November 3rd, 2015 11:11 AM
Wonderware InTouch - Auto select application blue39 LIVE PLC Questions And Answers 4 October 31st, 2009 03:17 PM
Intouch losing application focus ControlLogix LIVE PLC Questions And Answers 7 November 9th, 2006 05:22 AM
InTouch Application Script Query jaichains LIVE PLC Questions And Answers 7 July 19th, 2006 08:37 AM
Wonderware Script Issue ControlLogix LIVE PLC Questions And Answers 2 October 24th, 2005 12:56 PM


All times are GMT -5. The time now is 10:18 PM.


.