Is there no momentary button in Perspective?

Why are so many components removed from vision in perspective?

Because it is based on different technology.
Vision runs on the client PC.
Perspective runs on the gateway and the client is a web browser. There are all sorts of technical issues that have to be addressed for this reason, including security and reliability.

The momentary button question has been discussed many times on the forum and good reasons given why you shouldn't attempt it with Perspective. Here's one: How to create the momentary Button in Perspective - #7 by pturmel.

6 Likes

Maybe a better question to ask, why do you feel you need to use a momentary button?

https://xyproblem.info/

3 Likes

Thanks, I just used one shot button and programmed in the plc to change.

1 Like

Adding visualization to an environment with 50ish PLC and each PLC has reset bits already programmed to use momentary inputs. I don't have access to change the customers PLC code. That was my motivation.

def runAction(self, event):
		from threading import Timer
		
		def writeOn():
		    system.tag.write("TagPath", 1)
		def delayOff():
		    system.tag.write("TagPath", 0)
		
		writeOn()
		t = Timer(1.5, delayOff)
		t.start()

Probably want to use system.tag.writeBlocking instead of system.tag.write as that is deprecitated now.

Then make them change it. The customer is not always correct. If a customer insists on making you use questionable/racy methods, you should document that, so there's written evidence that you warned them.

1 Like

If it were part of the control I'd be more concerned. I have voiced the issue but so far it's being used to reset counters, with the counter displayed just above the reset button on the Perspective screen.

The simplest, non-racy way to reset a counter is to write a zero to it. :man_shrugging:

4 Likes

I just needed to reset an xio alarm reset tag that is in the plc logic that is being used to reset alarm. We use momentary button in vision for that. Just wanted to have something like that in perspective also.
There are many ways to do this (nothing easier than momentary button) but what I did was to write 1 from perspective using a button and in the plc program when that bit is 1 it does reset the logic and writes 0 to the same tag.

It's trying to write to a tag literally called "self.custom.tagpath". Try without the quotes around it.

1 Like

Shiva, if you are using a timer in a script then you are doing it wrong. The topic has been covered many times on the forum.

Instead of describing your solution, open a new thread and describe the actual original problem you are trying to solve - not the solution you think will work.