OAT readyagent AwtDaObject

Hi

Is there a ready agent mechanism to use data in a C structure and POST it to the server in a similar way to the sample string example following.

Thanks in advance

Ted

AwtDaObject* data = AWT_String_New("Hello world!"); 
                 
START OF   push_message(message = data, nodePath =  "", dataPath =  "message" ); follows:
    
	AWT_HL_DataContainer_Create(&pContainer, nodePath); 
	
	AWT_HL_DataContainer_AddTimeStampedValue(pContainer, dataPath, getTime(), message);  
	
	AWT_HL_A_DataManager_AddDataContainer(pDataManager, pContainer, NULL);  
        
END OF push_message()
    
    AWT_HL_A_DataManager_Flush(pDataManager);  
    
    AWT_DaObject_Release(data);  // Release objects

Hi

Having thought about this a bit more

Can you provide an example of the recommended way to use the readyagent api to push a set of data to the backend with a single timestamp?

For example data set:
Voltage = 345.7
State = “start”
Position = 24

Thanks

Hello,

sorry for the delay. What you want it is to send correlated data. So you need to use Correlated containers:
Those containers enable transport of structured correlated list of values. This means that all variables are synchronous and that the lists have the same number of values. Moreover if the data needs to be time stamped, a timestamp column can be added.

Here a short example with delta but you can do the same by pushing the full value (you can look at the API doc in the plugin help in the Developer Studio):

// Create data container for room2 "living-room"
AWT_HL_DataContainer_Create(&pDataContRoom2, ROOM2_PATH);
 
// Data to send: 16,17,18,17,19
// Create firstValue object
firstValue = AWT_Int32_New(16);
 
// Create the delta values
delta1 = AWT_Int32_New(1);
delta2 = AWT_Int32_New(1);
delta3 = AWT_Int32_New(-1);
delta4 = AWT_Int32_New(2);
 
// Create the list to store delta values
delta_list = AWT_List_New();
 
// Add the delta to the delta list
AWT_List_AddItem(delta_list, delta1);
AWT_List_AddItem(delta_list, delta2);
AWT_List_AddItem(delta_list, delta3);
AWT_List_AddItem(delta_list, delta4);
 
// Add the periodic deltas to the container
AWT_HL_DataContainer_AddPeriodicDeltas(pDataContRoom2, ROOM2_DATA_NAME,
     CURRENT, period, firstValue, delta_list);