Menu

Hiding object from list as per an array

Help
Daniel
2016-08-27
2016-08-28
  • Daniel

    Daniel - 2016-08-27

    Hi everybody I have a question about how can I "hide" some objects from the object list by example I want to make Universal output pins that can be configured as analog output (PWM) or digital output, but I was thinking about creating 16 analog output objects and 16 binary output and by example when I want to set the pin 3 as analog output I would set the third position in the array to the "2" value then it would disable the binary output object associated to this pin and prevent the binary object to show up during the list object request. Can you help me by saying if this idea is in the good way and if yes how can I prevent the object from displaying during the list object request ?

    Thanks again for this great stack !
    An example of the array with these values like that there would be only one object that will be showing and it would be analog_output:3
    // 0=Unused 1=binary 2=analogic(0-100%)
    //OUTPUT PIN 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
    int output[16] = {0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

     
  • Steve Karg

    Steve Karg - 2016-08-28

    The Device object functions, which hold the 'root' of the child objects, call these 3 functions for each object to see if a particular object exists:

    pObject->Object_Valid_Instance(rpdata->object_instance)
    

    and to see how many objects exist:

    count += pObject->Object_Count();
    

    and to get info about the specific object:

    pObject->Object_Index_To_Instance(object_index);
    

    For your objects, be sure that these functions are consistent with each other, and return only the objects you want other BACnet devices to discover, read, write, etc.

    I use this technique all the time for BACnet gateway products which have a dynamic number and type of objects.

     
  • Daniel

    Daniel - 2016-08-28

    Hi Steve, Thank for this prompt anwser but I am not able to figure out how I am able to do it from these functions, I have tryed some attemps but everytimes all the 16 AnalogInput , 16 BinaryInput and 16 BinaryOutput are showing into the bacnet explorer. Do you have a small piece of code that could be used as an example that could by example prevent the Binary output 2 object from showing in the list ?
    Thanks a lot for the help.

     

Log in to post a comment.