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

Follow
Reply to: Device Name Parameter for CreateFile()
PLEASE NOTE: Do not post advertisements, offensive materials, profanity, or personal attacks. Please remember to be considerate of other members. If you are new to the CNET Forums, please read our CNET Forums FAQ. All submitted content is subject to our Terms of Use.
Reporting: 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.
Comments
- Collapse -
Answer
Small world.

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

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.

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.)

CNET Forums

Forum Info