03-17-2010 11:35 AM
Using Labview 2009:
I am using an Advantech Atom 3.5" single board computer, which amongst its many features has a SMBus interface which is accessed through a SUSI® Library. I am familiar with the SMBus protocol but not quite sure how to use the libary functions. A typical communication (reading back a word) is as follows; [S][slave address][Wr][A][Command Code][A][S][Slave Address][rd][A][Data byte low][A][Data byte high][A][P] The SUSI® Library has the following library call fuction; Read a word (2 bytes) of data from the target slave device in the SMBus. BOOL SusiSMBusReadWord(BYTE SlaveAddress, BYTE RegisterOffset, WORD *Result); ParametersSlaveAddress[in] Specifies the 8-bit device address, ranging from 0x00 – 0xFF. Whether to give a 1 (read) or 0 (write) to the LSB of SlaveAddress could be ignored. RegisterOffset[in] Specifies the offset of the device register to read data from.Result[out] Pointer to a variable in which the function reads the word data. Return ValueTRUE (1) indicates success; FALSE (0) indicates failure. RemarksThe first byte read from slave device will be placed in the low byte of Result, and the second byte read will be placed in the high byte.For more information about how to use this API, please refer to “Programming Overview”, part “SMBus functions”. Two things which I am not sure how to use the RegisterOffset and how to access the data returned via the 'word *Result'Perhaps someone who has used these functions before may be able to point me in the right direction. Thanks
03-18-2010 06:34 AM
Hi,
Although I've not personally used this device or protocol before I'm hoping I can be of some help, or that someone on the forums who has needed to use the SUSI library will post.
Looking at the manual (page 68: SUSI Reference) once the device is addressed over the bus, then the RegisterOffet parameter is the part of the device register to read from, so on the system should be some mapped registers from which you can offset, which will just return the information into the variable you've defined via a pointer.
If I can ask, how are you interfacing this with LabVIEW, is it a Call Library Function to a DLL, .NET layer call or something else?
Kind Regards,
03-18-2010 11:51 AM
Hi,
Yes I am using Call Library Function to a DLL.
I have been experimenting with lab view code and now understand the terminology a little more. The 'RegisterOffset' referred in the SUSI SMBus definitions is in fact the 'Command Code' value. The 'WORD *RESULT' returns an unsigned 16bit integer.
I can now communicate with our LTC1760 smart charger and the two connected smart batteries.
I shall now go home happy 🙂
Thanks for your reply Rob.
02-09-2011 01:42 AM
Dear Sylar,
I was also trying to set and get Watchdog Timer values using SUSI Library on my ARK-3403 Box PC. Can you please share the LabView Code used to address the SUSI API.
it would be a great help to me. Thanks.
With regards
Shourya
02-09-2011 05:59 AM
Hi Shourya,
I have attached a vi which might help you.
Basically we have a hardware light sensor which allows us to change the brightness of the LCD backlight. The atom board provides a 0-5V analogue voltage output which we control.
I would also recommend down loading the the 'SUSI Library User's Manual' from Advantech which describes all the library functions and formats.
Hope this helps you
John/Sylar
02-09-2011 06:04 AM
Dear John Sylar,
Thanks for your prompt reply.
I was unable to find the attached VI. I think it has been leftout by-mistake so please reupload.
With regards
Shourya
02-10-2011 12:58 AM
Dear John Sylar,
I was waiting for your attachment VI. I have downloaded and started studying 'SUSI Library User's Manual'.
I will be greatful for a little help from your side. If you had problem in attaching VI you can send it on my mail address shouryasingh1@gmail.com.
With regards
Shourya