%{ #include #include "dm5406.h" %} /* Conversions */ TM typedef unsigned short UINT { text "%5u"; } TM typedef unsigned short SINT { text "%5d"; } TM typedef unsigned long ULONG { text "%9lu"; } TM typedef unsigned char UCHAR { text "%08b"; } TM typedef unsigned char USCHAR { text "%3u"; } TM typedef double VOLTS { text "%6.3lf"; } TM typedef double TORR {text "%6.2lf"; } TM typedef unsigned short USTAT { text "%04x"; } /* Collection Types */ TM typedef UINT Ct16 { } TM typedef ULONG Ct20 { } TM typedef UCHAR DSTAT { collect x = sbb( x.address )^0xFF; } TM typedef USCHAR SW_UCHAR { /* SW char display %3u */ collect x = cache_read( x.address ); } TM typedef UCHAR SW_BCHAR { /* SW char displayed as binary */ collect x = cache_read( x.address ); } TM typedef UINT SW_UINT { collect x = cache_read( x.address ); } TM typedef SINT SW_SINT { collect x = cache_read( x.address ); } TM typedef float SW_FLOAT { text "%9.4f"; collect x = cache_lread( x.address ); } TM typedef SW_UINT DA12_10V { convert VOLTS; text "%5.3lf"; } TM typedef UINT AD12 { collect x = sbw(x.address); convert VOLTS; text "%6.4lf"; } TM typedef UINT AD12U { collect x = sbw(x.address); text "%6.3u"; } TM typedef UINT DM_AD12 { collect x { int i; for (i = 0; i < 4; i++) DM_Read_AtoD( x.address ); x = DM_Read_AtoD( x.address ); } } TM typedef DM_AD12 DM_AD1210V { convert VOLTS; text "%6.3lf"; } TM typedef DM_AD12 DM_AD125V { convert VOLTS; text "%6.3lf"; } TM typedef AD12 P300TORR { convert TORR; text "%6.2lf"; } TM typedef AD12 P100TORR { convert TORR; text "%6.3lf"; } TM typedef AD12 P1000TORR { convert TORR; text "%6.2lf"; } TM typedef SW_UINT DM_DA125V { convert VOLTS; text "%6.3lf"; } /* Calibrations */ Calibration (AD12, VOLTS) { 0, 0, 65536, 10.0 } Calibration ( DM_AD125V, VOLTS ) { 0, 0, 4096, 5.0 } Calibration ( DM_AD1210V, VOLTS ) { 0, 0, 4096, 10.0 } Calibration ( P300TORR, TORR ) { 0, 0, 65536, 300.0 } Calibration ( P100TORR, TORR ) { 0, 0, 65336, 100.0 } Calibration ( P1000TORR, TORR ) { 0, 0, 65536, 1000.0 } Calibration ( DM_DA125V, VOLTS ) { 0, 0, 4096, 5.0 } Calibration ( DA12_10V, VOLTS ) { 0, 0, 4096, 10.0 }