BacNet IP not connected
-
Hello, I'm starting to mess with BacNet IP devices and I'm facing some problems.
In the part of Backnet Local Devices I put the IP of the Linux server that is running the Mango (192.168.0.23)
So I went to configure Data Soucer but it does not connect and does not find the points
I tried both with the ip of the server mango (192.168.0.23) and the Ip of the BacNet-enabled device (182.168.0.241) and neither of them connected.
Following is information from my Bacnet device:
-
I'm pretty sure you want your local bind address to be 0.0.0.0, did you try that?
-
ok thank you, I tried with all but 0.0.0.0.
I started to mess with bacnet now and I'm kind of lost, but thank you !!
Would not it be possible to pull the value of a TrendLog type variable?
-
@leoboeng Any suggestion ?
-
Did setting the local device address to 0.0.0.0 fix your connectivity problems ?
-
This post is deleted! -
Mango does not support polling Trend Log points as one would an analog value. You can probably read any property on those objects, either through the API (takes some effort) or through a scripting data source (get the local device, figure out from the BACnet4J code how to send read property requests)..
What property would you be trying to read from a trend log object? They do not have a 'presentValue' property like the other readable points do.
-
It would be to read device historical values. It does not present "presentValue" for some data types.
-
You want to read the logBuffer property, I guess.
I didn't test this script (I don't have a BACnet device with a trend log on hand), but I adapted it from this thread to print the LogRecord objects in the 'logBuffer' property of Trend Log object number 1: https://forum.infiniteautomation.com/topic/3117/bacnet-scheduler
//Get the local device config from a configured bacnet data source. //Edit DS XID var localDeviceConfig = com.serotonin.m2m2.db.dao.DataSourceDao.instance.getByXid("DS_354e2188-4867-431b-9051-bca39b011ed7").getLocalDeviceConfig(); localDeviceConfig = com.serotonin.ma.bacnet.device.LocalDeviceDwr.getLocalDevice(localDeviceConfig); var listener = new com.serotonin.ma.bacnet.ScriptableDeviceEventListener(); listener.registerListenerExceptionHandler( function(excp) { print("Listener Exception"); }); listener.registerIAmReceivedHandler( function(removeDevice) {print("Remote device");}); listener.registerAllowPropertyWriteHandler( function(from, obj, pv) {print("Allow property write");}); listener.registerPropertyWrittenHandler( function(from, obj, pv) {print("Property written");}); listener.registerIHaveReceivedHandler( function(removeDevice, removeObject) {print("I have received");}); listener.registerCovNotificationReceivedHandler( function(subIdentifier, initDeviceIdentifier, monitoredObjectIdentifier, timeRemaining, listOfValues) {print("COV notification");}); listener.registerEventNotificationReceivedHandler( function(processIdentifier, initDeviceIdentifier, eventObjectIdentifier, timestamp, notificationClass, priority, eventType, messageText, notifyType, ackRequired, fromState, toState, eventValues) {print("Register event notification received");}); listener.registerTextMessageReceivedHandler( function(textMessageSourceDevice, messageClass, messagePriority, message) {print("Text message received");}); listener.registerSynchronizeTimeHandler( function(from, dateTime, utc) {print("Sync time received");}); listener.registerRequestReceivedHandler( function(from, service) {print("Request received");}); var localDevice = com.serotonin.ma.bacnet.device.LocalDeviceFactory.getLocalDevice(localDeviceConfig, listener); //print(localDevice); try { //Create the read request... See com.serotonin.bacnet4j.type.enumerated.ObjectType for object types var objectIdentifier = new com.serotonin.bacnet4j.type.primitive.ObjectIdentifier(com.serotonin.bacnet4j.type.enumerated.ObjectType.trend Log, 1); //EDIT: object instance number var propertyIdentifier = com.serotonin.bacnet4j.type.enumerated.PropertyIdentifier.logBuffer; var readRequest = new com.serotonin.bacnet4j.service.confirmed.ReadPropertyRequest(objectIdentifier, propertyIdentifier); //Get the remote device and send the request, edit the remote device number var remoteDevice = localDevice.getRemoteDeviceBlocking(123); var result = localDevice.send(remoteDevice, readRequest).get(); //result should be a read service ack that we can hopefully get a com.serotonin.bacnet4j.type.constructed.BACnetArray of com.serotonin.bacnet4j.type.constructed.LogRecord from var logRecords = result.getValue(); //now iterate this list and do what for(var k = 0; k < logRecords.size(); k+=1) { print(logRecords.get(k).toString()); } } finally { com.serotonin.ma.bacnet.device.LocalDeviceFactory.releaseLocalDevice(localDevice, listener); }
You may need to edit the data source xid, object instance number, and remote device id, as noted in the comments.