recordtype(magnet) { include "dbCommon.dbd" field(VAL,DBF_STRING) { prompt("Value") special(SPC_DBADDR) interest(1) size(16) } field(IDX,DBF_LONG) { prompt("MySQL Index") } field(MAG,DBF_STRING) { prompt("Magnet Name") promptgroup(GUI_DISPLAY) interest(1) size(16) } field(ITM1,DBF_LONG) { prompt("Item1 Value") asl(ASL0) pp(TRUE) } field(ITM2,DBF_LONG) { prompt("Item2 Value") asl(ASL0) pp(TRUE) } field(ITM3,DBF_LONG) { prompt("Item3 Value") asl(ASL0) pp(TRUE) } field(ITM4,DBF_LONG) { prompt("Item4 Value") asl(ASL0) pp(TRUE) } field(ITM5,DBF_LONG) { prompt("Item5 Value") asl(ASL0) pp(TRUE) } field(ITM6,DBF_LONG) { prompt("Item6 Value") asl(ASL0) pp(TRUE) } field(ITM7,DBF_LONG) { prompt("Item7 Value") asl(ASL0) pp(TRUE) } field(ITM8,DBF_LONG) { prompt("Item8 Value") asl(ASL0) pp(TRUE) } field(ITM9,DBF_LONG) { prompt("Item9 Value") asl(ASL0) pp(TRUE) } field(IT10,DBF_LONG) { prompt("Item10 Value") asl(ASL0) pp(TRUE) } field(TMS,DBF_STRING) { prompt("MySQL Time Stamp") promptgroup(GUI_DISPLAY) interest(1) size(20) } field(INP,DBF_INLINK) { prompt("Input Specification") promptgroup(GUI_INPUTS) special(SPC_NOMOD) interest(1) } field(PREC,DBF_SHORT) { prompt("Display Precision") promptgroup(GUI_DISPLAY) interest(1) } }
record(magnet,"$(name):$(port):$(table):$(mg)") { field(DESC, "MySQL select") field(SCAN,"1 second") field(DTYP,"MySql") field(INP,"@$(port) $(table) $(mg) * $(addr)") }
... dbLoadDatabase("dbd/example.dbd") example_registerRecordDeviceDriver(pdbbase) sqlDriverInit("nakadell", "nakayosi", "SQL_TEST", 0) dbLoadRecords("db/testAi.db","name=client2,port=nakadell,addr=0,table=test_table100,mg=magnet1,info=item9") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=1,table=howl_table200,mg=magnet1") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=2,table=howl_table200,mg=magnet2") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=3,table=howl_table200,mg=magnet3") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=4,table=howl_table200,mg=magnet4") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=5,table=howl_table200,mg=magnet5") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=6,table=howl_table200,mg=magnet6") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=7,table=howl_table200,mg=magnet7") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=8,table=howl_table200,mg=magnet8") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=9,table=howl_table200,mg=magnet9") dbLoadRecords("db/testMag.db","name=client2,port=nakadell,addr=10,table=howl_table200,mg=magnet10") iocInit()