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 September 19th, 2017, 09:06 PM   #1
Ones_Zeros
Member
United States

Ones_Zeros is offline
 
Join Date: Feb 2014
Location: at work
Posts: 194
Question Reading Event codes into Wonderware

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
  Reply With Quote
Old September 20th, 2017, 11:29 AM   #2
Ones_Zeros
Member
United States

Ones_Zeros is offline
 
Join Date: Feb 2014
Location: at work
Posts: 194
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
  Reply With Quote
Old September 25th, 2017, 10:29 AM   #3
mort81
Member
United States

mort81 is offline
 
Join Date: May 2014
Location: Indiana
Posts: 79
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.
  Reply With Quote
Old September 25th, 2017, 05:52 PM   #4
Ones_Zeros
Member
United States

Ones_Zeros is offline
 
Join Date: Feb 2014
Location: at work
Posts: 194
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 by Ones_Zeros; September 25th, 2017 at 06:07 PM.
  Reply With Quote
Old October 7th, 2017, 10:56 PM   #5
Ones_Zeros
Member
United States

Ones_Zeros is offline
 
Join Date: Feb 2014
Location: at work
Posts: 194
Question 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 by Ones_Zeros; October 7th, 2017 at 11:18 PM.
  Reply With Quote
Old October 7th, 2017, 11:45 PM   #6
lostcontrol
Member
New Zealand

lostcontrol is offline
 
lostcontrol's Avatar
 
Join Date: May 2009
Location: NeverSayNever
Posts: 777
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.
  Reply With Quote
Old October 9th, 2017, 10:24 PM   #7
Ones_Zeros
Member
United States

Ones_Zeros is offline
 
Join Date: Feb 2014
Location: at work
Posts: 194
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
  Reply With Quote
Old October 10th, 2017, 03:53 AM   #8
mike_dr
Member
Yemen

mike_dr is offline
 
Join Date: Sep 2011
Location: Mla
Posts: 204
put register value in a buffer tag. then compare every $second to buffer tag current register value, if =, dont print else print.
  Reply With Quote
Old October 10th, 2017, 06:28 AM   #9
Ones_Zeros
Member
United States

Ones_Zeros is offline
 
Join Date: Feb 2014
Location: at work
Posts: 194
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!
  Reply With Quote
Old October 10th, 2017, 01:01 PM   #10
lostcontrol
Member
New Zealand

lostcontrol is offline
 
lostcontrol's Avatar
 
Join Date: May 2009
Location: NeverSayNever
Posts: 777
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.
  Reply With Quote
Old October 11th, 2017, 07:01 PM   #11
Ones_Zeros
Member
United States

Ones_Zeros is offline
 
Join Date: Feb 2014
Location: at work
Posts: 194
Hello,
below is some screen shots of how i have the script configured
& screens configured





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?




thanks

Last edited by Ones_Zeros; October 11th, 2017 at 07:26 PM.
  Reply With Quote
Old October 11th, 2017, 07:50 PM   #12
lostcontrol
Member
New Zealand

lostcontrol is offline
 
lostcontrol's Avatar
 
Join Date: May 2009
Location: NeverSayNever
Posts: 777
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.
  Reply With Quote
Old October 12th, 2017, 05:59 AM   #13
lostcontrol
Member
New Zealand

lostcontrol is offline
 
lostcontrol's Avatar
 
Join Date: May 2009
Location: NeverSayNever
Posts: 777
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.?
  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
Wonderware Historian not reading from remote WWRSLINX phuz LIVE PLC Questions And Answers 0 July 12th, 2017 12:12 PM
Wonderware reading wrong CLX Array Tags kekrahulik LIVE PLC Questions And Answers 9 May 27th, 2014 06:08 PM
Flowmeter reading arocon LIVE PLC Questions And Answers 6 June 2nd, 2013 11:26 AM
I/O access error, reading raj87 LIVE PLC Questions And Answers 1 May 5th, 2012 08:54 PM
Interpret S7 Diagnostic Buffer JayD LIVE PLC Questions And Answers 22 August 10th, 2011 05:51 AM


All times are GMT -5. The time now is 03:04 AM.


.