Send a signal to a bit in PLC with a write scripting bottom

Hello!
currently I am working in an scripting to write values in the PLC when the bottom is pressed:

value = int(event.source.parent.getComponent('Column Number').text)
value1 = int(event.source.parent.getComponent('Row Number').text)

if value <= 12 and value >0:
system.tag.write('/Robots/HMI_input_column1', value)

if value1 <= 11 and value1 >0:
system.tag.write('/Robots/HMI_input_row1', value1)

However, what I want is when these conditions are true and they were written in the PLC, another bit in my PLC goes high. Should I add another bottom attached to my 'write' bottom or it can be something handle from my current scrip?

Welcome to the forum!

Please see Wiki - how to post code on this forum. You can edit your post to fix the code.

Add the 'vision' or 'perspective' tag so we know which application you are using.

I think you mean 'button', not 'bottom'.

It can be handled from your current script.

Your current script can be optimized. You didn't say explicitly that this was in Ignition 7, so I will assume that it is in Ignition 8+. In which case you should really be using the system.tag.writeBlocking() or system.tag.writeAsync() functions.

You should also be consolidating your writes into a single call. Even in Ignition 7 you should have preferred system.tag.writeAll() over multiple calls to write().

Your tag paths do not appear to be valid paths as they do not start with a root folder. You should make sure that you use the tag selector in the script editor to get the correct path.

Your script should look something like this:

columnNumber = int(event.source.parent.getComponent('Column Number').text)
rowNumber = int(event.source.parent.getComponent('Row Number').text)

if 0 < columnNumber <= 12 and 0 < rowNumber <= 11:
    system.tag.writeBlocking(['[default]parentPath/Robots/HMI_input_column1','[default]parentPath/Robots/HMI_input_row1','[default]path/to/boolean/bit'],[columnNumber,rowNumber,True])