@sixclear/niskin-bottles
                    Niskin Bottles v1.0.0
                Overview
The Niskin Bottles plugin controls a motor controller which closes up to three Niskin bottles. The bottles are located along an axis controlled by the motor controller and are closed as an arm passes by a given bottle. The relative counts for each bottle position (relative to one another) are configurable, along with a moveBackNumberOfSteps which facilitates moving back towards the home position to save operators from having to manually crank the position all the way home (reestablishing the home position is required to prepare the setup for subsequent deployments).
User Interface
Below we show the user interface after the user has clicked the Close Bottle 1 button to close the first Niskin bottle:
 
Configuration Example
Configuration Details
 ROOT object 
                      This top level object holds all configuration information for a Serial Publisher plugin instance. 
                         Required: true 
                         Default: (not specified; see any element defaults within) 
                        
                     options object 
                      Configuration options specific to the Serial Publisher plugin.  Note that variables and expressions are generally allowed in this section. 
                         Required: true 
                         Default: (not specified; see any element defaults within) 
                        
                     options.serialPortConfiguration object 
                      Defines the serial port configuration. 
                         Required: true 
                         Default: (not specified; see any element defaults within) 
                        
                     options.serialPortConfiguration.SimulationMode boolean 
                      Whether to run in simulation mode. 
                         Required: true 
                         Default: true 
                        
                     options.serialPortConfiguration.Address string 
                      The address of the serial port. 
                         Required: true 
                         Default: "COM3" 
                        
                     options.serialPortConfiguration.Timeout integer 
                      The timeout duration in milliseconds used for write and read operations. 
                         Required: true 
                         Default: 2000 
                        
                     options.serialPortConfiguration.TerminationEnable boolean 
                      Whether to look for termination characters in responses. 
                         Required: true 
                         Default: true 
                        
                     options.serialPortConfiguration.TerminationCharacter string 
                      The termination character to look for (if termination is enabled). 
                         Required: true 
                         Default: "\n" 
                        
                     options.serialPortConfiguration.TrimResponseWhiteSpace boolean 
                      Whether to trim whitespace from responses. 
                         Required: true 
                         Default: true 
                        
                     options.serialPortConfiguration.BytesToRead integer 
                      The number of bytes to read when reading responses.  Note: read operations will terminate on: 1. a termination character, 2. on timeout, 3. on receiving BytesToRead number of bytes. 
                         Required: true 
                         Default: 1000 
                        
                     options.serialPortConfiguration.ReadToFileEnable boolean 
                      Wehther to enable reading responses directly to a specified file. 
                         Required: true 
                         Default: false 
                        
                     options.serialPortConfiguration.ReadToFilePath string 
                      The file path to read responses into (if ReadToFileEnable is true). 
                         Required: true 
                         Default: "" 
                        
                     options.serialPortConfiguration.BaudRate integer 
                      The baud rate to use for serial communication.  The available baud rates depend on the serial interface.  Common baud rates include: 300, 600, 1200, 2400, 4800, 9600, 38400, 14400, 19200, 57600, 230400, 115200, 460800.  Less common though not terrifically uncommon baud rates include: 100, 28800, 56000, 128000, 153600, 256000, 921600. 
                         Required: true 
                         Default: 57600 
                        
                     options.serialPortConfiguration.DataBits enum (integer) 
                      The number of data bits used for underlying character encoding for transmission. 
                         Required: true 
                         Default: 8 
                         Enum Items: 5 | 6 | 7 | 8 
                     options.serialPortConfiguration.StopBits enum (string) 
                      The number of bits which indicate the end of a given character transmission. 
                         Required: true 
                         Default: "1.0" 
                         Enum Items: "1.0" | "1.5" | "2.0" 
                     options.serialPortConfiguration.Parity enum (string) 
                      The parity or error checking convention to use. 
                         Required: true 
                         Default: "None" 
                         Enum Items: "None" | "Odd" | "Even" | "Mark" | "Space" 
                     options.serialPortConfiguration.FlowControl string 
                      The flow control convention to use. 
                         Required: true 
                         Default: "None" 
                        
                     options.relayManagerInstanceName string 
                      The instance name of the Relay Manager which has the assignedRelay defined here.  If this is set to an empty string, the message to update the relay state will not be sent. 
                         Required: true 
                         Default: "Relay Manager" 
                        
                     options.assignedRelay string 
                      This specifies the relay to turn on / off when issuing shaft move commands in relation to closing bottles and returning to the home position.  The relay should be specified in the form: RELAY_SECTION.RELAY_NAME and should correspond to a relay defined in the Relay Manager specified by the relayManagerInstanceName here.  If this is set to an empty string, the message to update the relay state will not be sent. 
                         Required: true 
                         Default: "Niskin Messenger.Messenger Motor" 
                        
                     options.delayAfterSendingUpdateRelayMessage integer 
                      The delay in milliseconds to wait after setting the relay to ensure the message was received by the Relay Manager and to allow the relay to actually change. 
                         Required: true 
                         Default: 1000 
                        
                     options.shutdownCheckPeriod integer 
                      The period in milliseconds at which to check for shutdown. 
                         Required: true 
                         Default: 500 
                        
                     options.uiShaftMoveUpdatePeriod integer 
                      The period in milliseconds at which the user interface representation of the shaft is updated while simulating the actual shaft movement.  You will only ever need to update this if UI updates are impacting performance. 
                         Required: true 
                         Default: 20 
                        
                     options.motorFrequency integer 
                      The frequency of the motor in steps per second. 
                         Required: true 
                         Default: 3000 
                        
                     options.relativeStepsToBottle1 integer 
                      The number of steps to traverse in order to close bottle 1, relative to the home / starting position. 
                         Required: true 
                         Default: 23000 
                        
                     options.relativeStepsToBottle2 integer 
                      The number of steps to traverse in order to close bottle 2, relative to bottle 1. 
                         Required: true 
                         Default: 23000 
                        
                     options.relativeStepsToBottle3 integer 
                      The number of steps to traverse in order to close bottle 3, relative to bottle 2. 
                         Required: true 
                         Default: 6000 
                        
                     options.moveBackNumberOfSteps integer 
                      The number of steps to move towards the Home position each time the Move Backwards button is clicked. 
                         Required: true 
                         Default: 2000 
                        
                     options.logger object 
                      Defines the logging (data and errors) for this plugin.  Note that a LOG variable space is provided here, as well as the VAR variable space.  Available variables are: @LOG{LOGGERNAME}, @LOG{TIMESTAMP}, @LOG{LOGMESSAGE}, @LOG{ERRORMESSAGE}, and @VAR{instanceName} are available variables.  note: @LOG{LOGGERNAME} is equal to the @VAR{instanceName} here. 
                         Required: false 
                         Default: (not specified; see any element defaults within) 
                        
                     options.logger.Enable boolean 
                      Whether to enable the logger. 
                         Required: true 
                         Default: true 
                        
                     options.logger.LogFolder string 
                      The folder in which to write log files. 
                         Required: true 
                         Default: "\\JADE_LOGS\\@VAR{instanceName}"  
                        
                     options.logger.FileNameFormat string 
                      The filename to use when creating log files.  Note: if the filesize limit is reached new files will be created with enumerated suffixes such as: MyLogFile-1.txt, MyLogFile-2.txt, etc. 
                         Required: true 
                         Default: "@VAR{instanceName}-@LOG{TIMESTAMP}.csv" 
                        
                     options.logger.ErrorsOnly boolean 
                      Whether to log only errors. 
                         Required: true 
                         Default: false 
                        
                     options.logger.DiskThrashPeriod integer 
                      The period in milliseconds with which to flush the file buffer to ensure it's committed to the hard drive.  Note: This is a performance consideration to prevent writing to disk too frequently. 
                         Required: true 
                         Default: 1000 
                        
                     options.logger.FileSizeLimit integer 
                      The file size at which to create new files. 
                         Required: true 
                         Default: 1000000 
                        
                     options.logger.StartLogFormat string 
                      The initial string to put into the log file when opened for the first time. 
                         Required: true 
                         Default: "Timestamp,Move State,Move Destination" 
                        
                     options.logger.EndLogFormat string 
                      The final string to put in the log file when closed. 
                         Required: true 
                         Default: "" 
                        
                     options.logger.LogEntryFormat string 
                      The format to use when writing log entries when errors are not present. 
                         Required: true 
                         Default: "@LOG{LOGMESSAGE}" 
                        
                     options.logger.ErrorLogEntryFormat string 
                      The message format used to construct error log entries. 
                         Required: true 
                         Default: "@LOG{ERRORMESSAGE}" 
                        
                     options.logger.TimestampFormat string 
                      The format used by the @LOG{TIMESTAMP} variable. 
                         Required: true 
                         Default: "%Y-%m-%d %H-%M-%S%3u" 
                        
                     panel object 
                     Required: true 
                         Default: (not specified; see any element defaults within) 
                        
                     panel.open boolean 
                      Whether to open the front panel immediately when run. 
                         Required: true 
                         Default: true 
                        
                     panel.state enum (string) 
                      The state in which the window will open. 
                         Required: true 
                         Default: "Standard" 
                         Enum Items: "Standard" | "Hidden" | "Closed" | "Minimized" | "Maximized" 
                     panel.transparency integer 
                      The transparency of the window. 0 = opaque, 100 = invisible. 
                         Required: true 
                         Default: 0 
                        
                     panel.title string 
                      The title of the plugin window when it runs.  Note that the variable 'instanceName' is provided here in a VAR variable container. 
                         Required: true 
                         Default: "@VAR{instanceName}" 
                        
                     panel.titleBarVisible boolean 
                      Whether the window title bar is visible. 
                         Required: true 
                         Default: true 
                        
                     panel.showMenuBar boolean 
                      Whether the menu bar is visible. 
                         Required: true 
                         Default: false 
                        
                     panel.showToolBar boolean 
                      Whether the toolbar is visible. 
                         Required: true 
                         Default: false 
                        
                     panel.makeActive boolean 
                      Whether the window becomes active when opened. 
                         Required: true 
                         Default: false 
                        
                     panel.bringToFront boolean 
                      Whether the window is brought to the front / top of other windows when opened. 
                         Required: true 
                         Default: false 
                        
                     panel.minimizable boolean 
                      Whether the window is minimizable. 
                         Required: true 
                         Default: true 
                        
                     panel.resizable boolean 
                      Whether the window is resizable. 
                         Required: true 
                         Default: true 
                        
                     panel.closeable boolean 
                      Whether the window is closeable. 
                         Required: true 
                         Default: true 
                        
                     panel.closeWhenDone boolean 
                      Whether to close the window when complete. 
                         Required: true 
                         Default: true 
                        
                     panel.center boolean 
                      Whether to center the window when opened.  Note: this property overrides the 'position' property. 
                         Required: true 
                         Default: false 
                        
                     panel.position object 
                      The position of the window when opened the first time. 
                         Required: true 
                         Default: (not specified; see any element defaults within) 
                        
                     panel.position.top integer 
                      The vertical position of the window in pixels from the top edge of the viewport.  Note: this property is overriden by the 'center' property. 
                         Required: true 
                         Default: 100 
                        
                     panel.position.left integer 
                      The horizontal position of the window in pixels from the left edge of the viewport.  Note: this property is overriden by the 'center' property. 
                         Required: true 
                         Default: 100 
                        
                     panel.size object 
                      The size of the window when opened the first time. 
                         Required: false 
                         Default: (not specified; see any element defaults within) 
                        
                     panel.size.width integer 
                      The width of the window in pixels.  -1 means use the default width for the panel.  Note that depending on panel features exposed, there may be a limit to how small a panel can become. 
                         Required: true 
                         Default: -1 
                        
                     panel.size.height integer 
                      The height of the window in pixels.  -1 means use the default height for the panel.  Note that depending on panel features exposed, there may be a limit to how small a panel can become. 
                         Required: true 
                         Default: -1 
                        
                     channel object 
                      The communication channel definition used by this plugin. Note: this section rarely needs modifications. In many cases, the underlying plugin implementation depends on at least some of these settings having the values below. Consult with a JADE expert before making changes to this section if you are unfamiliar with the implications of changes to this section. 
                         Required: true 
                         Default: (not specified; see any element defaults within) 
                        
                     channel.SendBreakTimeout integer 
                      The timeout duration in milliseconds to wait for sending messages. 
                         Required: true 
                         Default: 1000 
                        
                     channel.WaitOnBreakTimeout integer 
                      The timeout duration in milliseconds to wait for receiving messages.  Note: -1 means wait indefinitely or until shutdown is signalled. 
                         Required: true 
                         Default: -1 
                        
                     channel.WaitOnShutdownTimeout integer 
                      The timeout duration in milliseconds to wait for shutdown acknowledgment. 
                         Required: true 
                         Default: 2000 
                        
                     channel.ThrowTimeoutErrors boolean 
                      Whether to throw timeout errors vs simply returning a boolean indicating whether a timeout occurred. 
                         Required: true 
                         Default: false 
                        
                     channel.ThrowShutdownUnacknowledgedErrors boolean 
                      Whether to throw 'shutdown unacknowledged' errors. 
                         Required: true 
                         Default: true 
                        
                     channel.QueueSize integer 
                      The size of the underlying communication queue in bytes.  Note: -1 means unbounded (i.e. grow as needed with available memory). 
                         Required: true 
                         Default: 100 
                        
                     channel.SendBreakEnqueueType enum (string) 
                      The enqueue strategy employed on the underlying queue for standard messages. 
                         Required: true 
                         Default: "LossyEnqueue" 
                         Enum Items: "Enqueue" | "EnqueueAtFront" | "LossyEnqueue" | "LossyEnqueueAtFront" 
                     channel.SendErrorEnqueueType enum (string) 
                      The enqueue strategy employed on the underlying queue for error messages. 
                         Required: true 
                         Default: "LossyEnqueue" 
                         Enum Items: "Enqueue" | "EnqueueAtFront" | "LossyEnqueue" | "LossyEnqueueAtFront" 
                     channel.SendShutdownEnqueueType enum (string) 
                      The enqueue strategy employed on the underlying queue for the shutdown message. 
                         Required: true 
                         Default: "LossyEnqueueAtFront" 
                         Enum Items: "Enqueue" | "EnqueueAtFront" | "LossyEnqueue" | "LossyEnqueueAtFront" 
                     channel.FlushQueueBeforeWaitingOnBreak boolean 
                      Whether to flush the queue upon waiting for new messages (i.e. whether to clear the queue and wait for the next 'new' message; this has the effect of removing old messages and waiting for the next message. 
                         Required: true 
                         Default: false 
                        
                     channel.FlushQueueAfterBreaking boolean 
                      Whether to flush the queue after receiving a new message (i.e. whether to handle the next message coming in the queue and then flush; this has the effect of handling the oldest message (if it exsits) or the next message before flushing the queue. 
                         Required: true 
                         Default: false