Skip to main content
Version: 8.1

system.opc.writeValues

This function is used in Python Scripting.

Description​

This function is a bulk version of system.opc.writeValue. It takes a list of addresses and a list of objects, which must be the same length. It will write the corresponding object to the corresponding address in bulk. It will return a list of status codes representing the individual write success or failure for each corresponding address.

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.

Syntax​

system.opc.writeValues(opcServer, itemPaths, values)

Parameters​

TypeParameterDescription
StringopcServerThe name of the OPC server connection in which the items reside.
List[String]itemPathsA list of item paths, or addresses, to write to.
List[Any]valuesA list of values to write to each address specified.

Returns​

List[Quality] - An array of Quality objects, each entry corresponding in order to the addresses specified. Refer to the list of writeValues objects.

Scope​

Gateway, Vision Client, Perspective Session

Code Examples​

Code Snippet
# This example will write values to specified OPC items
# Declare a list of values
objectValue = [3]

# Declare the item path to write values back to
itemPath = "ns=1;s=[GoldSim]B3/B3:100"

# Write the values to the specified item. Replace "Ignition OPC UA Server" with your chosen OPC UA server.
system.opc.writeValues("Ignition OPC UA Server", itemPath, objectValue)