Perspective step counter

I am using a button to increase a step count in Perspective. What I want to do is take a tag value, use the button to increment the value and then write the new value to the tag. I have been trying to do this but the tag value keeps coming up as a string and I cannot change it to an integer. I got around this issue in Vision by creating a custom tag on the view and linking it to the tag and using that, but it does not seem to be working in Perspective. I’m sure there is a better way. my script is below.
value = event.source.parent.StepNumber
value = value + 1
system.tag.writeBlocking([’[default]Process_Step.value’], [value])

I don’t think you need “.value” in the tag path.
Assuming event.source.parent.StepNumber returns an integer and the tag you’re writing to holds a string value, this might work:

system.tag.writeBlocking(['[default]Process_Step'], [str(value)])

If StepNumber is a string, you need to cast it as an integer before adding to it:

value = int(event.source.parent.StepNumber)

Is the datatype of your tag int ?


gives me int if the datatype of the tag is int.
Can you try this and check if it matches the configuration of your tag ?

Yes this worked. I just found how to do that here:
Thank you.