Reading DIN0
Posted: Fri 20. Dec 2024, 13:52
Hello!
Trying to read the DIN0 with the PCAN-Router FD with the following code.
// variable for storing Digital Input
uint32_t diStatus = 0;
In int main function
// check digital input and send out status on CAN
HW_GetDIN ( &diStatus );
din0 = (diStatus >> 0) & 1;
This always gives me a zero on the input even though I measure 0 and 12 V on the pin 8 of the CAN2 D-sub.
Two questions, is pin 8 the correct input of DIN0 and is also necessary to have power on pin 9 and GND on Pin 3 on CAN2 input to be able to read the DIN0 input pin?
Regards Emil
Trying to read the DIN0 with the PCAN-Router FD with the following code.
// variable for storing Digital Input
uint32_t diStatus = 0;
In int main function
// check digital input and send out status on CAN
HW_GetDIN ( &diStatus );
din0 = (diStatus >> 0) & 1;
This always gives me a zero on the input even though I measure 0 and 12 V on the pin 8 of the CAN2 D-sub.
Two questions, is pin 8 the correct input of DIN0 and is also necessary to have power on pin 9 and GND on Pin 3 on CAN2 input to be able to read the DIN0 input pin?
Regards Emil