Message Boards Message Boards

Is the Class property in the DeviceObject the same thing one in DeviceOpen?

Posted 8 years ago

The documentation on DeviceOpen is poor; it specifies that it takes a "devclass" parameter. Nowhere does it specify how to enumerate all possible values that can be used for "devclass". I see that there is a function FindDevices that returns DeviceObjects, and in the DeviceObject there is a Class property. Is this Class property the same thing as the "devclass" parameter in DeviceOpen? If so, please make that explicit in the docs. If not, how do I enumerate things of type "devclass"?

POSTED BY: Brian Catlin
2 Replies
Posted 8 years ago

That's great. Thank you!

POSTED BY: Brian Catlin

Hi,

You can find all currently available device drivers (note that this is not the same as device objects, a driver only enables you to interface with said device, you may still need the device itself to open the device with DeviceOpen) with the function

DeviceFramework`FindDeviceDrivers[]

This returns a list of the currently available drivers, each represented as a list, with the first argument the driver file, the second the driver name, and the third the driver version. You can inspect this easily with Dataset, turning this list into an Association for each driver.

Dataset[Association[#2 -> <|"File" -> #1, "Name" -> #2,  "Version" -> #3|> & @@@ DeviceFramework`FindDeviceDrivers[]]]

For example, on my machine this is the output:

Dataset of Device Driver Classes

(you can find this and more information on the reference page for "Developing Device Drivers" here.

Hope this helps,

Ian

POSTED BY: Ian Johnson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract