Windows programming example or documentation?

I purchased a PR33-17 USB to I2C adapter and an AD5667 DAC board for testing. I downloaded the AnyI2C software and it works great.

Now I’d like to start integrating the device into my own Windows software. Unfortunately, i’m a little lost. So far I have the source code for AnyI2C which is … complicated. Is there some kind of documentation for the AnyI2CLib out there? Or even just a minimum program for reading/writing in Windows? Or am I supposed to be using some other library besides AnyI2C? I skimmed the quick start guides, but they mostly talk about the low level protocol, not the software interface.

Hi Richard,

The the I2C commands require additional encoding as outlined in this guide to go through as I2C commands: https://ncd.io/serial-to-i2c-conversion/

This API ensures that I2C standards for timing are maintained when forwarded from a Serial command.

There is another library that uses this that may be more clear: https://github.com/ncd-io/ncd-red-comm/blob/master/lib/NcdSerialI2C.js

Particularly you’d want to look at the methods validate, buildPacket, and wrapApi.

Basically buildPacket will build the payload that will be wrapped in the wrapApi function.

Validate just validates responses from the I2C devices.

Thanks, but I’m not sure that answers my question. I’m trying to figure out what DLL I’m supposed to be using to send commands to the serial to i2c device, and asking if there is an example program or documentation explaining how to do initialize it and then send data? I’ve done some i2c programming before on various SOCs, so I’m not too worried about that yet, just trying to figure out how I talk to this serial to i2c adapter I have.

By the way, my name is Mike, not Richard.

Hi Mike,
What programming language are you working with? If you are a Visual Studio developer, we have some resources that could help you a lot.
Thanks,
Ryan

Hi Ryan,

Plain c or .NET c++, but after some debugging I think I have AnyI2CLib mostly figured out. I couldn’t find a method for programmatically setting the COM port, but it was simple enough to add to the library. Seems to be able working correctly.

If you have a ready made program, that would also be interesting to look at in case I get stuck later on.

Thanks

Hi Mike,
You might have a look at https://ncd.io/alpha this software (source code) was built for a much more powerful serial to I2C converter we have in the works. It will establish communications over a network connection, supports our wireless I2C standard (coming this year), as well as serial to I2C conversion. There are many libraries that will work with your converter. Hope it is helpful, let me know if you have any questions.
Ryan

I’m getting stuck trying to incorporate the library I wrote into my existing application. I didn’t realize this at the time, but I think the anyi2c library can’t run in 64 bit mode because the included NCDEnterprise.dll is 32 bit. I tried building a 64 bit version using the source included with Alpha, but it looks like the NCDEnterprise functions are a little different in the newer alpha version.

Is there a 64 bit version (or source code) for the NCDEnterprise.dll version in anyi2clib?

Our senior software developer on this project is currently out of the country visiting some of our partners, we expect him to return in the next couple of weeks, he would be the best person to answer the question. Please check back with us late next week or you can open a ticket and we can direct the ticket to him for when he returns.
Thanks,
Ryan

Thanks. I actually just sat down with the API docs and wrote my own code for controlling the devices. It ended up being quite easy since I only needed COM port access and only a few basic things.

Something like this would be nice to put on Github, although hopefully a little cleaner than my version.