Windows 7 forum

Question

Device Name Parameter for CreateFile()

I am trying to write a C program to communicate with some OneWire devices from a Windows PC via a Maxim DS9490R USB-to-OneWire bridge. The C program (a simple command line application) is built using Visual Studio C++. I am having trouble with the CreateFile() function. What string do I have to supply as the "filename" parameter (the first parameter) to identify the DS9490R, which is plugged into a USB port on my PC? The code that I am basing my program on (part of Maxim's OneWire Public Domain API) contains the comment "For this platform use format '\\.\DS2490-X' where X is the port number". DS2490 is the name of the chip inside the DS9490R. I have tried the format given, and many variations of it, and all give me an error "Error 23: Failed to acquire a necessary system resource". I know that the hardware is working, because a different Maxim application (OneWireViewer, a Java app) works perfectly well, and finds the DS9490R, and the devices attached to the OneWire network, and can read values back from them. I just need to make this work in my C program.

I hope someone can give me a hint that can get me over this hurdle.

Thanks - Rowan

Discussion is locked
You are posting a reply to: Device Name Parameter for CreateFile()
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Device Name Parameter for CreateFile()
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.

All Answers

Collapse -
Answer
Small world.

In reply to: Device Name Parameter for CreateFile()

I had the old Dallas One Wire system with the weather station and more. It also had an USB to one wire dongle and at the time Dallas had example code. In your case back to Maxim to see if they have example code and drivers.

In short I had to install the driver for the USB dongle then the apps would work.

Collapse -
Thanks

In reply to: Small world.

Thanks for your reply. I have asked Maxim for help, but no reply yet. I have also tried running their example application, which doesn't run either (although a different Java program does run, so I know it's not a hardware problem. Maybe a missing driver or something...).

So I'm still searching for a solution...

Thnaks - Rowan

Collapse -
You may want to read the Java source to see what they did.

In reply to: Thanks

That would be my next move.

Maxim used to have source for such things. Have they changed?
(Sorry but I didn't check on that for you.)

Popular Forums

icon
Computer Newbies 10,686 discussions
icon
Computer Help 54,365 discussions
icon
Laptops 21,181 discussions
icon
Networking & Wireless 16,313 discussions
icon
Phones 17,137 discussions
icon
Security 31,287 discussions
icon
TVs & Home Theaters 22,101 discussions
icon
Windows 7 8,164 discussions
icon
Windows 10 2,657 discussions

SMART HOME

This one tip will help you sleep better tonight

A few seconds are all you need to get a better night's rest.