Doc. # 1-0000206
Date Updated 07-27-2005 Date Created 07-27-2000
Document Type Knowledge Base Related OS
Related Product PCL-722/ PCL-724/ PCL-731/ PCLD-785B
Why the relays on PCLD-785B will all trun-on upon driver initilization?
Solution:
When use PCL-722 connected with PCLD-785B, output 0 will turn on the relay, output 1 will turn off the relay. It's opto-22 negtive logic. When PCL-722/724/731 connected with PCLD-785B or PCLD-7216 SSR relay board, it's the same situation. After PC power on, PCL-722 is set to default input mode, and the default output status is 0. When running our Digout example, PCL-722 will be configured as output mode during driver initialization (call DRV_DeviceOpen), and all relays will be turn on because the default output status is all 0. To avoid this problem, please set all ports to input mode when configuring PCL-722 with device installation program. So PCL-722 will keep input mode after driver initialization (call DRV_DeviceOpen), all relays will keep off. Then write data (call DRV_DioWritePortByte) 0xFF to the desired output port to set default output status first, then call DRV_DioSetPortMode to set the desired port to output mode, the relays will still keep off cause now the output data is 0xFF instead of 0. Attached is the modified Digout.c to show how to do this.