Retrieving Flexy SD Card Files Through the M2Web API

Brian Holt2 min read
Data AcquisitionOther ManufacturerTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

A Flexy can return user files through the M2Web API without opening an eCatcher VPN tunnel or starting an FTP session. Request the required file with the export block descriptor $dtUF$uf and its path. This method supports browser retrieval and can also supply data directly to an Excel VBA import routine.

Use the User-File Export Descriptor

Set the M2Web API request's AST_Param value to the user-file export descriptor followed by the file path. The supported evidence demonstrates this form:

AST_Param=$dtUF$uf/usr/index.htm

$dtUF selects the user-file export operation, while $uf is followed by the requested path. The evidence confirms access to Usr files but does not define how every SD extension directory maps into that namespace. First confirm that each process, cycle, and alarm file is visible at the path used by the request.

Build the M2Web API Request

Include the export parameter and the required M2Web authentication fields. Keep account, user, device, and developer credentials out of source code where possible; the supplied request evidence placed credentials in query parameters, which can expose them through browser history and logs.

AST_Param=$dtUF$uf/<user-file-path>
t2maccount=<account>
t2musername=<M2Web-user>
t2mpassword=<M2Web-password>
t2mdeveloperid=<developer-id>
t2mdeviceusername=<device-user>
t2mdevicepassword=<device-password>
  1. Identify the exact user-file path for the process, cycle, or alarm file.
  2. Submit an authenticated M2Web API GET request with AST_Param=$dtUF$uf/<user-file-path>.
  3. Verify that the response contains the requested file rather than historical-tag data or an authentication response.
  4. Repeat the request for each of the three files, or call the same request logic with a different path.

Import the Response into Excel

Excel can retrieve the file directly through VBA, so an intermediate program does not have to save it to disk first. The VBA routine must issue the authenticated request, check that the response is successful, and then parse or import the returned process, cycle, or alarm data according to the file's actual format. The evidence does not specify the delimiter, encoding, worksheet mapping, or VBA implementation, so determine those from the generated files before automating the import.

Avoid the Observed Watchdog Reset

Writing the data files and running LOGIO at the same time caused an observed watchdog error that repeatedly reset the Flexy. Keep LOGIO out of this script unless a separate test establishes why the combined workload triggers the watchdog. File retrieval through the M2Web user-file export avoids duplicating the same records into historical logging solely to make them available through M2Web.

FAQ

How do I retrieve a Flexy user file through M2Web?

Send an authenticated M2Web API GET request with AST_Param=$dtUF$uf/<user-file-path>. Replace the placeholder with the exact path of the process, cycle, or alarm file.

Can Excel import a Flexy file without FTP?

Yes. A VBA routine can request the file through the M2Web API and import the response directly, provided it supplies the required authentication and parses the file's actual format.

Why did the Flexy keep resetting when LOGIO was added?

The documented script produced a watchdog error when LOGIO ran while the same data files were being written. Remove that concurrent logging operation and retrieve the existing files with the $dtUF$uf export request.

Back to blog