The following feature is new in Ignition version 8.1.18
Click here to check out the other new features
This function is used in Python Scripting.

Description

Write to any BACnet object not explicitly supported by the BACnet driver.

Note: To use this function, the BACnet driver must be installed.
Caution: Please use caution when interacting directly with any BACnet device, as writing to an object may have unintended consequences and could result in data loss.

 


Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

system.bacnet.writeRaw(deviceName, objectType, objectId, propertyId, value, [priority], [propertyArrayIndex])

  • Parameters

String deviceName The name of the configured BACnet/IP device instance to write from.

ObjectType objectType The numeric id of the objectType of the object instance being written to. See the objectType Reference below. 

Integer objectId The object instance number to write to.

PropertyIdentifier propertyId - The PropertyIdentifier of the object instance being written to. See the propertyId Reference below.

Object value The value to write. Clearing a value can be accomplished by writing a None value. 

Integer priority - [optional] The priority level to use when writing to commandable properties. Must match a level in the standard BACnet priority array (a value from 1 to 16). See the Priority Reference table below. This parameter is optional and defaults to 8 if not specified.

Integer propertyArrayIndex - [optional] The array index of the property to write to. This parameter is optional and should not be used when writing to the entire array or if the property is not an array.

  • Returns

Nothing

  • Scope

Gateway

Importing Classes

You can import classes from system.bacnet.* like you would other Python classes:

Example
from system.bacnet.enumerated import ObjectType
from system.bacnet.enumerated import PropertyIdentifier
	
ot = ObjectType.calendar
pid = PropertyIdentifier.dateList

You can also iterate those system.bacnet.* packages to see all available classes:

Example
for d in dir(system.bacnet.constructed):
	print d

API Docs

BACnet4j Library of all classes available for import can be accessed at this link: BACnet4j Library 6.0.1 API Docs

References

objectType Reference

Values for the objectType parameter that can be referenced at system.bacnet.enumerated.ObjectType.*

objectType reference
analogInput
analogOutput
analogValue
binaryInput
binaryOutput
binaryValue
calendar
command
device
eventEnrollment
file
group
loop
multiStateInput
multiStateOutput
notificationClass
program
schedule
averaging
multiStateValue
trendLog
lifeSafetyPoint
lifeSafetyZone
accumulator
pulseConverter
eventLog
globalGroup
trendLogMultiple
loadControl
structuredView
accessDoor
timer
accessCredential
accessPoint
accessRights
accessUser
accessZone
credentialDataInput
networkSecurity
bitstringValue
characterstringValue
datePatternValue
dateValue
datetimePatternValue
datetimeValue
integerValue
largeAnalogValue
octetstringValue
positiveIntegerValue
timePatternValue
timeValue
notificationForwarder
alertEnrollment
channel
lightingOutput
binaryLightingOutput
networkPort
elevatorGroup
escalator
lift

propertyId Reference

Values for the propertyId parameter that can be referenced at system.bacnet.enumerated.PropertyIdentifier.*

propertyId reference
ackedTransitions
ackRequired
action
actionText
activeText
activeVtSessions
alarmValue
alarmValues
all
allWritesSuccessful
apduSegmentTimeout
apduTimeout
applicationSoftwareVersion
archive
bias
changeOfStateCount
changeOfStateTime
notificationClass
controlledVariableReference
controlledVariableUnits
controlledVariableValue
covIncrement
dateList
daylightSavingsStatus
deadband
derivativeConstant
derivativeConstantUnits
description
descriptionOfHalt
deviceAddressBinding
deviceType
effectivePeriod
elapsedActiveTime
errorLimit
eventEnable
eventState
eventType
exceptionSchedule
faultValues
feedbackValue
fileAccessMethod
fileSize
fileType
firmwareRevision
highLimit
inactiveText
inProcess
instanceOf
integralConstant
integralConstantUnits
limitEnable
listOfGroupMembers
listOfObjectPropertyReferences
localDate
localTime
location
lowLimit
manipulatedVariableReference
maximumOutput
maxApduLengthAccepted
maxInfoFrames
maxMaster
maxPresValue
minimumOffTime
minimumOnTime
minimumOutput
minPresValue
modelName
modificationDate
notifyType
numberOfApduRetries
numberOfStates
objectIdentifier
objectList
objectName
objectPropertyReference
objectType
optional
outOfService
outputUnits
eventParameters
polarity
presentValue
priority
priorityArray
priorityForWriting
processIdentifier
programChange
programLocation
programState
proportionalConstant
proportionalConstantUnits
protocolObjectTypesSupported
protocolServicesSupported
protocolVersion
readOnly
reasonForHalt
recipientList
reliability
relinquishDefault
required
resolution
segmentationSupported
setpoint
setpointReference
stateText
statusFlags
systemStatus
timeDelay
timeOfActiveTimeReset
timeOfStateCountReset
timeSynchronizationRecipients
units
updateInterval
utcOffset
vendorIdentifier
vendorName
vtClassesSupported
weeklySchedule
attemptedSamples
averageValue
bufferSize
clientCovIncrement
covResubscriptionInterval
eventTimeStamps
logBuffer
logDeviceObjectProperty
enable
logInterval
maximumValue
minimumValue
notificationThreshold
protocolRevision
recordsSinceNotification
recordCount
startTime
stopTime
stopWhenFull
totalRecordCount
validSamples
windowInterval
windowSamples
maximumValueTimestamp
minimumValueTimestamp
varianceValue
activeCovSubscriptions
backupFailureTimeout
configurationFiles
databaseRevision
directReading
lastRestoreTime
maintenanceRequired
memberOf
mode
operationExpected
setting
silenced
trackingValue
zoneMembers
lifeSafetyAlarmValues
maxSegmentsAccepted
profileName
autoSlaveDiscovery
manualSlaveAddressBinding
slaveAddressBinding
slaveProxyEnable
lastNotifyRecord
scheduleDefault
acceptedModes
adjustValue
count
countBeforeChange
countChangeTime
covPeriod
inputReference
limitMonitoringInterval
loggingObject
loggingRecord
prescale
pulseRate
scale
scaleFactor
updateTime
valueBeforeChange
valueSet
valueChangeTime
alignIntervals
intervalOffset
lastRestartReason
loggingType
restartNotificationRecipients
timeOfDeviceRestart
timeSynchronizationInterval
trigger
utcTimeSynchronizationRecipients
nodeSubtype
nodeType
structuredObjectList
subordinateAnnotations
subordinateList
actualShedLevel
dutyWindow
expectedShedLevel
fullDutyBaseline
requestedShedLevel
shedDuration
shedLevelDescriptions
shedLevels
stateDescription
doorAlarmState
doorExtendedPulseTime
doorMembers
doorOpenTooLongTime
doorPulseTime
doorStatus
doorUnlockDelayTime
lockStatus
maskedAlarmValues
securedStatus
absenteeLimit
accessAlarmEvents
accessDoors
accessEvent
accessEventAuthenticationFactor
accessEventCredential
accessEventTime
accessTransactionEvents
accompaniment
accompanimentTime
activationTime
activeAuthenticationPolicy
assignedAccessRights
authenticationFactors
authenticationPolicyList
authenticationPolicyNames
authenticationStatus
authorizationMode
belongsTo
credentialDisable
credentialStatus
credentials
credentialsInZone
daysRemaining
entryPoints
exitPoints
expirationTime
extendedTimeEnable
failedAttemptEvents
failedAttempts
failedAttemptsTime
lastAccessEvent
lastAccessPoint
lastCredentialAdded
lastCredentialAddedTime
lastCredentialRemoved
lastCredentialRemovedTime
lastUseTime
lockout
lockoutRelinquishTime
maxFailedAttempts
members
musterPoint
negativeAccessRules
numberOfAuthenticationPolicies
occupancyCount
occupancyCountAdjust
occupancyCountEnable
occupancyLowerLimit
occupancyLowerLimitEnforced
occupancyState
occupancyUpperLimit
occupancyUpperLimitEnforced
passbackMode
passbackTimeout
positiveAccessRules
reasonForDisable
supportedFormats
supportedFormatClasses
threatAuthority
threatLevel
traceFlag
transactionNotificationClass
userExternalIdentifier
userInformationReference
userName
userType
usesRemaining
zoneFrom
zoneTo
accessEventTag
globalIdentifier
verificationTime
baseDeviceSecurityPolicy
distributionKeyRevision
doNotHide
keySets
lastKeyServer
networkAccessSecurityPolicies
packetReorderTime
securityPduTimeout
securityTimeWindow
supportedSecurityAlgorithms
updateKeySetTimeout
backupAndRestoreState
backupPreparationTime
restoreCompletionTime
restorePreparationTime
bitMask
bitText
isUtc
groupMembers
groupMemberNames
memberStatusFlags
requestedUpdateInterval
covuPeriod
covuRecipients
eventMessageTexts
eventMessageTextsConfig
eventDetectionEnable
eventAlgorithmInhibit
eventAlgorithmInhibitRef
timeDelayNormal
reliabilityEvaluationInhibit
faultParameters
faultType
localForwardingOnly
processIdentifierFilter
subscribedRecipients
portFilter
authorizationExemptions
allowGroupDelayInhibit
channelNumber
controlGroups
executionDelay
lastPriority
writeStatus
propertyList
serialNumber
blinkWarnEnable
defaultFadeTime
defaultRampRate
defaultStepIncrement
egressTime
inProgress
instantaneousPower
lightingCommand
lightingCommandDefaultPriority
maxActualValue
minActualValue
power
transition
egressActive
interfaceValue
faultHighLimit
faultLowLimit
lowDiffLimit
strikeCount
timeOfStrikeCountReset
defaultTimeout
initialTimeout
lastStateChange
stateChangeValues
timerRunning
timerState
apduLength
ipAddress
ipDefaultGateway
ipDhcpEnable
ipDhcpLeaseTime
ipDhcpLeaseTimeRemaining
ipDhcpServer
ipDnsServer
bacnetIpGlobalAddress
bacnetIpMode
bacnetIpMulticastAddress
bacnetIpNatTraversal
ipSubnetMask
bacnetIpUdpPort
bbmdAcceptFdRegistrations
bbmdBroadcastDistributionTable
bbmdForeignDeviceTable
changesPending
command
fdBbmdAddress
fdSubscriptionLifetime
linkSpeed
linkSpeeds
linkSpeedAutonegotiate
macAddress
networkInterfaceName
networkNumber
networkNumberQuality
networkType
routingTable
virtualMacAddressTable
commandTimeArray
currentCommandPriority
lastCommandTime
valueSource
valueSourceArray
bacnetIpv6Mode
ipv6Address
ipv6PrefixLength
bacnetIpv6UdpPort
ipv6DefaultGateway
bacnetIpv6MulticastAddress
ipv6DnsServer
ipv6AutoAddressingEnable
ipv6DhcpLeaseTime
ipv6DhcpLeaseTimeRemaining
ipv6DhcpServer
ipv6ZoneIndex
assignedLandingCalls
carAssignedDirection
carDoorCommand
carDoorStatus
carDoorText
carDoorZone
carDriveStatus
carLoad
carLoadUnits
carMode
carMovingDirection
carPosition
elevatorGroup
energyMeter
energyMeterRef
escalatorMode
faultSignals
floorText
groupId
groupMode
higherDeck
installationId
landingCalls
landingCallControl
landingDoorStatus
lowerDeck
machineRoomId
makingCarCall
nextStoppingFloor
operationDirection
passengerAlarm
powerMode
registeredCarCall
activeCovMultipleSubscriptions
protocolLevel
referencePort
deployedProfileLocation
profileLocation
tags
subordinateNodeTypes
subordinateTags
subordinateRelationships
defaultSubordinateRelationship
represents

Enums Reference

Enum objects which can be referenced at system.bacnet.enums.*

Enums reference
DayOfWeek
MaxApduLength
MaxSegments
Month
Code Examples

Writing to an Enumerated Object

Writing "reverse" or 1 to the Polarity property of an instance 1 BinaryLightingOutput object.

Example
ot = system.bacnet.enumerated.ObjectType.binaryLightingOutput
pid = system.bacnet.enumerated.PropertyIdentifier.polarity
	
# The below writes all do the same thing:
	
polarity = system.bacnet.enumerated.Polarity.forId(1)
system.bacnet.writeRaw("bacnetDevice", ot, 1, pid, polarity)
	
# Integer codes are automatically coerced to the appropriate enumerated object
system.bacnet.writeRaw("bacnetDevice", ot, 1, pid, 1)
	
# Enumerated names are also automatically coerced (case-insensitive)
system.bacnet.writeRaw("bacnetDevice", ot, 1, pid, "reverse")


Writing to an Array Element

Writing CalendarEntry to index 5 of the DateList property of an index 0 Calendar object.

Example
from java.util import GregorianCalendar
	
ot = system.bacnet.enumerated.ObjectType.calendar
pid = system.bacnet.enumerated.PropertyIdentifier.dateList
	
gc = GregorianCalendar()
gc.setTime(system.date.now())
date = system.bacnet.primitive.Date(gc)
ce = system.bacnet.constructed.CalendarEntry(date)
	
system.bacnet.writeRaw(
	deviceName="bacnetDevice", 
	objectType=ot, 
	objectId=0, 
	propertyId=pid,
	value=ce,
	propertyArrayIndex=5
)



Keywords

system bacnet writeRawbacnet.writeRaw