Syntax error while configuring scripting for scheduled

Hell dear,

I got error while configuring scheduled scripting in gateway event script.

Error : syntexError : mismatched input 'paths' expecting INDENT

PFA attached picture of the error and code.

ERROR

You need to indent everything from line 2 and down.
Highlight everything from line 2 downwards and press tab once.

2 Likes

The error message says it clearly:

SyntaxError: mismatched input 'path' expecting INDENT

You'll also need to surround the path with quotes, as it should be a string:

paths = "[Sample_Tag]Writeable/WriteableInteger2"
2 Likes

Also, your values line will need to be aligned with your paths line.

2 Likes

Also, also system.tag.writeBlocking() takes a list of paths and a list of values, so you’ll need to surround the parameters with square brackets at least.

system.tag.writeBlocking([paths],[values])
2 Likes

I believe you can do single tag / single value now, but I will agree that it's better to get into the habit of always using lists.

2 Likes

especially when the variable names are paths and values

4 Likes

You can, but I try to keep that secret to myself.

4 Likes

I also tried this option.

But, it's not worked.

What did not work ? What errors do you get ?

This is what your script should look like, try it and report back the actual error message.

"it's not worked" is not an adequate description of the issue. We can't help you if we don't know what's going wrong.

def onScheduledEvent():
    paths = ['[Sample_Tag]Writeable/WriteableInteger2']
    values = [76]
    system.tag.writeBlocking(paths,values)
1 Like