Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

WIA.DevicePropertyValue

Queries a device property value.

Component Version macOS Windows Linux Server iOS SDK
WIA 6.5 ❌ No ✅ Yes ❌ No ❌ No ❌ No
MBS( "WIA.DevicePropertyValue"; Device; Key )   More

Parameters

Parameter Description Example
Device You can pass index of device to check them in a row.
Or pass name or unique ID of device.
Pass empty string for current device.
$index
Key The property key.
Can be a text with the name of the property or the corresponding ID.
"Name"

Result

Returns value or error.

Description

Queries a device property value.
You can use WIA.DevicePropertyKeys to learn about available keys.
Values are returned as numbers, booleans or converted to text.

Document Handling Status values:

FEED_READY1The document feeder has a page loaded and is ready for use.
FLAT_READY2The flatbed is ready for use.
DUP_READY4The duplexer is enabled and ready to use.
FLAT_COVER_UP8The flatbed cover is up.
PATH_COVER_UP16The paper path is covered and is preventing proper operation.
PAPER_JAM32A document is stuck in the document feeder.
FILM_TPA_READY64A transparency adapter is installed and ready for use.
STORAGE_READY128A storage device is installed and ready for use.
STORAGE_FULL256The storage is full; no upload operations are possible.
MULTIPLE_FEED512A multiple feed occurred; this type of feed usually occurs with a PAPER_JAM value.
DEVICE_ATTENTION1024There is an error that requires user intervention on the scanner.
LAMP_ERR2048The scanner has a problem with the lamp and is not ready.
IMPRINTER_READY4096The imprinter capabilities of an imprinter/endorser are enabled and ready for use.
ENDORSER_READY8192The endorser capabilities of an imprinter/endorser are enabled and ready for use.
BARCODE_READER_READY16384The barcode reader is enabled and ready for use.
PATCH_CODE_READER_READY32768The patch code reader is enabled and ready for use.
MICR_READER_READY65536The MICR reader is enabled and ready for use.
e.g. if you get back 5, this is feed and duplex ready.

Document Handling Capabilities:

FEED1The scanner has a document feeder installed.
FLAT2The scanner has a flatbed platen.
DUP4The scanner has a duplexer.
DETECT_FLAT8The scanner can detect a document on the flatbed platen.
DETECT_SCAN16The scanner can detect a document in the feeder only by scanning.
DETECT_FEED32The scanner can detect a document in the feeder.
DETECT_DUP64The scanner can detect a duplex scan request from a user.
DETECT_FEED_AVAIL128The scanner can detect when a document feeder is installed.
DETECT_DUP_AVAIL256The scanner can detect when a duplexer is installed.
FILM_TPA512The scanner has a transparency or film scanning adapter.
DETECT_FILM_TPA1024The scanner can detect when the transparency or film scanning adapter is ready to scan.
STOR2048The scanner is equipped with an internal storage device.
DETECT_STOR4096The scanner can detect when there is a document in the internal storage.
ADVANCED_DUP8192The device supports advanced duplex scan configuration, independently on each document size.
AUTO_SOURCE16384The device supports auto-configured scanning.
IMPRINTER65536Imprinter
ENDORSER131072Endorser
BARCODE_READER262144Barcode Reader
PATCH_CODE_READER524288Patch Code Reader
MICR_READER1048576MICR Reader

e.g. if you get back 21, this is detect scan, duplex and feeder.

Examples

Query name of current device:

MBS( "WIA.DevicePropertyValue"; ""; "Name" )

List properties:

Set Variable [$device; Value:Get(ScriptParameter)]
Set Variable [$list; Value:MBS("WIA.DevicePropertyKeys"; $device)]
If [MBS("IsError")]
    Show Custom Dialog ["Error"; $list]
Else
    Set Variable [$count; Value:ValueCount ( $list )]
    If [$count > 0]
        Set Variable [$i; Value:1]
        Loop
            Set Variable [$key; Value:GetValue ( $list; $i)]
            Set Variable [$value; Value:MBS("WIA.DevicePropertyValue"; $device; $key)]
            New Record/Request
            Set Field [WIA Scan::Device; $device]
            Set Field [WIA Scan::Key; $key]
            Set Field [WIA Scan::Value; $value]
            Commit Records/Requests [No dialog]
            #Next
            Set Variable [$i; Value:$i+1]
            Exit Loop If [$i > $count]
        End Loop
    End If
End If

Query maximum vertical optical resolution:

// via name
MBS("Wia.DevicePropertyValue"; ""; "Vertical Optical Resolution")
// via ID
MBS("Wia.DevicePropertyValue"; ""; 3091)

Query Manufacturer of first device:

MBS( "WIA.DevicePropertyValue"; 0; "Manufacturer")

Example result: "Brother"

Query Document Handling Status:

MBS( "WIA.DevicePropertyValue"; ""; "Document Handling Status" )

See also

Example Databases

Blog Entries

This function checks for a license.

Created 6th November 2016, last changed 16th November 2019


WIA.DevicePropertyKeys - WIA.GetCurrentDevice