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
Unread May 10th, 2008, 04:23 PM   #1
control_logic
Member
United States

control_logic is offline
 
Join Date: Jun 2007
Location: Central Florida
Posts: 42
Adding INT Tags in WinCC Flex 2007

Hello all,

I need to add 2 int tags together and show the result in a field below the other 2 shown individually. For some reason I am having a mental block as to how to accomplish this in WinCC Flexible 2007 Advanced. I am seeing the 2 individual tags update correctly, buthow do you program the addition?
  Reply With Quote
Unread May 11th, 2008, 12:48 AM   #2
Nick B
Member
Canada

Nick B is offline
 
Nick B's Avatar
 
Join Date: Mar 2007
Location: Vancouver
Posts: 302
Many ways to do it. Simplest in "ON Change"-Event in the properties of the BOTH TAGS! Call a Script. Script Tag3 = Tag1+Tag2


Nick
  Reply With Quote
Unread May 11th, 2008, 06:49 AM   #3
control_logic
Member
United States

control_logic is offline
 
Join Date: Jun 2007
Location: Central Florida
Posts: 42
I can't seem to make that work.
In my application I have: Cases_7A, Cases_7B and Total_Cases_7.
Cases_7A and Cases_7B come from 2 different PLC's, and update at 1second intervals. Total_Cases_7 is setup as an internal output tag. I made the script "Total_Cases", and reference the source tags. Where do I do the "on change" event? The other tags right?
  Reply With Quote
Unread May 11th, 2008, 10:08 AM   #4
CharlesM
Member
United States

CharlesM is offline
 
Join Date: Aug 2005
Location: Arkansas
Posts: 1,129
Quote:
Where do I do the "on change" event?
When you setup the tag you can setup events for that tag just like a button. Also look at the update. You have it set for 1 second but you may need to change the update from on demand to cylic.

I don't think you need a script. I think you can using the increase function to do what you need.
  Reply With Quote
Unread May 11th, 2008, 02:55 PM   #5
Nick B
Member
Canada

Nick B is offline
 
Nick B's Avatar
 
Join Date: Mar 2007
Location: Vancouver
Posts: 302
I think increase function will apply value to the tag that initiated it. You don't want the value to be put back into original.


Nick
  Reply With Quote
Unread May 11th, 2008, 05:31 PM   #6
control_logic
Member
United States

control_logic is offline
 
Join Date: Jun 2007
Location: Central Florida
Posts: 42
Quite right Nick, the increasevalue adds to the original tag which is definately not what I need. I figured out ho to get the total if I click a "total" button I made that activates the script, but i'd like it to update automagically, in the same fashion as the 2 counter tags update now. Any ideas? Got to be some WinCC gurus on here somewhere.
  Reply With Quote
Unread May 11th, 2008, 07:55 PM   #7
CharlesM
Member
United States

CharlesM is offline
 
Join Date: Aug 2005
Location: Arkansas
Posts: 1,129
If you script is working then all you need to do is call the script from the on change in one or both of the tags. Then anytime they change it will run the script.

If you don't display the numbers on the screen then they are not updated with the on demand update.
  Reply With Quote
Unread May 11th, 2008, 08:04 PM   #8
control_logic
Member
United States

control_logic is offline
 
Join Date: Jun 2007
Location: Central Florida
Posts: 42
I don't have anywhere to pick that property on the 2 fields in question. They are Output fields. I have tinkered with changing the type but have never seen the "on change" property
  Reply With Quote
Unread May 11th, 2008, 08:37 PM   #9
CharlesM
Member
United States

CharlesM is offline
 
Join Date: Aug 2005
Location: Arkansas
Posts: 1,129
Are you looking at the text box on the screen or the tag information in the connections? You should be able to goto tags and select the tag. Then you should see events for the selected tag just like you see on the push button.

Are these internal tags or are they PLC addresses?


edit

This may help look at page 97
http://www1.siemens.cz/ad/current/co...sa_2005_en.pdf

Last edited by CharlesM; May 11th, 2008 at 08:44 PM.
  Reply With Quote
Unread May 11th, 2008, 08:51 PM   #10
control_logic
Member
United States

control_logic is offline
 
Join Date: Jun 2007
Location: Central Florida
Posts: 42
Thank You! I guess I turned the view off for the tag properties, so I was never seeing what you were talking about. Now I see it, and it works great.
  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
Citect Vs WinCC - Long Doug_Adam LIVE PLC Questions And Answers 22 October 3rd, 2014 01:56 PM
WinCC Flex. 2007 doens't start Heino Geerdens LIVE PLC Questions And Answers 6 May 8th, 2008 12:51 AM
Wincc flex 2007 greg.fanning LIVE PLC Questions And Answers 15 February 14th, 2008 04:00 AM
Wincc flex 2005 to flex 2007 warning Siemon LIVE PLC Questions And Answers 9 September 25th, 2007 08:57 PM
Using Tags In WinCC Flex Direct From S7 Pro rhill LIVE PLC Questions And Answers 6 March 15th, 2007 09:46 AM


All times are GMT -5. The time now is 11:08 PM.


.