Skip to main content
Version: 8.1


This function is used in Python Scripting.


Writes a value directly through an OPC server connection synchronously. Will return an OPC-UA status code object. You can quickly check if the write succeeded by calling isGood() on the return value from this function.

New in 8.1.27
Supplying a QualifiedValue to this system function will cause the DataValue to include the QualifiedValue's corresponding StatusCode when the DataValue is sent to the server.

Client Permission Restrictions

Permission Type: OPC Server Management

Client access to this scripting function is blocked to users that do not meet the role/zone requirements for the above permission type. This function is unaffected when run in the Gateway scope.


system.opc.writeValue(opcServer, itemPath, value)


StringopcServerThe name of the OPC server connection in which the item resides.
StringitemPathThe item path, or address, to write to.
ObjectvalueThe value to write to the OPC item.


Quality - The status of the write. Use returnValue.isGood() to check if the write succeeded. Refer to the list of writeValue objects.


Gateway, Vision Client, Perspective Session

Code Examples

Code Snippet - Writing to an OPC Value
# This example will write to an OPC Tag that is on a provider called SLCSim
# Declare the server name
server = "Ignition OPC UA Server"

# Declare the Tag path
path = "[SLCSim]_Meta:N7/N7:0"

# Declare the system function parameters
oldQualifiedValue = system.opc.readValue(server, path)
newValue = oldQualifiedValue.getValue() + 1

# Call the system function and print out results
returnQuality = system.opc.writeValue(server, path, newValue)
if returnQuality.isGood():
print "Write was successful"
print "Write failed"


system opc writeValue, opc.writeValue