XP8600
Software Reference
s
35
6. Power up the controller and bring up Dynamic C on the PC.
7. Open and run the sample program
DASAMPL1.C
in the Dynamic C
SAMPLES\PLCBUS
subdirectory .
8. The LED will increase and decrease in intensity as the program runs.
9. If the LED does not light up at all, its polarity may be reversed. Try
turning the circuit around, connecting the LED at V/I1 and the resistor
at GND.
Program
The program demonstrates how to drive the XP8600 in voltage output
mode. The program first polls the PLCBus, looking for XP8600s. It saves
the highest address found. The program then increments the voltage at
both output channels on the selected board. When it reaches maximum
voltage, it resets the voltage to zero and repeats the process indefinitely.
The setup requires a 1 k
Ω
resistor and LED in seriesor a volt-ohm meter
between V/I1 and GND on header H1 to show the behavior of the program.
DASAMPL1.C
main(){
int i, log_addr, hi_addr;
reset_pbus();
// reset all boards on PLCBus
hitwd();
reset_pbus_wait();
// delay after reset
// Locate XP8600s; save highest addr found
for( log_addr=0; log_addr<64; l+ ){
if( find_dac(log_addr) ) hi_addr = log_addr;
}
// Set PLCBus to XP8600, initialize DAC
set12adr( plcdac_addr(hi_addr) );
dac_init();
// initialize both channels
// Increment Voltages on Channels out 1 and 2
while(1){
for( i=0; i<4097; i++ ){
plc_fdac1(i);
// fdac1 (fast but big),
// writes to DAC channel 1
dac_latch1();
// convert data
plc_sdac2(i);
// sdac2 (slower, smaller),
// write to DAC channel 2
dac_latch2();
// convert data
hitwd():
}
}
}
Содержание XP8600
Страница 6: ...vi s Table of Contents XP8600 XP8900 Blank ...
Страница 10: ...XP8600 XP8900 x s About This Manual Blank ...
Страница 11: ...XP8600 ...
Страница 12: ...This page is blank intentionally Blank ...
Страница 20: ...XP8600 20 s Getting Started Blank ...
Страница 26: ...XP8600 26 s I O Configurations Blank ...
Страница 38: ...XP8600 38 s Software Reference Blank ...
Страница 39: ...XP8900 ...
Страница 40: ...This page is blank intentionally Blank ...
Страница 48: ...XP8900 48 s Getting Started Blank ...
Страница 52: ...XP8900 52 s I O Configurations Blank ...
Страница 64: ...XP8900 64 s Software Reference Blank ...
Страница 65: ...APPENDICES ...
Страница 66: ...This page is blank intentionally Blank ...
Страница 78: ...XP8600 XP8900 78 s PLCBus Blank ...
Страница 79: ...XP8600 XP8900 Specifications s 79 APPENDIX B SPECIFICATIONS ...
Страница 84: ...XP8600 XP8900 84 s Specifications Blank ...
Страница 85: ...XP8600 XP8900 Connecting and Mounting Multiple Boards s 85 APPENDIX C CONNECTING AND MOUNTING MULTIPLE BOARDS ...
Страница 89: ...XP8600 XP8900 Simulated PLCBus Connections s 89 APPENDIX D SIMULATED PLCBUS CONNECTIONS ...
Страница 98: ...XP8600 XP8900 98 s Index Blank ...