areaDetector  3-14
EPICS areaDetector framework
Functions
merlin_low.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include "merlin_low.h"

Functions

int mpxSet (const char *command, const char *value)
 Set a value for the specified command. More...
 
int mpxGet (const char *command, char *value)
 Get a value for the specified command. More...
 
int mpxCmd (const char *command)
 Send a cmd command. More...
 
int mpxConnect (const char *host, int commandPort, int dataPort)
 Connect to the Labview program. More...
 
int mpxIsConnected (int *conn)
 Test the connection status. More...
 
int mpxDisconnect (void)
 Disconnect from the Labview program. More...
 
char * mpxError (int error, char *errMsg)
 Return the error string for this error code. More...
 
int mpxData (unsigned int *data)
 Read the latest data frame. More...
 

Function Documentation

◆ mpxCmd()

int mpxCmd ( const char *  command)

Send a cmd command.

  • command - command name
    Returns
    int - error code

◆ mpxConnect()

int mpxConnect ( const char *  host,
int  commandPort,
int  dataPort 
)

Connect to the Labview program.

This opens two TCP/IP sockets.

  • host - IP address
  • commandPort - port number to send commands
  • dataPort - port number to read data from
    Returns
    int - error code

◆ mpxData()

int mpxData ( unsigned int *  data)

Read the latest data frame.

This blocks until either a frame is read or the socket is closed (either using mpxDisconnect or another mechanism).

The data buffer must be assigned by the user, and it won't be overwritten until this function is called again.

◆ mpxDisconnect()

int mpxDisconnect ( void  )

Disconnect from the Labview program.

This closes the sockets opened using mpxConnect.

Returns
int - error code

◆ mpxError()

char* mpxError ( int  error,
char *  errMsg 
)

Return the error string for this error code.

  • int - error number
  • char pointer - pointer to char array. Must be at least MPX_MAXLINE bytes.

◆ mpxGet()

int mpxGet ( const char *  command,
char *  value 
)

Get a value for the specified command.

  • command - command name
  • value - returned value
    Returns
    int - error code

◆ mpxIsConnected()

int mpxIsConnected ( int *  conn)

Test the connection status.

  • int pointer - 1=connected 0=not connected
    Returns
    error code.

◆ mpxSet()

int mpxSet ( const char *  command,
const char *  value 
)

Set a value for the specified command.

Interface library to merlin Labview system.

  • command - command name
  • value - value to set
    Returns
    int - error code