2.2. Synchronous Command and Response Interface (SCRI)

The SCRI is used when the user wants to send a single command and is willing to block waiting for the result to come back. This interface could provide backward compatibility with the GNAT interface that the I&T test stands are currently using.

Architecturely the synchronous interface would be built on top of the asynchronous interface, hiding the details of the asynchronous interface from the user.

The SCRI interface is much simpler than the ACRI. With this interface the user only needs to call the synchronous version of a "LAT Command Function". However, the user must still allocate memory for the command and result lists and properly initialize a LIOX structure.

The synchronous versions of the "LAT Command Functions" have similar function names and signatures as the asynchronous versions. The synchronous function name uses the letter s where the asynchronous function name has the letter q.

Below is the function prototype for the synchronous version of the GCFE read register command discussed previously in Example 2-1. This function reads a register on a particular GCFE.

int liox_sGCFEread(LIOXHandle lh, short temId, short gcccId, short gcrcId, short gcfeId, short regId, short* value);

Example 2-3. Read Calorimeter DAC – Synchronous Interface

With the synchronous interface the entire process of sending a command, waiting for a result and decoding a result is reduced to a single synchronous function call. Reading a calorimeter register is implemented as follows:


unsigned int        errVal;
unsigned short int  regVal;

/* read the register value */
errVal = liox_sGCFEread( lh, temId, gcccId, gcrcId, 
                         gcfeId, DACregId, &regVal);
  
/* do something useful with register value */

While the SCRI is simpler to use it suffers from the severe limitions of being synchronous and limited to only a single command.