Accessing a Gamma program like the PID Emulator through a GUI like the Monitor or the DataHub Viewer is convenient, but what if that kind of accessibility hasn't been built in? There is another Cogent tool, gsend (and its functional equivalent, lsend) that can send commands directly to a running program.
For example, if you look at the source code for the PID Emulator in Section 5.5, “Complete program - emul.g”, near the top of the file you will see these lines:
/* Create a global variable for demonstrating gsend and lsend. */ demo_send = 1;
Further down, at the end of the Plant Model section you will see:
newval = newval * demo_send;
The value of newval gets written to PV_001 in the datahub, and is shown by the PV scale in the Monitor. Using gsend or lsend you can send a new value for demo_send, and noticeably change the position of PV. Here's how.
[sh]$ gsend emul
emul>
emul> demo_send = 2;
emul> demo_send = 1.5; emul is no longer reachable (disconnected)emul>
emul> demo_send = 1.5; emul is no longer reachable <Reconnected> 1.5 emul>
Copyright © 1995-2010 by Cogent Real-Time Systems, Inc. All rights reserved.