Download View/Open - Calhoun: The NPS
Transcript
Figure 21 Diagram of CommandReply.vi. The command-reply channel is implemented using a DataSocket connection for each direction. Thus, the command-reply VI requires two URLs as input. URL_A defines the DataSocket connection used to write commands, while URL_B defines the DataSocket connection used to read replies. The Slave Module is able to understand 19 commands previously defined as listed in Table 9. Each command has a code, the number of arguments and the type of each argument. Since each command can have arguments with different data types, the command-reply VI uses a variant type for the argument input terminal. When the Master Module sends a command through the command-reply VI, the command code (unsigned integer) and the variant are bundled in a cluster prior to the transmission. Hence, when the cluster reaches the destination, the Slave Module needs to decode it to ascertain the original data type of each argument. After command and arguments are decoded, the Slave Module performs the requested actions and always replies with the same command code. If the command is a query for some information, the reply comprises the command code and the desired information. If an error occurs during the command evaluation, the reply comprises the command code and an error cluster with the error code and respective message. If none of the two conditions above occurs, the reply comprises the command code and an empty variant. 40