70 likes | 136 Views
IOC SHELL ADDITIONS. Eric Norum September 3, 2003. Command-line macro expansion. $( var ) or ${ var } replaced with value of var environment variable No expansion inside single quotes or following a backslash () Environment variable values can be set with IOC shell epicsEnvSet command
E N D
IOC SHELL ADDITIONS Eric Norum September 3, 2003
Command-line macro expansion • $(var) or ${var} replaced with value of var environment variable • No expansion inside single quotes or following a backslash (\) • Environment variable values can be set with IOC shell epicsEnvSet command • Application build creates envPaths with lines like: epicsEnvSet(IOC,"iocmyExample") epicsEnvSet(TOP,"/home/phoebus/NORUME/myExample") epicsEnvSet(EPICS_BASE,"/home/phoebus/NORUME/EPICS/base") epicsEnvSet(ASDSTD,"/home/phoebus/NORUME/EPICS/support/asdStd")
Fine Points • Indirect definitions are possible • epicsEnvSet var1 ‘${var2}’ • epicsEnvSet var2 someName • epicsEnvSet someName someDir/Path • epicsEnvSet anotherName anotherDir/Path • cd ${var1} • epicsEnvSet var2 anotherName • cd ${var1}
Easier Access to ‘Debugging’ Variables • In your device/record/sequencer code you have some variables you wish to set/view from the IOC shell: static double myDeviceParameter; static int myDeviceDebugFlag;
Step 1 - Export variables • Add #include <epicsExport.h> to the list of headers included by your source • Add an epicsExportAddress declaration for each variable: epicsExportAddress(int,myDeviceDebugFlag); epicsExportAddress(double,myDeviceParameter);
Step 2 - Add variables to database definition • Add an variable declaration for each variable to some database description file included by the application: variable(myDeviceDebugFlag) variable(myDeviceParameter,double) • A missing type specifier is taken to be int
Step 3 - Use the IOC shell var command to set/view • var myDeviceDebugFlag 3 • var myDeviceParameter 1.3 • var myDebugFlag • var