Search Results for

    Show / Hide Table of Contents

    Device Configuration

    Configuration can be managed through this API with use of Reliance RFG configuration files. The workflow for generating this files is to use Reliance Tools for PC to configure your printer to your desired settings. When ready, click File->Save Config and select where to save your file. The file will have the RFG file extension.

    Getting a Config

    Saving a Configuration

    Code

    Once you have an RFG file, you have a few options for getting it into your application. The most straightforward method is to use From.

    Code Sample

    using System;
    using PTIRelianceLib;
    
    namespace reliance_sample
    {
        class Program
        {
            static void Main(string[] args)
            {
                // Load a firmware file someplace on disk
                var file = BinaryFile.From("my_config.rfg");
                
                // Make sure that file loaded okay
                if (file.Empty)
                {
                    Console.WriteLine("Configuration file cannot be read. Does it exist?");
                }
                else
                {
    
                    // Wrap our printer in using so it gets disposed on properly
                    using(var printer = new ReliancePrinter())
                    {
                        
                        // Do the config!
                        var result = printer.SendConfiguration(file);
    
                        Console.WriteLine("\nConfiguration Update Result: {0}", result);
                    }
                }
            }
        }
    }
    
    Warning

    Exceptions

    For clarity, exception handling has been elided. It is advisable to wrap any ReliancePrinter method calls in a try/catch block for PTIException.

    • Improve this Doc
    In This Article
    Back to top Copyright © 2018 Pyramid Technologies
    Generated by DocFX