MX Foundation 4
|
The MX Foundation 4 API (MXF4) is designed around the Client-Server model.
Ethernet connection allows an MXF4 client application to access MAX Technologies resources on a LAN such as FlexMAX, FlexMulti or FlexMobile device. Also any distant computer on a LAN with installed MAX Technologies PCI/PXI-Express cards and running MXF4 server software can be controlled remotely by a MXF4 client application.
An MXF4 client application begins by calling one of the mxfConnect functions to select between Ethernet, USB or PCI/PXI-Express devices.
The same application, only by changing the mxfConnect functions, can communicate with various MAX Technologies devices supporting Ethernet, USB or PCI/PXI-Express connection.
MXF4 server access
MXF4 server user control
All these functions are detailed in the Connection section.
There are three types of connection:
Of the three connection modes, Ethernet is the most flexible, especially with FlexMulti devices or FlexMAX chassis. Gigabit Ethernet is fast, allows devices access from any Windows, Linux, macOS or iPadOS client apps and doesn't require to install and maintain of device drivers on the computer. Also Ethernet connection allows configuring access control list (ACL) to Flex devices if desired enabling device access from only permitted clients.
Ethernet connection allows an MXF4 client application to access MAX Technologies resources on a LAN. Such resource can be any MAX Technologies device supporting Ethernet connection such as FlexMAX, FlexMulti or FlexMobile products. Also any computer running MXF4 Server software with installed MAX Technologies PCI/PXI-Express cards can be controlled remotely using the Ethernet connection.
The exact same function calls are used by the client to communicate with MX Foundation API. All the methods to translate the function call into the command to be executed by the server is hidden inside MX Foundation. Only the parameters to the mxfConnectEthernet() function are changed to establish the connection to the remote server.
In order to establish the connection:
The device hostname is unique and always refers to the same device on a LAN so it is recommended to connect remotely. Using the device hostname instead of its IP address insure your application will always find the corresponding device when online and connect to it even if its IP address has changed. Use the FindDevices tool to discover the MAX Technologies devices on a LAN and display the corresponding hostnames.
When the client accesses a server on another system, a network connection must be established between the network endpoints. This means both endpoints are subject to network access rules that are configurable on the client and the server; routing, firewall, etc.
The examples below illustrates a typical remote connection using either device IP address or device hostname.
USB connection allows an MXF4 client application to access the Flex devices connected by USB to the same computer. Only one application can connect to a USB device at a time. An application can connect to more than one USB device.
In USB mode, mxfSystemUSBDetect() and mxfConnectUSB() are used to detect the MAX Technologie USB devices and connect to it.
The example below illustrates a typical USB connection.
PCI/PXI-Express connection allows an MXF4 client application to access the MAX Technologies devices installed in the same computer via PCIe, PXIe or Thunderbolt.
In PCI/PXI-Express connection, there is no authentication checking for the connection.
The example below illustrates a typical PCI/PXI-Express connection.
With the exception of the initial connection, the client application is unchanged and uses exactly the same code as the local version.
Three connection privileges are available: user, advanced and admin.
The flexchangeacl command line tool is used to manage the ACL and privileges on a Flex device. The following describe the MXF4 APIs allowed for each level of privilege.
Normal user must open server connection in exclusive mode only. Cannot force the closing of other server connections.
Some functions are not available to normal user:
Advanced user can open server connection with either exclusive or non-exclusive mode, but cannot force the closing of other server connections.
Some functions are not available to advanced user:
Admin user can open server connection with either exclusive or non-exclusive mode, and can force the closing of any server connection.
Admin is the highest privilege level. All functions are available to admin user including contoling access to other lowest level privileges.
Keepalive mechanism and default port can be changed.
Both client and server use a keepalive mechanism to detect lost of connection. When debugging the client application, stopping on a breakpoint will prevent the client from responding to the server and if it takes too much time to resume the client application, the server will consider that the connection to the client has been lost and will close the connection. The client application will receive a "socket connection aborted" error in that case and will need to reconnect to the server. This behavior can be changed with the KMXF_SERVER_KEEP_ALIVE attribute.
By default, port 30000 is used but can be changed with the configuration file. If the default port is not available, the connection will try to be established on the first available port of the 99 next port from the default port (by default port 30000 to 30099 can be used).
The file mxf_server.conf defines the network connection port.
This file is located in the maxfiles folder: