This functional macro reads data from a visit connection.
Name | Type | Description | |
SockID | int | Socket descriptor of the data-connection to the remote application. | |
Trigger | int | Triggers reading of data from the data socket when activated. | |
Name | Type | Description | |
TimeStamp | double | Timestamp of the data read from the remote application. | |
n1 | int | Size of field in dimension 1 | |
n2 | int | Size of field in dimension 2 | |
n3 | int | Size of field in dimension 3 | |
n4 | int | Size of field in dimension 4 | |
DataInt | int[] | Data field, if datatype of message is INT32. | |
DataShort | short[] | Data field, if datatype of message is INT16. | |
DataByte | byte[] | Data field, if datatype of message is BYTE. | |
DataDouble | double[] | Data field, if datatype of message is FLOAT64. | |
DataString | string | Data field, if datatype of message is STRING. | |
DataIntScalar | int | Data value, if datatype of message is INT32 and the field length is 1. | |
DataShortScalar | short | Data value, if datatype of message is INT16 and the field length is 1. | |
DataByteScalar | byte | Data value, if datatype of message is BYTE and the field length is 1. | |
DataDoubleScalar | double | Data value, if datatype of message is FLOAT64 and the field length is 1. | |
This module reads data from a remote application. The remote application it should connect to is specified by the SockID input. This input will normally be provided by the visitserver macro that has created the connection. The module is triggered whenever data arrives at the Trigger port. The Trigger input can be connected directly to the Trigger output port of a visitserver if only one visitreader or visitwriter macro is being used. If more than one visitreader or visitwriter is connected to a visitserver it is necessary to use a multiplexer macro in order to select a visitreader or visitwriter macro for each request. There is no implicit distinction between read and write requests. Therefore the user is responsible for using different IDs for read and write requests.
Whenever the module is triggered data is read from the remote application and presented on the output ports. The output ports TimeStamp and n1 ... n4 contain the header-information that has been sent by the remote application (using the visit_send_4d
or visit_send_string
function calls). The Data... output ports contain the data values that have been sent by the remote application. Depending on the type of data that has been sent the data will be presented on the appropriate Data output port. With a field of length n1=n2=n3=n4=1 the data is presented at both a vector and a scalar output port.
The visitreader macro should be used in conjunction with the macros multiplexer, visitserver and visitwriter.
Before this module can be compiled and used the VISIT library must be installed. For information on how to install this library please see the VISIT library(http://www.fz-juelich.de/zam/visit) home page. A complete set of documentation for the VISIT-library can also be found at this URL.
The Visit IAC project assumes that the VISIT library has been installed into the default directory i.e.
/usr/local/visit/
If this is not the case then the references to that directory in the visit_mods.v file will have to be modified.
This functional macro is only provided for completeness. It is a very thin wrapper around the low-level VisitReader module. Therefore the VisitReader module should normally be used.
SockID
Integer input port that contains a socket descriptor. This socket descriptor specifies the data-connection to the remote application. This input port should be connected to the SockID output port of the visitserver macro.
Trigger
When this input is triggered the visitreader macro will attempt to read a message from the remote application. Normally this port should be connected to the Trigger output port of the visitserver macro. This should be done by either making a direct connection or making an indirect connection through a multiplexer macro.
Timestamp, n1, n2, n3, n4
Contain the header-information that has been sent by the remote application (using the visit_send_4d or visit_send_string function calls).
DataString
If the datatype of the read message is STRING this output port will present the data contained in the message.
DataInt, DataShort, DataByte, DataDouble
If the read message contains numerical data the values will be presented at one of these array outputs. The output used depends upon the datatype of the read message. If the message only contains a single value the value will also be presented at the appropriate scalar output.
DataIntScalar, DataShortScalar, DataByteScalar, DataDoubleScalar
If the read message contains a single numerical value the value will be presented at one of these scalar outputs. The output used depends upon the datatype of the read message. If the message contains more than one value these outputs will not used.
The User Macro visitreader is only a wrapper around the low-level module VisitReader. All input and output ports of this module are directly connected to the macro ports.
Two example applications are provided that work together with remote applications provided with the VISIT-library distribution. The VisitSimpleEg application is designed to test the installation of the Visit project and connects to the vclient
remote application. If the project has been installed and compiled correctly several values should be sent to and received from the remote application. The test can be repeated several times by using the command line parameters of the vclient
application. For instance the following command will repeat the test 20 times:
vclient -p -n 20
The VisitGoLEg example application is a more complete visualization example that connects to a remote game of life simulation. The application connects to the cgol
remote application. This application computes the game of life simulation for a 3D field and sends the full state of simulation to the AVS/Express application after every life step. As well as displaying the results of the simulation the VisitGoLEg application also allows the simulation to be steered. It is possible to insert new blocks into the simulation, and to stop or pause the remote application.
A SEAP server must be running before either of these applications can be used. For full instructions on using the cgol
and vclient
applications please see the VISIT library home page.
iac_proj/visit/visit_macs.v contains the V definition of the functional macro visitreader.
The VisitMacs library inherits its process. As this library contains no procedural code, the process is not important. The modules in the low-level VisitMods library execute under the process specified in that library, not the process defined in the high-level library. By default the express process will be used.
Before the Visit project can be compiled the VISIT library must be installed, configured and compiled. For full instructions please see the VISIT library web-site.
The Visit IAC project assumes that the VISIT library has been installed into the default directory i.e.
/usr/local/visit/
If this is not the case then the references to that directory in the visit_mods.v file will have to be modified.
Wolfgang Frings Central Institute for Applied Mathematics Research Center Juelich D-52425 Juelich Germany
Ma YingLiang, Manchester Visualization Centre Andrew Dodd, International AVS Centre
Wolfgang Frings Central Institute for Applied Mathematics Forschungszentrum Juelich GmbH D-52425 Juelich Germany E-mail: W.Frings@fz-juelich.deInternational AVS Centre Manchester Visualization Centre Manchester Computing University of Manchester Oxford Road Manchester United Kingdom M13 9PL E-mail: avs@iavsc.org