Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Datalogging with CompactRIO ?

Hello,
 
What is the best way to make datalogging with a compactrio. My controller is located in an area difficult to go and connected by a microwave link. I want to save information in a database and I want the data stored directly on the compactrio in case of power outage, microwave broken link... I manage 55 data per second, a string and 54 doubles. 
 
I realized a program that uses TCP / IP (the protocol with STM) for visualizing data in real time and store data in the database on a computer network, while recording the data in binary files on CRIO and erasing when they are transferred or inused. The problem occurs when the connection is restored, I have to fetch the files via ftp, which makes TCP / IP connection really heavy because two simultaneous connections.  
Is there a better way to proceed (ex. using tdms file and DMA) or should I optimize my current code and manage my connexion ?
 
Thank you
0 Kudos
Message 1 of 2
(3,383 Views)
Hello,
 
I would recommend going with either a fully streaming solution, in which you check for available datafiles upon recieving a connection (or reconnection) and then transmit the contents of the data files over the same stream as the new data or going with a solution that relies entirely on ftp, so that you don't stream any data at all (you might have the capability to stream a channel or two for monitoring purposes, but not the entire data set).   In this solution, the host VI simply checks for finished data files and then transfers them when they are available.  Of those two solutions, the second solution is much easier to implement.
 
To implement a system fully based upon FTP, your cRIO program would essentially not worry about transferring the data to the host, it always logs the data to files (you can use either a binary format or TDMS, depending on what types of data you are dealing with).  The program would also need some file spanning capabilities (i.e. closing a file after x samples and switching to a new file name).  Then, the host program would programatically use the FTP protocol to check for complete files, and transfer them.  There is a VI based implementation of the FTP protocol in the NI Internet Toolkit or you could implement your own.
 
Regards,
Ryan King
Systems Engineer - Data Logging
National Instruments
0 Kudos
Message 2 of 2
(3,370 Views)