FactoryTalk View PLC Tag Macro Expression

Lazy_Fox

Member
Join Date
Mar 2019
Location
OuterSpace
Posts
8
Hello,

I am fairly new to AB PLC and HMI.

I am using Factorytalk View to create an HMI application.

While using Macros, I wanted to create a script to move an object vertically (up or down) when push button (either UP or DOWN) is pressed.



I wrote the macros as follows.



<Tag>: Distance

<Expression>: If (UP) Then (Distance + 10) Else If (Down) Then (Distance -10) Else Distance



But when running the application, The Object is only moving upwards (i.e Only the If condition is read) but not moving down (i.e else if condition is not read).



Is there anything wrong with my syntax?
 
Hey Fox,

My first thought is that if you copy pasted this then maybe having "Down" instead of "DOWN" is an issue? Second thought is that unless I'm mistaken this button will always be either up or down. If that's right then you only need:
If (UP) Then (Distance + 10) Else (Distance - 10)
Is that the case or is it a multistate button or something?

Haven't messed with macros in FTView much, but if you can't get it to work my thought would be to create a few of the same object and have their visibility controlled by the button's state. You may need another tag to do this. It is a naive implementation but it would work.

Hope it helps. I'm not super experienced but I want to be active on here to help me improve.
 
Hello Elkelthen,
I haven't mentioned the following in the thread.
1. It is a typo in tag name, it is DOWN actually.
2. This is a momentary push button so, it will be on only for some time. I use two buttons one for UP and another for DOWN.
 
So does that mean that when you push (UP) the object moves up ten units, but only while the button is pushed? or does it stay ten units up when (UP) is released? And is it the same for (DOWN)?

Maybe you can try separating yours into two different macros, one attached to each button. Also to edit my last post to be a slightly better implementation, I had forgotten that there is a horiz/vert positioning animation. If you add a boolean or maybe two to your PLC then you can just use those bits to control it. That means you wouldn't need multiple of the same object as well.
 

Similar Topics

Hi all, I'm having an issue with connecting View Studio emulation to a real PLC. I am running View Studio 8.01 on a Hyper-V virtual machine...
Replies
0
Views
265
Heya Given lead times on a new PanelView Performance which we'd plan to deploy and connect to 2 x PLC's, we're in a bit of a pickle. Can we use...
Replies
3
Views
1,183
Hello, When I click on the processor in Communications Setup, it says to select a different path...it can't be used. It gives no explanation as...
Replies
3
Views
3,425
I am using FactoryTalk VIEW alarm server to set level alarms on tags in the PLC. I am pointing the Enable and Disable bits for the alarms to bits...
Replies
1
Views
4,250
What am I missing here. After scouring the web I can't seem to get the HMI to update from the 1769 PLC. The tags all come from the GSV...
Replies
8
Views
6,218
Back
Top Bottom