CarNetix Support Forum  

Go Back   CarNetix Support Forum > Main Forum > CNX-PSUmoni2140 Software

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 04-11-2007, 12:06 PM
mikeh's Avatar
mikeh mikeh is offline
Administrator
Site Admin
 
Join Date: Jun 2006
Posts: 836
Default P2140 SDK/API Released 4/11/07

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!
__________________
Mike H
CarNetix
www.carnetix.com
mikeh@carnetix.com

Last edited by mikeh; 09-12-2007 at 09:55 PM.
  #2  
Old 04-17-2007, 03:18 PM
zPilott zPilott is offline
Junior Member
Site Admin
 
Join Date: Apr 2007
Posts: 14
Default

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;
would change to
Code:
private bool connected = false;
public bool Connected{
  get{
    return connected;
  }
}
This helps to self document the api by making sure that the developer doesn't assume that he/she can connect/disconnect by changing this value. This also means for the larger struct objects especially the client program isn't creating unnecessary garbage by setting cb to a new cbP2140.

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
  };
to enable easy conversion between the ascii character value and the enum.

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  
Old 04-17-2007, 05:07 PM
mikeh's Avatar
mikeh mikeh is offline
Administrator
Site Admin
 
Join Date: Jun 2006
Posts: 836
Default

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.
__________________
Mike H
CarNetix
www.carnetix.com
mikeh@carnetix.com
  #4  
Old 05-10-2007, 08:03 PM
Game_Ender Game_Ender is offline
Junior Member
Site Admin
 
Join Date: Feb 2007
Posts: 17
Default How to use the API?

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  
Old 05-11-2007, 10:19 AM
zPilott zPilott is offline
Junior Member
Site Admin
 
Join Date: Apr 2007
Posts: 14
Default

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  
Old 05-23-2007, 07:00 PM
changeip changeip is offline
Member
Site Admin
 
Join Date: Apr 2007
Posts: 43
Default

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  
Old 09-12-2007, 02:48 PM
zerach zerach is offline
Junior Member
Site Admin
 
Join Date: Sep 2007
Posts: 1
Default Will be buying this power supply and programming a Centrafuse plugin.

Quote:
Originally Posted by mikeh
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.

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  
Old 04-29-2008, 05:39 PM
gnassar gnassar is offline
Junior Member
Site Admin
 
Join Date: Apr 2008
Posts: 4
Default

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  
Old 04-29-2008, 10:44 PM
mikeh's Avatar
mikeh mikeh is offline
Administrator
Site Admin
 
Join Date: Jun 2006
Posts: 836
Default

Quote:
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.
Specifically, what did you have in mind?
__________________
Mike H
CarNetix
www.carnetix.com
mikeh@carnetix.com
  #10  
Old 06-20-2008, 07:19 PM
gnassar gnassar is offline
Junior Member
Site Admin
 
Join Date: Apr 2008
Posts: 4
Default CNX2140(Jumper Settings) has any one used this configuration? Safety issues/Problems?

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!!
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:39 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
The contents of this forum are copyright 2010 CarNetix