| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

The Universal Loader CLI (ULCLI) project page

Page history last edited by brendan.hoar@... 14 years, 9 months ago

Centralizing all of the duplicator/loader command sets in one location is part of a bigger project of creating a universal command line tool for windows.  This section is the starting point for this tool.

 

The tool itself will have no specific knowledge of any one piece of hardware.  The command line parameters have been designed to allow for the minimal scripting necessary to work with all of the serial based units out there.  One might consider this equivalent to a very stripped down `expect`-like tool that also has some knowledge about optical drive handling and disc formats.

 

Here's a discussion of the Architecture.

 

A link to the 1.0 beta 2 release of the executable -> Download ULCLI

Note: you may use the ulcli for testing and for personal use, but if you are selling and/or bundling a project based on the ulcli, please contact me for licensing terms.

 

A link to a sample batch file application for a single drive loader -> Download sample batch file/ULCLI combination (coming soon).

 

Remember, what you'll want to do is use the ULCLI in a batch file with (a lot of) parameters or, similarly, call it from your own program.

 

An old example of using the tool with dbpoweramp R13 alpha 5's Batch Ripper module - the important part to notice is that one application is controlling two duplicators that were manufactured by completely unrelated companies ->  http://www.youtube.com/watch?v=5YYfQiV9OQA  (ok, it's a bit boring...the next one will be better)

 

The "usage" output of the tool:

C:SYNC-BGHdevelopment_LoaderCLI>universalloadercli.exe
Universal Loader CLI  v1.00 beta 2
  Configurable for any serial-controlled CD/DVD/disc duplicator/autoloader.
  Copyright 2007-2008 Brendan G Hoar (xxxxxxx.xxxx@gmail.com). All Rights Reserved.
  Serial port interface by Martin Gibson (martin, AutoIt script forums).

  Licensed for redistribution with Illustrate's dbpoweramp Batch Ripper only.

"Commands" prefixed with a * below are pre-scanned and treated as global settings.
All others are executed in order as discovered, i.e. some settings can be adjusted
during processing. Commands with multiple parameters use a colon as a delimiter
optional parameters are shown using square brackets.

Global Settings
* --spacestring= (default is _, change if you need to use this char)
* --enterstring= (default is M, change if you need to send this substring)
* --colonstring= (default is `, change if you need to send this substring)
* --separatorstring= (default is :, change if you need to send this substring)
* --logfile= (redirect output to a log file as specified use quotes around path)

Serial Ports
* --ComPort= (defaults to COM1)
* --ComSpeed= (defaults to 9600)
* --ComSettings= (3 chars: bits, parity, stop bits - defaults to 8N1)
* --ComHandshake= (None, Hard, Soft - defaults to None)
* --ComPortAccessTimer= (how often, in s, to retry port in use-default=1
  --ComPortAccessTimeout= (max wait time, in s, to open port-default=480)
  --comportconnect (explicitly open com port to lock robot to this instance)
  --comportrelease (allow other instances to use robot to service other drive banks)

Drives
  --drive= (sets drive letter - D: or E:, etc.)
* --drivebank= (sets current numeric bank identifier:  1 or 2)
    'drivebank' groups drives where open trays can interfere with access
* --olderdrives (use if drives cannot report tray position via Medium Status CDB) --DEFAULT--
* --newerdrives (use if drives can report tray position via Medium Status CDB, may be faster but less reliable)
  --open (open drive - open requires ULCLI to grab com port for safety, if not already open)
  --openblind (as above, but don't wait for spin down - use only at end of batch)
  --close (close drive and wait for spin up - does not require open com port)
  --closeblind (as above, but don't wait for spin up - always use --sleep=2 after this)
  --closeall (close all drive trays)
  --bindtodrive (tells other ULCLI instances that drive bank is busy)
    Important: if this call finds that another drive in the bank is already bound, the
    calling process is forced to wait.  It is als forced to temporarily give up the serial
    port, if it already had it open, while waiting.
  --unbindtodrive (tells other ULCLI instances that this drive no longer has a reservation on the use of the robot in this drive ban
k)
  --bindresetall (frees all drive banks)

Robots
* --commandtimeout= (default, in s, if %timeout% unused-default=30)
* --commandminimumtimeout= (default, in s, if %minimumtimeout% unused-default=3)
* --pollstring= (set this to query string if robot requires it-default="")
* --polltimer= (how often, in s, to poll/check serial port-default=1)
  --command=sendstring[:expectedresponse[:timeout[:minimumtimeout[:failureresponse]]]]
  --commandbank1=... (as above, but only executes when drivebank=1)
  --commandbank2=... (as above, but only executes when drivebank=2)
    use underscore for space and M for carriage return in command strings
    unless you changed them via --enterstring= or --spacestring=.
    You may skip parameters, but you must use the right # of colons e.g. --command=I:X:::E

Special Reject Count Handling
  --rejectsmax= (pause for operator every n rejects-default=10)
  --rejectsreset (clears count of rejects in reject stack)
  --rejectsiterate (increments counts of rejects in reject stack

Basic Flow of Control
  --exit[=#] (# is return code)
  --sleep[=#] (in s-default=1)
  --sleeprandom[=#] (in s, sleep between 1 to #-default=1)
  --label=labelname (used as a target for skip commands, must begin with a letter)
  --skip=sv (unconditionally skips to a label or relative position)
    sv, or 'skipvalue' - can be a label name, or a +/- numeric value
  --skipback (returns to the last place skipped from - only works for last skip, no nesting)
  --ifcommandfailskip=sv (if last command was not successful, skip based on sv)
  --ifcommandtimeoutskip=sv (if last command timed out, skip based on sv)
  --ifcommandfailortimeoutskip=sv (if last command failed or timed out, skip based on sv)
  --ifdiscnotreadyskip=sv (if no or non-readable CD in drive, skip based on sv)
  --ifdiscnotcdromskip=sv (if writable CD or non-CD in drive, skip based on sv)
  --ifdiscnotcdskip=sv (if non-CD in drive, skip based on sv)
* --discspinuptimeout=# (defaults to 60 seconds, used for the --ifdisc items above)

Variables
  --clear=name[:scope] (clear a variable)
    scope of variable is optional - can be global, bank or drive.  drive is default
    it determines which other ULCLI processes handling other drives can see the variable.
  --clearall[=scope] (clear all variables, default scope is drive)
  --set=varname:value[:scope] (set a variable)
* --varname=value (special shortcut for --set=varname:value, always in a scope of 'drive')
    Any variable set via the above two methods can be used by enclosing in curly braces.
    e.g. --set=inputstack:2:global
    e.g. --command=_MOVE{inputstack}:$S.{inputstack}:15:5
    e.g. --notify="An error occurred loading from stack {inputstack}."
    You can also also return a subset of the variable: {VARNAME,START,LENGTH}.
    e.g. --notify="An error occurred loading from drive letter {drive,1,1}."

Implicitly set Variables (that is, set by ULCLI)
  {drive} = drive letter
  {drivebank} = drive bank (1 or 2)
  {comport} = e.g. COM2
  {notifyreturncode} = button pressed by operator during last --notify= call

Complex Flow of Control using Variables
  --ifsetskip=name:value:sv[:scope] (use variables as execution conditionals)
  --ifnotsetskip=name:value:sv[:scope] (use variables as execution conditionals)
  Note: name must be a variable name.  Unlike value, it cannot reference a variable's contents)

Notifications
  --notify=message[:title[:type[:timeout]]] (notify operator with message and beep)
    Message and Title are double quote-enclosed strings (no colons allowed), timeout is in s)
    Button press sets the variable {notifyreturncode})
    Type is a number and can be:
      0 - OK
      1 - OK and Cancel (the default)
      2 - Abort, Retry, and Ignore
      3 - Yes, No, and Cancel
      4 - Yes and No
      5 - Retry and Cancel
      6 -  Cancel, Try Again, Continue
    The {notifyreturncode} set by Operator's button press will be:
      1 - OK
      2 - CANCEL
      3 - ABORT
      4 - RETRY
      5 - IGNORE
      6 - YES
      7 - NO
      10 - TRY AGAIN
      11 - CONTINUE
  --beep[=#] (# is hertz)
* --messagefile=filepath in quotes (used to send messages back to calling programs)
  --message=text in quotes (written to the file specified in messagefile)

This program uses the user's temporary directory to coordinate robot/drive access.  Do not
clear your temporary directory while the ULCLI is running, or you may risk problems,
perhaps even hardware or disc damage.

C:SYNC-BGHdevelopment_LoaderCLI>

 

That's all for now!

 

Update: note that I use the ULCLI in testing spoon's new dbpoweramp batch ripper.  For those interested in progress and discussion, it might be worth joining the illustate forum (here:  http://forum.dbpoweramp.com/ ) especially the beta forum (here: http://forum.dbpoweramp.com/forumdisplay.php?f=21 )

 

-brendan

Comments (0)

You don't have permission to comment on this page.