EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Running Linux commands inside 'st.cmd'
From: Mark Rivers <[email protected]>
To: Amien Crombie <[email protected]>, "[email protected]" <[email protected]>
Date: Thu, 20 Feb 2014 13:21:24 +0000
You can run Linux commands from st.cmd with the "system" command:

system "echo 113 > /sys/class/gpio/export"

However, the iocsh "system" command is not enabled by default for security reasons.  This is from the IOC Application Developers Guide:

***************************************************
system command_string
Send command_string to the system command interpreter for execution. This command is present
only if some application database definition file contains registrar(iocshSystemCommand)
and if the system provides a suitable command interpreter (vxWorks does not).
***************************************************

Mark


________________________________
From: [email protected] [[email protected]] on behalf of Amien Crombie [[email protected]]
Sent: Thursday, February 20, 2014 7:09 AM
To: [email protected]
Subject: Running Linux commands inside 'st.cmd'

Hi

I have the following ‘st.cmd’

#!../../bin/linux-arm/ioc48
< envPaths
cd ${TOP}

## Want to add the ‘echo’ Linux command but it fails
## echo 113 > /sys/class/gpio/export

dbLoadDatabase "dbd/ioc48.dbd"
ioc48_registerRecordDeviceDriver pdbbase
int32DriverInit("int32",-32768,32767)
dbLoadTemplate "db/iocPV.substitutions"
set_savefile_path("../save")
set_pass1_restoreFile("channelmap.sav")
set_pass1_restoreFile("channelspacing.sav")
save_restoreSet_DatedBackupFiles(1)
save_restoreSet_NumSeqFiles(3)
save_restoreSet_SeqPeriodInSeconds(6000)
save_restoreSet_RetrySeconds(120)

cd ${TOP}/iocBoot/${IOC}
iocInit
dbpf devx:range 1


Either EPICS’s st.cmd cannot run Linux commands or I’m doing something wrong.
Thanks
Amien
Cape Town

Mogamad Amien Crombie
NRF : iThemba LABS
EIT Group
Laboratory for Accelerator Based Sciences
Somerset West, Western Cape
South Africa

[cid:[email protected]]



JPEG image


Replies:
RE: Running Linux commands inside 'st.cmd' Amien Crombie
Re: Running Linux commands inside 'st.cmd' Andrew Johnson
References:
Running Linux commands inside 'st.cmd' Amien Crombie

Navigate by Date:
Prev: Running Linux commands inside 'st.cmd' Amien Crombie
Next: RE: Running Linux commands inside 'st.cmd' Amien Crombie
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Running Linux commands inside 'st.cmd' Amien Crombie
Next: RE: Running Linux commands inside 'st.cmd' Amien Crombie
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·