This example demonstrates how to configure an analog input to measure a 0 to 5VDC input.
Configure the desired input mode for 5V Absolute, the resulting value will be in the global variable analogValueAxx and units will be in Vdc x 1000.
In this example the analog value will be transmitted over CAN on PGN 65241 SPN 1083.
Tips:
Data types - CAN data will be of data type UINT whereas the analog value is Real. It is best practice to convert the data types in your code rather than letting the compiler make the conversion.
Comments
0 comments
Please sign in to leave a comment.