Example Code

RT Management: A library for managing an RT Target with abstracted file transfer client APIs and System Configuration API wrappers

Code and Documents

Attachment

The RT Management library provides an easy to use API for the System Configuration, FTP, and WebDAV APIs in LabVIEW. There are two main components or APIs that provides commonly used functions used in the configuration of and interaction with RT targets.

File Transfer Behavior API

This provides an abstract interface for file transfer protocols. There are two included implementations, FTP and WebDAV, but a user can add their own protocol by inheriting from the File Transfer Behavior.lvclass, overriding the required methods, and following the development examples set by the FTP and WebDAV implementations. The file transfer behaviors can be switched at run time for different targets or even the same target by simply toggling the class passed into the Initialize.vi. This allows you to use a single API for both file transfer protocols, or any further protocol implemented. The included implementations for the FTP and WebDAV protocols work around many of the quirks amongst different NI RT targets, so that the File Transfer Behavior works seemlessly across every RT target NI manufactures with no needed workarounds or changes in the use of the API for most use cases of these client APIs.

RT Management API

This API wraps the above File Transfer Behavior API and the NI System Configuration API to provide commonly used behaviors when configuring an RT target, such as configuring VI server or installing a startup application. This API, like the File Transfer API, handles many of the differences between NI targets, so that the same API can work seemlessly across any RT target.

Dependencies

Since this library contains automated tests, you will need to install JKI's VI Tester using the JKI VIPM.

*******************************************************************************************************************

LabVIEW version: 2013

This code is provided license free and is free for use, duplication, forking, etc. without restriction.

This software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no even shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
laurent74380
Member
Member
on

There must be a bug or a change with the FTP Function.

I tried your API with LV15.

FTPCreate Directory.vi gives an error, coming from File or directory exists.vi. The error 15550 is expected in your VI when the File/Directory doesn't exist. But the error 15450 is coming out the "Get Path info.vi"

error.png

bmitc
Member
Member
on

Thank you for the report of this. NI takes the standard FTP error codes and adds 15,000 to them. Looking up errors 450 and 550 show that they have the same error description. So it's certainly possible someone just found 450 first when doing some new implementation. Haha.

https://en.wikipedia.org/wiki/List_of_FTP_server_return_codes

What complicates the FTP error catching is that NI has different FTP implementations for different targets. Which target were you using this library with that generated this error? E.g., cRIO-9068 or something like that.

I am restricted in terms of being able to update the library and re-post it here, but I will report this to a contact at NI and hopefully new users of the library will see your post.

In a general sense, how is the library working for you? Is it helpful?

laurent74380
Member
Member
on

OK I understand.

I'm using currently for this application a PXI-8119 and will give you a feedback as soons as I tested it correctly.

This architecture is great and can be extended with a new Class "Simple File I/O Transfer".

Note: The "active" input Parameter is missing in the API, and is vital (or should be set to False) when using the secundary network adapter.

Contributors