CAN datapoint must a "Sent" datapoint and defined in User Defined Messages sent section.
Example Code
Read a datapoint to a variable
uint32_t variable1;// Reads the CAN message (data-point-name = POINT1) and writes it into variable1
variable1 =can_db_get_value(POINT1);uint32_t variable2;// Reads the CAN message (data-point-name = CAN_AVERAGE_CONSUMPTION) and writes it into variable2
variable2 =can_db_get_value(CAN_AVERAGE_CONSUMPTION);
Set the value of a data point
// Set the value of data-point "POINT2" to 23.can_db_set_value(POINT2,23);// or// Set the value of data-point "CAN_ANALOG_INPUT_ANA0" to the analog input value of ANA0.can_db_set_value(CAN_ANALOG_INPUT_ANA0,os_algin_mv(ANA0));
Check if a CAN message has been received
Manually switch the output of OUT_HSD2 when bit 8 of byte 3 of 0x1FF00
uint32_t variable1;// Check if received CAN message matches data-point "CAN_CHECK_FOR_THIS"
variable1 =can_db_test_dp_value(CAN_CHECK_FOR_THIS);
Manually receive CAN message
voiduser_can_message_receive(uint8_t hw_id, bios_can_msg_typ* msg){// When 0x400 is received, send a CAN messageif((msg->id ==0x400)&&(msg->id_ext ==0)){if( msg->data[0]==0x33){os_can_send_msg(0,0x720,0,8,0x66,0x33,0x11,0,0,0,0, msg->data[7]);}}// Switch the output OUT_HSD2 when bit8 of byte3 of 0x1FF004AB is "1"if((msg->id ==0x1FF004AB)&&(msg->id_ext ==1)){os_digout( OUT_HSD2,(msg->data[3]&0x80));}else{// do nothing}}