# \[Feature-7753\] Addon some specific bacnet object type to IGN Bacnet driver process?

**URL:** <https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256>\
**Category:** Module Development\
**Tags:** ignition81\
**Created:** [May 4, 2023, 1:22pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256 "2023-05-04T13:22:09Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![r.lebohec](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/r.lebohec/32/3704_2.png) [@r.lebohec](https://forum.inductiveautomation.com/u/r.lebohec)\
**Post date:** [May 4, 2023, 1:22pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/1 "2023-05-04T13:22:09Z")

</div>

@Kevin.Herron  
Currently, we are revamp a old SCADA with an Ignition. Communications to Siemens APIs being done in Bacnet, it turns out that certain bacnet objects are specific to Siemens.  
After performing a wireshark of the communication, the specific objects are composed only of standard/primitive type.  
Is it possible, by means of a specific module, to complete the bacnet objects managed by the Bacnet Ignition module?  
Thus these objects would be interrogated like the others through the system.bacnet.readRaw(...) or a derivate function.  
Any suggestions?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 4, 2023, 1:23pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/2 "2023-05-04T13:23:57Z")

</div>

If this is possible, it would be via readRaw, modifying the example from [system.bacnet.readRaw - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.bacnet.readRaw) like this:

```auto
from system.bacnet.enumerated import ObjectType
from system.bacnet.enumerated import PropertyIdentifier
     
ot = ObjectType(1234)
pid = PropertyIdentifier(5678)

```

where you have used Wireshark or whatever other means to figure out the type and property ids of the custom objects.

I don't know if the underlying BACnet library supports custom objects or not, so I think you'll be a pioneer.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 5, 2023, 11:00am UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/3 "2023-05-05T11:00:19Z")

</div>

It seems not possible to add some new ObjectType without changes in the Bacnet4J stack used by Ignition Bacnet Driver ?

The aim is to be able to define some new **ObjectType** (id \> 59) with its **ObjectProperties** we could read/write with system.bacnet.ReadRaw/WriteRaw to cover **Proprietary Devices with custom ObjectType**.

A function like system.bacnet.addObjectType... would be very welcome !

> <https://github.com/MangoAutomation/BACnet4J/blob/master/src/main/java/com/serotonin/bacnet4j/type/enumerated/ObjectType.java>

> <https://github.com/MangoAutomation/BACnet4J/blob/master/src/main/java/com/serotonin/bacnet4j/obj/ObjectProperties.java>

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 16, 2023, 1:21pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/4 "2023-05-16T13:21:43Z")

</div>

we plan to use **readRaw** to read **a**  **large amount**  **of** data.  
I suppose each call to readRaw will generate a request to the device ?

If it's the case, to be more efficient would it be possible to add a system script function:

- to read multiple properties on the same object ?
- or perhpas the same propertie on multiple objects ?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 17, 2023, 9:18am UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/5 "2023-05-17T09:18:47Z")

</div>

perhaps @ggross has an experience feedback on this topic ?

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [May 17, 2023, 3:55pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/6 "2023-05-17T15:55:48Z")

</div>

You are correct that each request via system.bacnet.readRaw/writeRaw would be handled as an individual request. The original goal of exposing the library was to allow for one offs on objects that we don't currently support but customers have a requirement to access. While we could potentially go down the route of reading/writing via custom functions for multiple items at once, I think we would want to understand the specific objects you are trying to work with and potentially enhance the existing driver so that the additional work of dealing with the library isn't needed for any of our customers.

That being said, can you elaborate on the use case and the specific objects you are trying to get access to at all?

Garth

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 17, 2023, 6:39pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/7 "2023-05-17T18:39:08Z")

</div>

@ggross,  
Objects we needs to read/write are mainly:

- 
  1. Standard bacnet Object : **Loop, Calendar, Schedule**

- 
  1. Vender specific bacnet Object ( **Siemens** )

We have more than 50 devices per site \* 4 sites.

For 1. we would really appreciate a new system script function to:

- read multiple properties on the same object
- perhpas the same propertie on multiple objects

For 2. A script fonction to be able to add the definition of the vendor specific object woiuld be perfect !

---

<div class="post-metadata">

**Author:** ![ggross](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ggross/32/12668_2.png) [@ggross](https://forum.inductiveautomation.com/u/ggross)\
**Post date:** [May 19, 2023, 5:41pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/8 "2023-05-19T17:41:56Z")

</div>

@mazeyrat,

**Calendar** and **Schedule** are objects that come up quite a bit as objects requested for support. Based on my discussions internally, we really can't do anything about adding direct support for these objects until we can support OPC UA 1.05 which is a much larger hurdle we need to clear. The intention is to come back and add those objects at some point in the future.

The other requested objects sounds like the general reasoning the **Raw** capabilities were added. I have created a feature ticket to potentially add a `readRawMultiple` scripting function to the `system.bacnet` capabilities.

Garth

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 19, 2023, 6:03pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/9 "2023-05-19T18:03:59Z")

</div>

Thanks, I Hope readRawMultiple will be added as soon as possible ! It will be a great addition for us.

But for item 2, concerning objects with id above 59, **vendor specific definition** and not present in bacnet4J stack, but quite commonly used in BMS devices...

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 19, 2023, 6:08pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/10 "2023-05-19T18:08:50Z")

</div>

> [@mazeyrat](#):
>
> But for item 2, concerning objects with id above 59, **vendor specific definition** and not present in bacnet4J stack, but quite commonly used in BMS devices...

Did you see where I explained how to construct an ObjectType and PropertyIdentifier with custom id? Does this not work?

> [@\[Feature-7753\] Addon some specific bacnet object type to IGN Bacnet driver process?](https://forum.inductiveautomation.com/t/addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/2):
>
> If this is possible, it would be via readRaw, modifying the example from [system.bacnet.readRaw - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.bacnet.readRaw) like this: from system.bacnet.enumerated import ObjectType from system.bacnet.enumerated import PropertyIdentifier ot = ObjectType(1234) pid = PropertyIdentifier(5678) where you have used Wireshark or whatever other means to figure out the type and property ids of the custom objects. I don't know if the underlying BACnet library supports cust…

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 19, 2023, 6:31pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/11 "2023-05-19T18:31:37Z")

</div>

We will try next week with the siemens devices.  
I thought it was necessary to make some changes in the driver to accept those custom objects with the readRaw function.  
We will keep you updated.

---

<div class="post-metadata">

**Author:** ![r.lebohec](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/r.lebohec/32/3704_2.png) [@r.lebohec](https://forum.inductiveautomation.com/u/r.lebohec)\
**Post date:** [May 22, 2023, 2:10pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/12 "2023-05-22T14:10:36Z")

</div>

I did some tests as Kevin said before and  
ObjectType / PropertyType construction aren't allowed by the module. Indeed, the driver raises an exception after checking in the Enumerated classes:  
"com.serotonin.bacnet4j.type.enumerated.ObjectType" for objects

"com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier" for properties

> pid = PropertyIdentifier(3017)

> ot = ObjectType(201)

> INFO | jvm 1 | 2023/05/22 15:23:31 | File "function:runAction", line 37, in runAction  
> INFO | jvm 1 | 2023/05/22 15:23:31 | TypeError: **com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier(): 1st arg can't be coerced to com.serotonin.bacnet4j.util.sero.ByteQueue**  
> INFO | jvm 1 | 2023/05/22 15:23:31 |  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.Py.TypeError(Py.java:236)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:213)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyReflectedFunction.throwBadArgError(PyReflectedFunction.java:316)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyReflectedFunction.throwError(PyReflectedFunction.java:325)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyReflectedConstructor. **call** (PyReflectedConstructor.java:179)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyObject. **call** (PyObject.java:422)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyMethod.instancemethod\_\_\_call\_\_(PyMethod.java:237)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyMethod. **call** (PyMethod.java:228)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyMethod. **call** (PyMethod.java:223)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.Deriveds.dispatch\_\_init\_\_(Deriveds.java:20)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyObjectDerived.dispatch\_\_init\_\_(PyObjectDerived.java:1112)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyType.type\_\_\_call\_\_(PyType.java:2408)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyType. **call** (PyType.java:2389)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyObject. **call** (PyObject.java:461)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyObject. **call** (PyObject.java:465)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.pycode._pyx4269.runAction$1(function:runAction:65)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.pycode.pyx4269.call\_function(function:runAction)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyTableCode.call(PyTableCode.java:173)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyBaseCode.call(PyBaseCode.java:306)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyFunction.function\_\_\_call_(PyFunction.java:474)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyFunction. **call** (PyFunction.java:469)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at org.python.core.PyFunction. **call** (PyFunction.java:464)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:846)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:828)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:832)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:1009)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:897)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invokeScript(ScriptFunctionHelper.java:141)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:180)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.action.ScriptAction.runAction(ScriptAction.java:74)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.action.ActionDecorator.runAction(ActionDecorator.java:18)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.action.SecuredAction.runAction(SecuredAction.java:44)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.lambda$call$0(ActionCollection.java:263)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.api.LoggingContext.mdc(LoggingContext.java:54)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:252)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:221)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue$TaskWrapper.run(BlockingTaskQueue.java:154)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at java.base/java.util.concurrent.FutureTask.run(Unknown Source)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at com.inductiveautomation.perspective.gateway.threading.BlockingWork$BlockingWorkRunnable.run(BlockingWork.java:58)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | at java.base/java.lang.Thread.run(Unknown Source)  
> INFO | jvm 1 | 2023/05/22 15:23:31 | Caused by: org.python.core.PyException: TypeError: com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier(): 1st arg can't be coerced to com.serotonin.bacnet4j.util.sero.ByteQueue  
> INFO | jvm 1 | 2023/05/22 15:23:31 | ... 43 common frames omitted

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 22, 2023, 2:13pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/13 "2023-05-22T14:13:14Z")

</div>

Oops, try this instead:

```auto
pid = PropertyIdentifier.forId(42)

```

---

<div class="post-metadata">

**Author:** ![r.lebohec](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/r.lebohec/32/3704_2.png) [@r.lebohec](https://forum.inductiveautomation.com/u/r.lebohec)\
**Post date:** [May 22, 2023, 2:30pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/14 "2023-05-22T14:30:33Z")

</div>

Our goal here isn't that inductive automation handles all specific properties of all constructors but that there is a default implementation of Bacnet properties as shown by Yabe (a must have Bacnet tool: [https://sourceforge.net](https://sourceforge.net) /projects/yetanotherbacnetexplorer/).

 ![CaptureOutputValue](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/6/669253962b2aa81fc5ed85156e5897c02dfb1ab5.png)

Yabe reports properties according to the Primitive type although identified by a constructor-specific Id (unknown to Yabe). ex: id:3017 (specific id of the manufacturer) value:100 (real type value, indicating the PID adjustment slope).

In this way we can make a binding according to the necessary properties.

---

<div class="post-metadata">

**Author:** ![r.lebohec](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/r.lebohec/32/3704_2.png) [@r.lebohec](https://forum.inductiveautomation.com/u/r.lebohec)\
**Post date:** [May 23, 2023, 2:25pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/15 "2023-05-23T14:25:18Z")

</div>

Thanks Kevin,  
For readings it works fine. A specific bacnet property/object can be accessed through the **readRaw** query and using the 'forId' function of the system.bacnet.enumerated.ObjectType and system.bacnet.enumerated.PropertyIdentifier classes

> from system.bacnet.enumerated import ObjectType  
> from system.bacnet.enumerated import PropertyIdentifier
> 
> ot = ObjectType.forId(201)  
> pid = PropertyIdentifier.forId(3011)

On the same model as readRaw implementing a "readPropertyMultiple" function would optimize read requests.

Regarding the **writeRaw** function, it seems that there is a pre-write check of the property type / object type although the supplied types / object identifiers are correct.

> com.inductiveautomation.ignition.common.script.JythonExecException  
> Traceback (most recent call last):  
> File "function:runAction", line 32, in runAction  
> TypeError: invalid object type or property identifier
> 
> at org.python.core.Py.TypeError(Py.java:236)  
> at com.inductiveautomation.ignition.drivers.bacnet.scripting.BacnetScriptingFunctions.writeRaw(BacnetScriptingFunctions.kt:239)  
> at jdk.internal.reflect.GeneratedMethodAccessor2088.invoke(Unknown Source)  
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
> at java.base/java.lang.reflect.Method.invoke(Unknown Source)  
> at org.python.core.PyReflectedFunction. **call** (PyReflectedFunction.java:190)  
> at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction. **call** (ScriptManager.java:552)  
> at org.python.core.PyObject. **call** (PyObject.java:400)  
> at org.python.pycode._pyx4393.runAction$1(function:runAction:36)  
> at org.python.pycode.pyx4393.call\_function(function:runAction)  
> at org.python.core.PyTableCode.call(PyTableCode.java:173)  
> at org.python.core.PyBaseCode.call(PyBaseCode.java:306)  
> at org.python.core.PyFunction.function\_\_\_call_(PyFunction.java:474)  
> at org.python.core.PyFunction. **call** (PyFunction.java:469)  
> at org.python.core.PyFunction. **call** (PyFunction.java:464)  
> at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:846)  
> at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:828)  
> at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:832)  
> at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:1009)  
> at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:897)  
> at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invokeScript(ScriptFunctionHelper.java:141)  
> at com.inductiveautomation.perspective.gateway.script.ScriptFunctionHelper.invoke(ScriptFunctionHelper.java:180)  
> at com.inductiveautomation.perspective.gateway.action.ScriptAction.runAction(ScriptAction.java:74)  
> at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.lambda$call$0(ActionCollection.java:263)  
> at com.inductiveautomation.perspective.gateway.api.LoggingContext.mdc(LoggingContext.java:54)  
> at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:252)  
> at com.inductiveautomation.perspective.gateway.model.ActionCollection$ActionSequence$ExecuteActionsTask.call(ActionCollection.java:221)  
> at com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue$TaskWrapper.run(BlockingTaskQueue.java:154)  
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)  
> at java.base/java.util.concurrent.FutureTask.run(Unknown Source)  
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)  
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)  
> at com.inductiveautomation.perspective.gateway.threading.BlockingWork$BlockingWorkRunnable.run(BlockingWork.java:58)  
> at java.base/java.lang.Thread.run(Unknown Source)  
> Caused by: org.python.core.PyException  
> Traceback (most recent call last):  
> File "function:runAction", line 32, in runAction  
> TypeError: invalid object type or property identifier
> 
> ... 34 more
> 
> Ignition v8.1.26 (b2023032308)  
> Java: Azul Systems, Inc. 11.0.18

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 24, 2023, 5:10pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/16 "2023-05-24T17:10:35Z")

</div>

> [@r.lebohec](#):
>
> BacnetScriptingFunctions

@ggross Any idea why **writeRaw** doesn't allow custom object type id or custom property Identifier, like the **readRaw** script function ?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 24, 2023, 5:13pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/17 "2023-05-24T17:13:36Z")

</div>

It's because we have to coerce the values provided to the scripting call into the corresponding types in the BACnet library, and we can't do this for object/properties we know nothing about.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 24, 2023, 5:51pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/18 "2023-05-24T17:51:32Z")

</div>

Ok I see, would it be possible to add an optional parameter for the **writeRaw** function to provide the type of the property, in case of the property to write is vendor proprietary ?  
**That would help a lot !**

The readRaw is fine with vendor proprietary ObjectType and Property despite id are unkown in the bacnet stack...I suppose in that case, the property type is deducted from the returned read value ?

```auto
ot = ObjectType.forId(201)
pid = PropertyIdentifier.forId(3011)

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 24, 2023, 6:00pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/19 "2023-05-24T18:00:26Z")

</div>

We'll have to modify the function so that if the value provided is a BACnet stack `Encodable` it skips the checks and coercion. You'll have to construct the value using the imports available under `system.bacnet.enumerated`, `system.bacnet.primitive`, `system.bacnet.constructed` and then instantiating the right type.

For read, the value returned _is_ a BACnet stack `Encodable`, no coercion or prior knowledge of what's coming back is necessary.

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [May 24, 2023, 6:13pm UTC](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256/20 "2023-05-24T18:13:00Z")

</div>

Awesome, we are ready to test a **beta bacnet driver module** with this change as soon as possible !

[Next page](https://forum.inductiveautomation.com/t/feature-7753-addon-some-specific-bacnet-object-type-to-ign-bacnet-driver-process/73256.md?page=2)
