![]() |
|
|
|
#1
|
||||
|
||||
|
Today we are releasing V1.0 of our Software Devleopment Kit (SDK) which includes an Application Program Interface (API) DLL for the P2140 regulator. Please note that this API requires version 1.8+ firmware.
CarNetix P2140 SDK V1.0 The SDK includes: 1) SDK Guide 2) Demo program 3) P2140API.dll 4) USB drivers 5) P2140API Help File Unfortunately, I am by no means an expert in this area and will be relying on some of you experts to help me get the appropriate information documented for the various applications you may want develop. FYI, for those of you who have not taken the C# .NET 2.0 plunge, Microsoft is giving away (ie free) the Visual Studio Express IDE. It can make decent programmers out of your averae Joe (ie me). You may want to give it a try since it may make developing applications with the P2140API a bit easier. Please provde any comments, questions, or feedback in this thread. Enjoy! Last edited by mikeh; 09-12-2007 at 09:55 PM. |
|
#2
|
|||
|
|||
|
Hi Mike, I have just started looking over the API, trying to get a feel for how I might use it. One suggestion I might have right off the bat is to move any fields that are not normally writable to a property (with only a get) supplied.
Code:
public bool Connected = false; Code:
private bool connected = false;
public bool Connected{
get{
return connected;
}
}
It looks like the cbP2140 struct is all read only values, so it seems like all of these would like to be get only properties. To achieve that, you would need to add a method that takes the received data and sets everything (preferably) or makes the set part internal. For the paramP2140 you could have the setter for each field set a bit indicating that it has been changed. You might also consider changing the Mode field to an enum, maybe something like: Code:
enum Mode {
u = 117,
User = 117,
b=98,
Bootloader = 98,
x=120,
NotConnected=120
};
These are of course, just suggestions, and I think the SDK seems perfectly usable as is and makes me very happy I bought a P2140 and external PSU instead of an integrated device. I haven't had the time to actually get down and start working on any software that uses this yet, but I am excited about the posssibilities. The first thing that comes to mind is of course making a skinnable psuimon clone. I would also like to create an app that monitors the ignition state and kicks off some tasks when the ignition goes off, then (once they complete) start the shutdown process. |
|
#3
|
||||
|
||||
|
zPilott,
Excellent feedback. No I just need to figure out how to do the stuff you suggested... . I'm sort of a newbie C# programmer. Seriously, I understand what you are saying and agree that it would be a good idea. I'll give it a shot (a bit later).I'm glad to see your excitement about writing apps. I have been hoping folks would jump on this opportunity. I'd love to see some sort of integration with an existing front end. Let me know if you run into any problems. And thanks for the feedback. |
|
#4
|
|||
|
|||
|
Is there a quick howto on using this api? I can't seem to find "mpusbapi.dll" where do I get this dll and once I have it where do I put it?
|
|
#5
|
|||
|
|||
|
I think the mpusbapi.dll is included with psumoni. It is probably easiest to just put it in the same directory as your application, but you can also put it anywhere in your path. The help files included seem pretty complete and you might want to look at the demo application included in the sdk for help getting started.
|
|
#6
|
|||
|
|||
|
is there a way to emulate a 2140 so we can program against it without physically having a unit connected ? A feature request for the future I guess.
Also, I'd like to add history and long term graphs to psumoni, is there a chance you would release the source for psumoni so we don't have to rewrite all from scratch ? Sam |
|
#7
|
|||
|
|||
|
Quote:
Hi Mike, I wanted you to know that I'm buying this power supply solely because it has an SDK. I am a independant programmer for Centrafuse applications and have been looking for a power supply that replaces my old one, with the ability to monitor various battery and power related indicators. It looks like CarNetix has come through for me. I will be purchasing and planning on a Centrafuse plugin...using this SDK. Then we'll see about further integration (event driven controls vial certain indicators...). Anyways I'm looking forward to providing updates and letting you know how it goes. I'm a Delphi programmer so I'm not in to C# at all but I can take the .dll and implement it in Delphi no problem. One question I had...is it only the 2140 that has the ability to monitor and work with the SDK? The 2140 may be overkill for me. I'm more interested in the P1900. If not I guess I have no choice now
|
|
#8
|
|||
|
|||
|
Hi Mike, All,
I am working with the Carnetix 2140 and am doing some programming to basically control the Carnetix remotely. The API is wonderful to the features that it includes unfortunately as every other programmer we'd like more. There's several posts here about the addition of features and I was wondering since most of those posts are about a year old, is it possible that the features have been added or is there any possibiliy of adding extra features to the device? More control over the state machine is I guess what I'm aiming at but I'm not sure about the robustness of the chip itself. I've read before that once the timers fire off there's no way to stop them but I wasn't sure if thats a physical limit or the posted API limit. If it's the posted API limit I may attempt at begging for more features. |
|
#9
|
||||
|
||||
|
Quote:
|
|
#10
|
|||
|
|||
|
Hey guys, I am wondering if CNX 2140 jumper settings can be used the following way?
Input Voltage 12V Primary Output= 18V Secondary Output= 5V Also connect a 5V Regulator to get another 5V out put. Also the following configuration on a different CNX 2140 Input Voltage 12V Primary Output = 12V Secondary Output = 5V Also connect a 5V Regulator to get another 5V out put. I have tried both and it works but I cold not find this configuration in the CNX-2140 documentation. The difference is according to the CNX 2140 documentation using "Configuration 1" the jumper settings are suppose to be JP4 to the left side getting the battery power. Instead I had to move it towards the right which it is on Pri. Out side in order to connect the 5V Regulator to the 12V Battery. Since it is not documented would appreciate if it is safe to use the way I mentioned above or will I face any problems? If any one has used the above settings would appreciate your feed back. Any safety issues or Problems if we use the above configurations? Thanks much!!
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|