Intouch Application script..

drspanda

Member
Join Date
Oct 2005
Location
Damanjodi
Posts
155
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.
 
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?
 
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?
 
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.

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.
 
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.

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.
 
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.
 
drspanda said:
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!

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

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.

regards,
rjasekhar.
Have a great day!
OZEE
 
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.
 
OZEE said:
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.
 
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??
 
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.
 
OkiePC said:
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.
 
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?
 
DaveW said:
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?
 
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.
 

Similar Topics

Can someone give a clear explanation of the IOSetAccessName for an Intouch Application Script? - Thanking everyone in advance. The setup is 1 No...
Replies
0
Views
1,134
Hi I am running an Intouch Application script to display a pop-up window when a bit (x14)is true. This script runs every second. When the bit...
Replies
7
Views
5,447
Good morning to all, I have the following issue, I installed everything of intouch including the patch, it is the 2023 version. The...
Replies
0
Views
284
I restore a galaxy in another machine via the cab backup, but when I deploy the project in the new station it seems that the text object and some...
Replies
2
Views
956
Hello, M using intouch 11.0 with AB, M new to intouch. I have read some pdf regarding uploading downloading editing of in touch application...
Replies
0
Views
1,512
Back
Top Bottom