Skip to content
Freddie Akeroyd edited this page Jul 31, 2017 · 10 revisions

Asyn provides an echo driver that will return on a read what was last provided by a write. This can be used for some very basic stream device testing / simulation e.g. if the real function is getFrequency { out "FREQ?"; in "%f"; }

Then by connecting the device to the echo driver you could write

getFrequency { out "10.0"; in "%f"; }

Potentially you could have both a real getFrequency() and a dummy getFrequencyTest() function in the protocol file and then control with one was used by writing getFrequency$(TEST=) in the DB file and setting TEST=Test with dbLoadRecords()

To enable support for the echo driver in a Makefile:

  • Add asynEcho to $(APPNAME)_LIBS
  • Add drvAsynEcho.dbd to $(APPNAME)_DBD

And then in st.cmd use e.g.: echoDriverInit(“L0”, 0.1, 0, 0) Where L0 is the asyn port name and 0.1 is, in this case, how long to take to return a reply. The other options allow selecting noautoconnect or multi-device if required

Clone this wiki locally