Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL USER MANUAL VERSIONS

Ignition 8.1
Ignition 7.9
Ignition 7.8

Deprecated Pages

Employees

Sign In

Skip to end of metadata
Go to start of metadata

This function is used in Python Scripting.

Description

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.

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.writeValue(opcServer, itemPath, value)

  • Parameters

String opcServer - The name of the OPC server connection in which the item resides.

String itemPath - The item path, or address, to write to.

Object value - The value to write to the OPC item.

  • Returns

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

  • Scope

Gateway, Vision Client, Perspective Session

Code Examples
Code Snippet - Writing to an OPC Value
server = "Ignition OPC UA Server"
path = "[SLCSim]_Meta:N7/N7:0"
oldQualifiedValue = system.opc.readValue(server, path)
newValue = oldQualifiedValue.getValue() + 1
returnQuality = system.opc.writeValue(server, path, newValue)
if returnQuality.isGood():
	print "Write was successful"
else:
	print "Write failed" 
Keywords

system opc writeValue, opc.writeValue  

  • No labels