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 |
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_READY | 1 | The document feeder has a page loaded and is ready for use. |
FLAT_READY | 2 | The flatbed is ready for use. |
DUP_READY | 4 | The duplexer is enabled and ready to use. |
FLAT_COVER_UP | 8 | The flatbed cover is up. |
PATH_COVER_UP | 16 | The paper path is covered and is preventing proper operation. |
PAPER_JAM | 32 | A document is stuck in the document feeder. |
FILM_TPA_READY | 64 | A transparency adapter is installed and ready for use. |
STORAGE_READY | 128 | A storage device is installed and ready for use. |
STORAGE_FULL | 256 | The storage is full; no upload operations are possible. |
MULTIPLE_FEED | 512 | A multiple feed occurred; this type of feed usually occurs with a PAPER_JAM value. |
DEVICE_ATTENTION | 1024 | There is an error that requires user intervention on the scanner. |
LAMP_ERR | 2048 | The scanner has a problem with the lamp and is not ready. |
IMPRINTER_READY | 4096 | The imprinter capabilities of an imprinter/endorser are enabled and ready for use. |
ENDORSER_READY | 8192 | The endorser capabilities of an imprinter/endorser are enabled and ready for use. |
BARCODE_READER_READY | 16384 | The barcode reader is enabled and ready for use. |
PATCH_CODE_READER_READY | 32768 | The patch code reader is enabled and ready for use. |
MICR_READER_READY | 65536 | The MICR reader is enabled and ready for use. |
Document Handling Capabilities:
FEED | 1 | The scanner has a document feeder installed. |
FLAT | 2 | The scanner has a flatbed platen. |
DUP | 4 | The scanner has a duplexer. |
DETECT_FLAT | 8 | The scanner can detect a document on the flatbed platen. |
DETECT_SCAN | 16 | The scanner can detect a document in the feeder only by scanning. |
DETECT_FEED | 32 | The scanner can detect a document in the feeder. |
DETECT_DUP | 64 | The scanner can detect a duplex scan request from a user. |
DETECT_FEED_AVAIL | 128 | The scanner can detect when a document feeder is installed. |
DETECT_DUP_AVAIL | 256 | The scanner can detect when a duplexer is installed. |
FILM_TPA | 512 | The scanner has a transparency or film scanning adapter. |
DETECT_FILM_TPA | 1024 | The scanner can detect when the transparency or film scanning adapter is ready to scan. |
STOR | 2048 | The scanner is equipped with an internal storage device. |
DETECT_STOR | 4096 | The scanner can detect when there is a document in the internal storage. |
ADVANCED_DUP | 8192 | The device supports advanced duplex scan configuration, independently on each document size. |
AUTO_SOURCE | 16384 | The device supports auto-configured scanning. |
IMPRINTER | 65536 | Imprinter |
ENDORSER | 131072 | Endorser |
BARCODE_READER | 262144 | Barcode Reader |
PATCH_CODE_READER | 524288 | Patch Code Reader |
MICR_READER | 1048576 | MICR 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
- IsError
- WIA.DevicePropertyKeys
- WIA.ItemPropertyValue
- WIA.SelectDeviceDialog
- WIA.SetCurrentDevice
- WIA.SetDevicePropertyValue
- WIA.SetItemPropertyValue
Example Databases
Blog Entries
This function checks for a license.
Created 6th November 2016, last changed 16th November 2019