Reading Event codes into Wonderware

Ones_Zeros

Member
Join Date
Feb 2014
Location
at work
Posts
367
Hey Guys
I'm reading the Centurion controller event
Codes into my Wonderware SCADA software
Program.

I've setup my script to read these event codes
and it works good when i test it.

I want to store the last 10 event codes into
a txt Box in wonderware, so I can see what
The errors were without going out to the
Controller.

I have got this scripted also & works with
a test button.

What I can't seem to get working consistently
Is how to put this script into Wonderware
& have it populated the event code
automatically into my txt box when a new event
Happens?

I have it currently in a "data change script"
Put I can't get it the code to populate into
the txt box consistently. I've tried "$second"
In a data change script, it works but after a
event occurs it keeps writing into the txt
Box until some one resets the panel

What is the best way to put this script
into wonderware?

Thanks
 
To keep it simple how's best way to
insert this script into wonderware
so it's triggers Each time a event occurs

Example: Should I use?
1. Data change script
2. Condition script
 
Keep in mind that InTouch is single threaded, so it could be executing another script and not seeing your flag. Are you holding your flag true until you get a confirmation of your flag? In other words - do you have some sort of positive hand off to your InTouch, meaning that you hold it true until your script runs, then set another handshake back to the PLC to turn off your trigger when your script is done. A data change script is more like a one shot so if you should use it vs conditional depends on what you are trying to do.

- A data change script runs when the value of a tag changes.

- A conditional script runs when a certain logical condition is true or fals, or remains true or false.
 
Mort81
You mind if I PM you my script
& see if you find any errors.

I'm currently running the script as a
Data change script. The register I'm reading is
Modbus. There is one register I'm reading
For example 40191. This is a event register,
So if register displays an event of 50 (oil pressure)
I do see register 40191 go to 50, but
I can't get it to show up in my text file.

I'm wanting to store the last 10 events in a text
File on my wonderware screen

Thanks for helping!
 
Last edited:
Triggering Script in Wonderware

I think the only thing I need to figure out is how to trigger the script in Wonderware.

Here is some things I have learned about my script
It works when I test it but I'm having trouble
Getting it to trigger in a real life event

1. If i trigger the script using the condition I/O real tag as a "data change" script, I cant get the script to trigger.

2. If I set the script to trigger by using the "$Second" condition on a "data change" script, it works but it keeps filling up the text box with the same fault code until someone hits the reset button on the controller.

3. How is the best way to trigger this script in wonderware? Should I use it as a "condition Script" and set the I/O real tag to trigger by using the condition for example (I/O real tag >=0
I think the only thing I need to figure out is how to trigger the script in Wonderware.

Here is some things I have learned:

1. If i trigger the script using the I/O real tag as a "data change" script, I cant get the script to trigger.

2. If I set the script to trigger by using the "$Second" condition on a "data change" script, it works but it keeps filling up the text box with the same fault code until someone hits the reset button on the controller.

3. How is the best way to trigger this script in wonderware? Should I use it as a "condition Script" and set the I/O real tag to trigger by using the condition for example (I/O real tag >=0) this I/O real event code could be between 0- 125. set it as "On True". would this work? what would you recommend?

Thanks again for helping set it as "On True". would this work? what would you recommend?

Thanks again for helping
 
Last edited:
If the value changes, the script should/will run.
You can try putting some log message scripts inside as well, this will tell you absolutely if the script is running or not.
 
If I set the script condition to trigger off
the I/O real tag using the "data change script"

I can't get the script to trigger when I
know the value of the register is changing

This script works when I test it, all it does
is add the fault codes to a text box, so I can
See the last 10 codes on my wonderware screen

Is this the best way to trigger the script?
Should I use the I/O real tag to trigger the
Script?


Thanks
 
put register value in a buffer tag. then compare every $second to buffer tag current register value, if =, dont print else print.
 
Mike_Dr, Thanks for reply
What exactly are you referring to as
a buffer tag?

I can PM you part of my script & let u to take a look
At it?
It's just not triggering probably & writing
Into the text file. If I put a test button
On screen & type In a event code, the data
Gets wrote to text file like it should.

Thanks again!
 
A buffer tag will be exactly what the DataChange script is doing.
The tag you want to monitor, use that as the action trigger for the data change script.
 
Hello,
below is some screen shots of how i have the script configured
& screens configured

Data_Change_Script.jpg


Data_Change_Script2.jpg


I still can't get the fault code to store into the List Box when a true fault event occurs. I can simulate it & it works, but it wont work in real time.
Does it look like i have the I/O real tag triggering the script correctly?
I have it configured as a data change script


Here is a pic of how its supposed to work...I used a test button to manually input a fault code and it gets entered into the List box everytime..weird
any ideas?

Manual_Test_Button.jpg



thanks
 
Last edited:
take a step back, & just add the value of the tag to the list box without any of your extra comparisons etc.
That will rule out your code at least.
 
In an earlier thread, you have said you see the value go to 50.?
Yet there is no logic for a value of 50 in your scripts?

Try just don’t a non-zero comparison first, then adding that value to your text box.


Unless of course, what you have posted is a cut down version of what you have actually tried.?
 

Similar Topics

Hey i want to read structures with an ads connecton with a c# programm. But i dont know how this works. can anyone help me Thanks
Replies
1
Views
2,079
Dear all, I don't know why setup of password became challenging and weird. After setting up the password and try to upload the ladder from the plc...
Replies
3
Views
89
hi all, i have a plc i need to get info from for a site im working on: I have a 1764 Micro Logix 1500 LSP Series C (See Attached Image) im...
Replies
2
Views
351
Hi to everybody. I need to read the first 12 characters of the message that a barcode reader sends to the ascii card (1734-rs232 ascii) and I...
Replies
8
Views
685
Hey, I have a PowerMonitor1000 I'm using for voltage control. The problem is it doesn't seem to read voltage until it gets to about 200V...
Replies
0
Views
355
Back
Top Bottom