Menu

multiple_read

gincy
2013-08-29
2013-09-05
  • gincy

    gincy - 2013-08-29

    I have compiled the bacnet stack on PIC18 and the device is working well.All the points and its values have been discovered..Now i want to know how to configure multiple read property in code.can anyone pls help me to know this???

     

    Last edit: gincy 2013-08-29
  • Steve Karg

    Steve Karg - 2013-08-29

    To add ReadPropertyMultiple to most project examples, do the following:
    a. Add src/rpm.c and demo/handler/h_rpm.c to your project.
    b. Add the following line to your BACnet initialization:

        apdu_set_confirmed_handler(SERVICE_CONFIRMED_READ_PROP_MULTIPLE,
            handler_read_property_multiple);
    

    c. In each object module, add the following lists and the function to retrieve them (see demo/object/xx.c files for examples):

        static const int Properties_Required[]
        static const int Properties_Optional[]
        static const int Properties_Proprietary[]
        void Analog_Input_Property_Lists(
            const int **pRequired,
            const int **pOptional,
            const int **pProprietary)
    

    d. Add each object list function to the device object function table for the rpm_property_lists_function.

    To add ReadPropertyMultiple to the ports/pic18f6720/ example follow the above except:
    a. Instead of apdu_set_confirmed_handler, edit ports/pic18f6720/apdu.c and add the following below SERVICE_CONFIRMED_READ_PROPERTY:

        } else if (service_choice == SERVICE_CONFIRMED_READ_PROP_MULTIPLE) {
            handler_write_property(service_request,
                service_request_len, src, &service_data);
    

    b. Instead of adding each object list function to the device object function table, create Device_Objects_Property_List() function in ports/pic18f6720/device.c that will return the property lists for the requested object. See demo/object/device.c for guidance.

    c. In the ports/pic18f6720/apdu.c file, in apdu_service_supported() function, add:

            case SERVICE_SUPPORTED_READ_PROP_MULTIPLE:
    
     

    Last edit: Steve Karg 2013-08-30
  • gincy

    gincy - 2013-08-30

    Hi Steve
    Thanks for the reply.
    I added src/rpm.c and demo/handler/h_rpm.c and also edited in apdu.c as u said.I included that 3 array declaration and that function definition in every object module codes and finally created Device_Objects_Property_List() function in ports/pic18f6720/device.c in my device.c file.Still multiple read is not working.
    I dont have much idea about Bacnet.So what should i do to make it work???

     
  • Steve Karg

    Steve Karg - 2013-08-30

    In the ports/pic18f6720/apdu.c file, in apdu_service_supported() function, add:

            case SERVICE_SUPPORTED_READ_PROP_MULTIPLE:
    

    If it does not work, then what is the error code or reply that you receive?

     
  • gincy

    gincy - 2013-09-04

    Thanks
    It works...
    but it reads only 2 objects at a time..How can i read all objects??

     
  • Steve Karg

    Steve Karg - 2013-09-05

    The ports/pic18f6720/ project has the MAX_APDU set to 50 to fit in the RAM, and therefore, the ReadPropertyMultiple can only fit a small number of properties at a time. You could increase MAX_APDU in the project settings (in BACnet-Server.mcp file as -DMAX_APDU=50), but you have to keep in mind the PIC RAM paging of 256 bytes and the RAM usage of each module. The minimum APDU size is 50 bytes, and the maximum APDU size on non-segmented MS/TP is 480 bytes. Note that there is a proposal to extend the MS/TP frames to 1497, but that is not standard yet.

     

Log in to post a comment.