XP8900
Software Reference
s
63
XP89_1.C
#use eziocmmn.lib
/* #use ezioplc.lib
// for BL1200, BL1600, PK2100, PK2200 */
/* #use eziotgpl.lib // for BL1000 */
/* #use eziolqpl.lib // for BL1100 */
/* #use eziomgpl.lib // for Bl1400 & BL1500 */
/* #use eziobl17.lib // for BL1700 */
/* #use ezioplc2.lib // for BL1700 */
main() {
auto int i;
auto struct _eioAdcCalib c;
auto int channel;
auto float f1, f2, fout;
auto long l;
auto int margin;
channel = 0;
// execute watch expression
// to override
margin = 0x40;
// execute watch expression
// to override
plcBusReset();
if (plcXP89Init(channel / 8)) {
printf(“DAC8 board not found\n”);
} else {
plcXP89Sw(channel / 8,1);
// enable voltage reference
plcXP89Out(channel,margin);
// use meter to record level
f1 = 10;
// use watch expr to override
plcXP89Out(channel,0xfff-margin);
// use meter to record level
f2 = -10;
// use watch expr to override
eioAdcMakeCoeff(&c,margin,0xfff-margin,f1,f2);
if (plcXP89WrCalib(channel,&c)) {
printf("Can’t write calibration constant\n");
}
memset(&c,0,sizeof(struct _eioAdcCalib));
if (plcXP89RdCalib(channel,&c)) {
printf("Can’t read calibration constant\n");
}
fout = 2.345;
// use watch expr to override
l = eioAdcDigitize(fout, &c);
plcXP89Out(channel,(unsigned)l);
// use meter to check voltage now
}
}
Summary of Contents for XP8600
Page 6: ...vi s Table of Contents XP8600 XP8900 Blank ...
Page 10: ...XP8600 XP8900 x s About This Manual Blank ...
Page 11: ...XP8600 ...
Page 12: ...This page is blank intentionally Blank ...
Page 20: ...XP8600 20 s Getting Started Blank ...
Page 26: ...XP8600 26 s I O Configurations Blank ...
Page 38: ...XP8600 38 s Software Reference Blank ...
Page 39: ...XP8900 ...
Page 40: ...This page is blank intentionally Blank ...
Page 48: ...XP8900 48 s Getting Started Blank ...
Page 52: ...XP8900 52 s I O Configurations Blank ...
Page 64: ...XP8900 64 s Software Reference Blank ...
Page 65: ...APPENDICES ...
Page 66: ...This page is blank intentionally Blank ...
Page 78: ...XP8600 XP8900 78 s PLCBus Blank ...
Page 79: ...XP8600 XP8900 Specifications s 79 APPENDIX B SPECIFICATIONS ...
Page 84: ...XP8600 XP8900 84 s Specifications Blank ...
Page 89: ...XP8600 XP8900 Simulated PLCBus Connections s 89 APPENDIX D SIMULATED PLCBUS CONNECTIONS ...