Change EPICS Environment Variables on NI Target

Updated Jan 28, 2023



  • LabVIEW EPICS Client I/O Server

Operating System

  • Windows
  • LabVIEW Real-Time (NI Linux Real-Time)
  • VxWorks
  • Phar Lap

I need to change an EPICS Server or EPICS Client settings and need to do it via EPICS environment variables.  How do I set these environment variables?

The below table shows the EPICS Environment Variables you can alter, their range of values, and their default values.
Environment Variable NameRangeDefault
EPICS_CA_ADDR_LIST{N.N.N.N N.N.N.N:P ...}    <none>
EPICS_CA_NAME_SERVERS{N.N.N.N N.N.N.N:P ...}    <none>
EPICS_CA_CONN_TMOr > 0.1 seconds    30.0
EPICS_CA_BEACON_PERIODr > 0.1 seconds    15.0
EPICS_CA_REPEATER_PORTi > 5000    5065
EPICS_CA_SERVER_PORTi > 5000    5064
EPICS_CA_MAX_ARRAY_BYTESi >= 16384    16384
EPICS_CA_MAX_SEARCH_PERIODr > 60 seconds    300
EPICS_TS_MIN_WEST-720 < i <720 minutes    360


  1. Right-click on My Computer and choose Properties.
  2. Select the Advanced tab and click the Environment Variables button.
  3. Add a new System Environment Variable (not User) with the following configuration:
    Variable name: <Environment Variable Name>
    Variable value: <Environment Variable Value>

    Example of how it will look to add EPICS_CA_MAX_ARRAY_BYTES with value of 100000000: 
  4. Reboot the Windows system.

Phar Lap or VxWorks Real-Time Targets

  1. FTP to the target  and download the /ni-rt.ini file to your local machine.
  2. Open ni-rt.ini on your computer using a text editor, such as notepad.
  3. Add a new section to the bottom of ni-rt.ini with the follow:
    <Environment Variable Name>=<Environment Variable Value>

    An example entry for the EPICS_CA_MAX_ARRAY_BYTES variable would look like the below:
    EPICS_CA_MAX_ARRAY_BYTES = 100000000
  4. Save the ni-rt.ini file and FTP it back to the target  , replacing the existing one.
  5. Reboot the RT target.

NI Linux Real-Time Targets

  1. Connect to the target via SSH .
  2. Login using an account with administrator privileges. The default admin account has a blank password.
  3. Type vi /etc/init.d/tagsrv to open the tagsrv file in the default Linux text editor.
  4. Navigate to the line above ulimit in the startdaemon section by pressing <J> on your keyboard to move the cursor down. (<K> will move your cursor up)
  5. Press <O> on your keyboard.
  6. Press <Enter>.
  7. Type export <Environment Variable Name>=<Environment Variable Value
    An example entry for the EPICS_CA_CONN_TMO variable would look like the below:
  8. Press <Esc>.
  9. Type :wq to save your changes and quit the text editor.

Additional Information

There is a known issue with Linux RT targets where the EPICS_CA_MAX_ARRAY_BYTES environmental variable is not read correctly by the EPICS server. You can still use the above method to change the max array bytes variable, but the EPICS server running on the Linux RT target will still use the default value of 16384. This is being tracked on CAR 453991.