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 November 8th, 2004, 04:02 PM   #1
jimdi4
Member
United States

jimdi4 is offline
 
jimdi4's Avatar
 
Join Date: Aug 2004
Posts: 99
Wonderware Intouch Rotation Question

Hello, I would like to do a continous rotation of an object when a bit is true (1).

I am using Wonderware Windowmaker 9.0.

So far, I set the objects Miscellaneous/Orientation. Set the bit(tagname tied to it). Then set the Value at Max CCW at 0, the Value at MaxCW at 10, the CCW Rotation at 0, the CW Rotation at 360. The Centerof Rotationoffset from object centerpoint: X position = 0....and the Y position=0.

I added a button to test, but what happpens is the test object will only rotate when the bit is toggled back and forth, it will not continously rotate when the bit is true...any thoughts here...

thanks
__________________
=========================================
Bit 1 and bit 0 are on the opposite ends of the keyboard
---------------------------------
  Reply With Quote
Old November 8th, 2004, 05:10 PM   #2
harryting
Lifetime Supporting Member
United States

harryting is offline
 
harryting's Avatar
 
Join Date: May 2002
Location: Puget Sound
Posts: 1,886
I don't have WW available to me right now but it sounds like you need a analog HMI tag made up and do a windows script that:

IF Tag = True AND HMI_Tag < max rotation THEN
HMI_Tag = HMI_Tag + constant
ELSE IF HMI_Tag > max rotation
HMI_Tag = 0
END IF

and have the rotation tied to the HMI_Tag. My logic above might not be exact for WW but you get the idea.
  Reply With Quote
Old November 8th, 2004, 05:37 PM   #3
jimdi4
Member
United States

jimdi4 is offline
 
jimdi4's Avatar
 
Join Date: Aug 2004
Posts: 99
I put:



IF TEST == 1 AND $Second < 360 THEN
TEST = 1;
ELSE IF $Second > 360 THEN
TEST = 0;
ENDIF;
ENDIF;


and I get

"expecting another operand"
  Reply With Quote
Old November 8th, 2004, 06:34 PM   #4
Derek McFarland
Member
Canada

Derek McFarland is offline
 
Derek McFarland's Avatar
 
Join Date: Apr 2004
Location: Vernon, BC
Posts: 133
harryting's suggestions work

Use your bit tag in place of TEST1 and the orientation animation should be tied to HMI_Tag of some other memory integer you specify.

IF TEST1 == 1 AND (HMI_Tag < 360) THEN
HMI_Tag = HMI_Tag + 2;
ELSE IF HMI_Tag > 360 THEN
HMI_Tag = 0;
ENDIF;
ENDIF;
  Reply With Quote
Old November 9th, 2004, 09:36 AM   #5
msinclair
Member
United States

msinclair is offline
 
Join Date: Sep 2003
Location: US
Posts: 398
I'm agreed in principle with what everyone has posted so far.

For a continuously animated rotation, you need a continually changing tag. I typically would use the $Second system tag as you suggested.

Marc


PS: You might need to define a new tag and set that up in a "QuickFunction" like:

If Test==1 Then MyFunction=$Second;
Else MyFunction=0;
Endif;

Last edited by msinclair; November 9th, 2004 at 09:57 AM.
  Reply With Quote
Old November 9th, 2004, 10:07 AM   #6
jimdi4
Member
United States

jimdi4 is offline
 
jimdi4's Avatar
 
Join Date: Aug 2004
Posts: 99
I just want to make it clear that this is the first Wonderware job I am doing thats why I may be tripping on my own two feet here...


To test this i created a pushbutton and for the discrete value i called it test1.

I double clicked on my animation for the rotation and added the following in the miscelaneous orientation :

IF TEST1 == 1 AND (rotation < 360) THEN
rotation = rotation + 2;
ELSE IF rotation > 360 THEN
rotation= 0;
ENDIF;
ENDIF;

When I click on "OK" I still get "expecting another operand"....Is there a way you can see if I am doing the same thing you are?.. or am I missing something here? I did notice the tagname "rotation" that I created did not have the same access as the rest of the tags...could this be creating the problem? If so how do you change the tagname access w/o reimporting all the tags?
  Reply With Quote
Old November 9th, 2004, 10:17 AM   #7
jimdi4
Member
United States

jimdi4 is offline
 
jimdi4's Avatar
 
Join Date: Aug 2004
Posts: 99
PS: You might need to define a new tag and set that up in a "QuickFunction" like:


Quickfunction????

Ok, Now I see it...I added that bit of code to a "quickfucntion" and saved it as "rotation" but how do I tie it to the object?

When you doubleclick on the object the Animation pops up...I chose ...Miscellaneous...Orietation...but its looking for an expression not a quickfunction??? Pease clarfy...
__________________
=========================================
Bit 1 and bit 0 are on the opposite ends of the keyboard
---------------------------------

Last edited by jimdi4; November 9th, 2004 at 10:29 AM.
  Reply With Quote
Old November 9th, 2004, 10:20 AM   #8
msinclair
Member
United States

msinclair is offline
 
Join Date: Sep 2003
Location: US
Posts: 398
Quote:
Originally posted by jimdi4
When I click on "OK" I still get "expecting another operand"....Is there a way you can see if I am doing the same thing you are?.. or am I missing something here? I did notice the tagname "rotation" that I created did not have the same access as the rest of the tags...could this be creating the problem? If so how do you change the tagname access w/o reimporting all the tags?

That is why I added the edit for the "QuickFunction". If you update a tag through a "QuickFunction", you can use a much more complicated expression than you can in the Animation Link Expression.

Try something like what I posted above (or your own code) in a quick function (I typed it from memory, so you might need to work on syntax a bit), then reference your quick-function Tag name in your animation link.




Looks like our posts crossed on the net. Yes - a quickfunction is found under "Scripts" on your project navigation tree.


Good luck,

Marc


PS: I have not used 9.0 - I would assume this functionality hasn't changed . . .

Last edited by msinclair; November 9th, 2004 at 10:22 AM.
  Reply With Quote
Old November 9th, 2004, 10:38 AM   #9
jimdi4
Member
United States

jimdi4 is offline
 
jimdi4's Avatar
 
Join Date: Aug 2004
Posts: 99
Yes there is a bit of a propagation delay here...I am updating my question and you are already answering it....Maybe I should wait a couple of minutes b-4 I posted...


Ok, Now I see it...I added that bit of code to a "quickfucntion" and saved it as "rotation" but how do I tie it to the object?

When you doubleclick on the object the Animation pops up...I chose ...Miscellaneous...Orietation...but its looking for an expression not a quickfunction??? Please clarfy...
__________________
=========================================
Bit 1 and bit 0 are on the opposite ends of the keyboard
---------------------------------

Last edited by jimdi4; November 9th, 2004 at 10:40 AM.
  Reply With Quote
Old November 9th, 2004, 11:25 AM   #10
harryting
Lifetime Supporting Member
United States

harryting is offline
 
harryting's Avatar
 
Join Date: May 2002
Location: Puget Sound
Posts: 1,886
Quote:
ENDIF;
ENDIF;
I don't have WW here but I think you might have one more ENDIF than required.

As for your question on expression. An Expression is can include function, numbers, etc... eg. 2+2 is an expression, SIN(X) is an expression and X == Y is an logical (0 or 1) expression.
  Reply With Quote
Old November 9th, 2004, 12:56 PM   #11
msinclair
Member
United States

msinclair is offline
 
Join Date: Sep 2003
Location: US
Posts: 398
Well - I broke out WindowMaker and fooled around for a minute - here's probably the simplest way that I could find:


Set your orientation expression equal to: TEST1*$SECOND, then scale your orientation properties so that 0-60 = 0 - 360.


Marc


PS: I only got the quickfunction working for a "one-shot" kind of update. It might need to go into a Script that runs regularly to get that to work (which is definitely NOT what you want to do). While I'm sure that I have done it before, I couldn't figure it out quickly today (and I think the above solution is better anyhow!)
  Reply With Quote
Old November 9th, 2004, 01:07 PM   #12
jimdi4
Member
United States

jimdi4 is offline
 
jimdi4's Avatar
 
Join Date: Aug 2004
Posts: 99
What I wound up doing was utilize a condition script. That worked perfect for my application.
  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
Mitsubishi FX2N RS485 Link with Intouch Wonderware Steve Cheung LIVE PLC Questions And Answers 1 November 25th, 2008 05:32 AM
Wonderware user input question... jimdi4 LIVE PLC Questions And Answers 3 January 31st, 2007 07:50 PM
Wonderware Intouch 7.1 & Windows XP Professional lucifer LIVE PLC Questions And Answers 15 January 13th, 2006 12:19 PM
Wonderware Intouch Access Name Configuration lucifer LIVE PLC Questions And Answers 1 February 7th, 2005 06:24 AM
Question on Wonderware georgeofthejungle02 LIVE PLC Questions And Answers 3 October 4th, 2004 11:38 AM


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


.