General HydroStatics
Ship Stability Software
Command of the Week
(New or interesting aspects of GHS that you may not know about)

MESSAGE SEND


There is a way you can reach in and get a progress readout while GHS cranks away on some long-winded stability report. The technique is to send messages between concurrent sessions of GHS running on the same computer.

Using MESSAGE SEND you can send a command to another session even as it works on its own command stream, which causes it to take a slice of time out from its processing and execute the command sent to it.

Now if you write a little macro that emits something about the progress of the run, you can easily get that progress readout. Just embed the macro in the Run file. Here's what we mean:

Let the macro be named SNOOP. Then in your concurrent GHS session where you want to receive the progress readout, you would have a command that looks like this:

MESSAGE SEND .SNOOP

So SNOOP gets executed. Then how does it send out information to the interrogating GHS session? It has its own MESSAGE SEND command. A straightforward arrangement is to have SNOOP send a NOTE or MESSAGE command containing whatever good news or bad news there is about the progress of the run. For example, SNOOP could do something like this:

MESSAGE SEND \ Worst limit: {worstlim} case {worstcase}

Messages are being sent both ways between the two GHS sessions.

To enable this is quite simple. All it takes is one initial MESSAGE SEND ON in each session. This establishes a two-way channel between the sessions (actually it works as well with more than two concurrent GHS sessions, but two will do for this exercise).

For a simple example, here is a bare-bones stability Run file that includes a SNOOP macro. When you try it out, first establish the GHS session that will receive the progress report: have it run this file.

You can see the endless possibilities. Here is our advice: keep it simple.


Questions, comments, or requests?
Contact Creative Systems, Inc.

support@ghsport.com

USA phone: 360-385-6212 Fax: 360-385-6213
Office hours: 7:00 am - 4:00 pm Pacific Time, Monday - Friday

Mailing address:
PO Box 1910
Port Townsend, WA 98368 USA

www.ghsport.com

Click here for an index to this and previous COWs