USBOPTO/REL 64/32/16/8 - QUANCOM Informationssysteme GmbH
USBOPTO/REL 64/32/16/8 - QUANCOM Informationssysteme GmbH
USBOPTO/REL 64/32/16/8 - QUANCOM Informationssysteme GmbH
Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.
YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.
PART 1: Setting the outputs<br />
//<br />
// The following constants can be used to program the outputs:<br />
// ----------------------------------------------------------------------<br />
ULONG lines = 0;<br />
//<br />
// Reset all lines to "Low"<br />
//<br />
printf("Reset all lines to 'Low' ( Press return to continue ):\n");<br />
QAPIExtWriteDO<strong>16</strong>(handle, 0, lines, 0);<br />
ch = getchar();<br />
//<br />
// Set the outputs OUT4,OUT10 and OUT15 to "High" ( <strong>16</strong>-Bit )<br />
//<br />
printf("Set OUT4,OUT10 and OUT15 to 'High' ( Press return to continue ):\n");<br />
lines = OUT4 + OUT10 + OUT15;<br />
QAPIExtWriteDO<strong>16</strong>(handle, 0, lines, 0);<br />
ch = getchar();<br />
//<br />
// Set the output OUT1, OUT4,OUT10 and OUT15 to "High" ( <strong>16</strong>-Bit )<br />
//<br />
printf("Set OUT1, OUT4,OUT10 and OUT15 to 'High' ( Press return to continue ):\n");<br />
lines = OUT1 + OUT4 + OUT10 + OUT15;<br />
QAPIExtWriteDO<strong>16</strong>(handle, 0, lines, 0);<br />
ch = getchar();<br />
//<br />
// Reset line OUT10 to "Low"<br />
//<br />
printf("Reset line OUT10 to 'Low' ( Press return to continue ):\n");<br />
QAPIExtWriteDO1(handle, 10 - 1, FALSE, 0);<br />
ch = getchar();<br />
//<br />
// Set line OUT5 to "High"<br />
//<br />
printf("Set line OUT5 to 'High' ( Press return to continue ):\n");<br />
QAPIExtWriteDO1(handle, 5 - 1, TRUE, 0);<br />
ch = getchar();<br />
//<br />
// Reset all lines to "Low"<br />
//<br />
printf("Reset all to 'Low' ( Press return to continue ):\n");<br />
lines = 0;<br />
QAPIExtWriteDO<strong>16</strong>(handle, 0, lines, 0);<br />
ch = getchar();<br />
// ----------------------------------------------------------------------<br />
// PART 2: Reading the inputs ( and detect changed inputs )<br />
//<br />
// This part reads the state of the input lines.<br />
//<br />
// The following constants can be used to program the inputs:<br />
// ---------------------------------------------------------------------int<br />
i;<br />
while (!kbhit()) {<br />
// read the current state from the inputs<br />
lines = QAPIExtReadDI<strong>16</strong>(handle, 0, 0);<br />
printf("\n--------------------------------------------------------------------------\n");<br />
printf("Current input states\n");<br />
printf("IN1 IN2 IN3 IN4 IN5 IN6 IN7 IN8 IN9 IN10 IN11 IN12 IN13 IN14 IN15\n");<br />
for (i=0;i