SDK DocsConnection

Connection

evolis.Connection is the entry point for all printer communication.
It wraps the native evolis_t* context pointer from libevolis.

Constructor

Connection(printer=None, mode: OpenMode = OpenMode.AUTO)
ParameterTypeDescription
printerstr or DevicePrinter name (OS name) or a Device instance. If omitted, the connection is not opened immediately.
modeOpenModeCommunication mode. Default is AUTO.

Examples

# By name
co = evolis.Connection("Evolis Primacy")
 
# By Device object
devices = evolis.Evolis.get_devices()
co = evolis.Connection(devices[0])
 
# Context manager (auto-close)
with evolis.Connection("Evolis Primacy") as co:
    ...

Open / Close

MethodSignatureDescription
open(name: str, mode: OpenMode = AUTO) -> boolOpen connection by printer name.
open_device(device: Device, mode: OpenMode = AUTO) -> boolOpen connection using a Device object.
close() -> NoneClose the connection. Also releases any reserved session.
get_open_mode() -> OpenMode | NoneReturns the current communication mode.

is_open() still works but prints a deprecation warning — use get_state() instead.

State & Status

get_state() -> State

Returns a State object with two attributes:

  • state.majorState.Major enum: OFF, READY, WARNING, ERROR
  • state.minorState.Minor enum (detailed sub-state, e.g. READY, DEF_NO_RIBBON, ERR_MECHANICAL)
state = co.get_state()
if state.major == evolis.State.Major.READY:
    print("Ready to print")

get_status() -> Status | None

Returns a Status object containing raw bit-field flags.

status = co.get_status()
if status.is_on(evolis.Status.Flag.WAR_FEEDER_EMPTY):
    print("Feeder is empty!")

send_status_request() -> Status | None

Sends an explicit status request command to the printer.

enable_status() -> bool

Enables status flags in printer replies (required on some models).

Printer Information

get_info() -> PrinterInfo | None

Returns a PrinterInfo object with the following fields:

FieldTypeDescription
namestrPrinter name as seen by the OS
typeTypePrinter type enum
markMarkBrand enum
markNamestrBrand string
modelModelModel enum
modelNamestrModel string
modelIdintNumeric model ID
fwVersionstrFirmware version
serialNumberstrSerial number
printHeadKitNumberstrPrint head kit number
zonestrGeographic zone
hasFlipboolFlip-over option present
hasEthernetboolEthernet option present
hasWifiboolWiFi option present
hasLaminatorboolLaminator attached
hasLaminator2boolSecond laminator attached
hasMagEncboolMagnetic encoder present
hasJisMagEncboolJIS magnetic encoder present
hasSmartEncboolSmart card encoder present
hasContactLessEncboolContactless encoder present
hasLcdboolLCD screen present
hasKineclipseboolKineclipse option present
hasLockboolLocking system present
hasScannerboolScanner option present

get_ribbon_info() -> RibbonInfo | None

Returns ribbon details. See RibbonInfo.

get_retransfer_film_info() -> RibbonInfo | None

Returns retransfer film details (Avansia printers).

get_cleaning_info() -> CleaningInfo | None

Returns cleaning status information.

Card Movement

MethodSignatureDescription
insert_card() -> boolInsert a card from the input tray.
eject_card() -> boolEject the card to the output tray.
reject_card() -> boolEject the card to the error/reject slot.
flip_card() -> boolRotate the card (requires flip-over option).
set_card_pos(card_pos: CardPos) -> boolMove card to a specific position.

Tray Configuration

MethodSignatureDescription
get_input_tray() -> InputTray | NoneGet currently configured input tray.
set_input_tray(tray: InputTray) -> boolSet input tray.
get_output_tray() -> OutputTray | NoneGet currently configured output tray.
set_output_tray(tray: OutputTray) -> boolSet output tray.
get_error_tray() -> OutputTray | NoneGet the tray used for error cards.
set_error_tray(tray: OutputTray) -> boolSet the tray used for error cards.

Session Management

The session system prevents concurrent access to a printer.

MethodSignatureDescription
reserve(session: int = 0, wait_ms: int = 5000) -> boolReserve the printer. Returns False if busy.
release() -> boolRelease a reserved session.
get_session_management() -> boolReturns True if session management is enabled.
set_session_management(sm: bool) -> NoneEnable/disable session management (use with caution).

Error Management

MethodSignatureDescription
get_error_management() -> ErrorManagement | NoneGet current error management mode.
set_error_management(em: ErrorManagement) -> boolSet error management mode (PRINTER, SOFTWARE, or SUPERVISED).
clear_mechanical_errors() -> boolReset printer after a mechanical error.
get_last_error() -> ReturnCodeGet last error from any method call.

Raw Communication

MethodSignatureDescription
write(data, timeout_ms: int = 30000) -> boolWrite raw bytes to printer.
read(size: int = 1024, timeout_ms: int = 30000) -> bytearray | NoneRead raw bytes from printer.
send_command(cmd: str, reply_size: int = 1024, timeout_ms: int = 30000) -> str | NoneSend a text command and get a text reply.

Power Management

MethodSignatureDescription
shutdown() -> boolShut down the printer.
reset(timeout_secs: int = 0) -> boolSoftware reset. Blocks until printer is ready.
set_standby_time(seconds: int) -> boolSet standby delay (0 to disable).
get_standby_time() -> intGet standby delay in seconds.
set_auto_shutdown_time(seconds: int) -> boolSet automatic shutdown delay (0 to disable).
get_auto_shutdown_time() -> intGet shutdown delay in seconds.

Locking System

MethodSignatureDescription
lock() -> boolLock the printer.
unlock() -> boolUnlock the printer.
lock_enable() -> boolEnable the electromechanical lock.
lock_disable() -> boolDisable the electromechanical lock.
lock_is_enabled() -> boolReturns True if the lock feature is enabled.
get_unlock_time() -> intGet auto-relock delay in seconds.
set_unlock_time(time: int) -> boolSet auto-relock delay in seconds.

Kineclipse (Security Feature)

MethodSignatureDescription
kineclipse_enable() -> boolEnable kineclipse.
kineclipse_disable() -> boolDisable kineclipse.
kineclipse_is_enabled() -> boolReturns True if kineclipse is active.
kineclipse_get_number_of_pass() -> intGet number of kineclipse passes.
kineclipse_set_number_of_pass(passes: int) -> boolSet number of kineclipse passes.

BEZEL Option

MethodSignatureDescription
get_bezel_behavior() -> BezelBehaviorGet BEZEL action. Returns EUNSUPPORTED if no BEZEL.
set_bezel_behavior(bb: BezelBehavior) -> boolSet BEZEL action (re-insert / reject / nothing).
get_bezel_delay() -> intGet BEZEL delay in seconds.
set_bezel_delay(seconds: int) -> boolSet BEZEL delay.
get_bezel_offset() -> intGet card ejection length (mm).
set_bezel_offset(mm: int) -> boolSet card ejection length (17–68 mm).

Feeder (KC Max / K24)

MethodSignatureDescription
get_feeder() -> FeederGet selected feeder. EUNSUPPORTED if single feeder.
set_feeder(f: Feeder) -> boolSelect feeder for next card insertion.

Service Events (EPS)

MethodSignatureDescription
get_event() -> (str, list[ServiceAction]) | NoneGet current EPS event name and available actions.
set_event(event_name: str, action: ServiceAction) -> boolReply to an active EPS event.

Firmware Update

MethodSignatureDescription
firmware_update(path: str, timeout_ms: int = 0) -> boolUpdate firmware from a file.
firmware_update_with_buffer(data, timeout_ms: int = 0) -> boolUpdate firmware from a byte buffer.