1 / 7

IOC SHELL ADDITIONS

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

Download Presentation

IOC SHELL ADDITIONS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IOC SHELL ADDITIONS Eric Norum September 3, 2003

  2. 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")

  3. 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}

  4. 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;

  5. 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);

  6. 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

  7. Step 3 - Use the IOC shell var command to set/view • var myDeviceDebugFlag 3 • var myDeviceParameter 1.3 • var myDebugFlag • var

More Related