Thursday, September 19, 2013

Ixonos sensact library – sensor/actuator communication made easy!

Fresh out of the Ixonos engineering labs comes the embedded HTML5 industrial prototype that Ixonos engineers are working on. The latest version of this prototype samples sensor data from a Texas Instruments multi-function sensor device http://www.ti.com/tool/boostxl-senshub which is connected via USB – this device includes various sensors (thermometer, compass, gyro, pressure, etc.).

To easily access these sensors we have created a library named “libsensact” which abstracts away the communication channel and input/output details of sensor or actuator devices – each device is simply characterized by it's name and the names of sensor/actuator variables that it provides. The communication channel which is abstracted can be any of USB, I2C, UART, Ethernet, EtherCAT, CAN, ProfiNET, etc.. Though, the first version of the library only supports USB.

The library offers simple connection handling functions and get/set functions for retrieving or setting sensor/actuator variable values of various types (char, int, float, etc.).

For example, retrieving the “temperature” and “pressure” values of the multi-function sensor device named “senshub0” is as simple as described by the following application code:
#include <stdio.h>
#include <unistd.h>
#include "sensact.h" 

#define TIMEOUT 100 // ms

int main(void)
{
  int device;
  float temp;
  float pressure;
  int status;

  device = connect("senshub0");

  status = get_float(device, "temperature", &temp, TIMEOUT);
  if (status < 0)
    printf("Error fetching temperature.");
  else
    printf("Sensor Temperature: %f\n", temp);

  status = get_float(device, "pressure", &pressure, TIMEOUT);
  if (status < 0)
    printf("Error fetching pressure.");
  else
    printf("Sensor Pressure: %f\n", pressure);

  disconnect(device);

  return 0;
}
Also, for each sensor/actuator device, the library contains an entry in a device configuration structure list which contains device specific configurations. For example, the “senshub0” device is configured by the following code:
#include "device.h"

/* List of supported sensor/actuator devices */ 

struct device_t device[] = 
{ 
  { .name = "senshub0", 
    .description = "TI Sensor Hub USB device", 
    .connection = USB, 
    .vid = 0x1CBE, 
    .pid = 0x0003, 
    .endpoint = 0x1 }, 
  { } 
}
For different connection types there will be different “.connection” definitions and subsequently different related dot configuration variables.

Future plans for this library are to add support for more connection types and extend the API with subscriber type functionality so that the user can register callback functions which will be called upon value changes for sensor/actuator devices which are able to support event-driven communication.

Watch out for more blog entries on this library as it evolves...

That's it – keep it simple!

Martin Lund, System Architect - Ixonos

12 comments:

  1. this is good post...

    i like this...

    please can you visit here..

    http://bantalsilikon01.blogspot.com/
    http://bantalsilikon01.blogdetik.com/
    http://bantalkekabumurah.blogspot.com/
    http://bumbupecel1.blogspot.com/
    http://bantalgood.blogspot.com/2014/04/bantal-silikon-3-tahan-tahun.html
    http://bantalsilikonmalang1.blogspot.com/2014/04/bantal-original-silikon-malang.html
    http://bantalsilikonmurah.blogspot.com/2014/04/bantal-silikon-original-085-635-945-40.html

    http://www.bantalsilikon01.blogspot.com/2014/04/bantal-silikon-original-merek-lutuye.html

    http://marinirseo.blogspot.com/
    http://marinirseo.blogspot.com/
    http://marinirseo.blogspot.com/


    tengs very much...

    ReplyDelete
  2. Tulisanya SANGAT BERMANFAAT, semoga semakin SUKSES dan BANJIR ORDER. Amin...
    Dari: kuch2hotahu |Email: kuch2hotahu@gmail.com / franchisemurah2014@gmail.com | No. HP: 085.317.006.007 (Telkomsel) , 085.608.002.007 (Indosat) ,085.743.114.560 (Indosat), 081.219.806.009 (Telkomsel), 087.883.652.007 (XL) , 085.710.662.299 (Indosat)|website : http://kuch2hotahu.com/ | twitter : kuch2hotahu | FB : Kuch2hotahu

    ReplyDelete
  3. Tulisanya SANGAT BERMANFAAT, semoga semakin SUKSES dan BANJIR ORDER. Amin...
    Dari: Model Baju Anak | http://belibajuanak.com/ | Pin:29511F0D | WHATSAPP:081.311.323.893 | FP: www.facebook.com/belibajuanak | FB: www.facebook.com/refanes.jakartabarat | Twitter: @BeliBajuAnak | Instagram: belibajuanak

    ReplyDelete
  4. Tulisanya SANGAT BERMANFAAT, semoga semakin SUKSES dan BANJIR ORDER. Amin...
    Dari: Bpk.Adjie Gumay | https://twitter.com/adjiegumay | Email: Herbal_extract@yahoo.co.id / pelangsingbadanaman@gmail.com | Tlpn: 081.906.041.973 (XL)

    ReplyDelete
  5. Tulisanya SANGAT BERMANFAAT, semoga semakin SUKSES dan BANJIR ORDER. Amin...
    Dari: Bibit Buah DURIAN Murah | http://www.jualbibitdurian.com/ , http://bibitdurianbawor.com/ , http://www.bibitdurianmusangking.com/ | Pin:29EB46D9 | Hot line 081.327.119.234 (Simpati) | Tlpn: 085.747.754.569 (IM3) / 087.837.300.839 (XL) | FB: jualbibitdurianmontong(jualbibitdurianbawor) | FB: Taufiq Ismail (juragan durian)

    ReplyDelete
  6. Tulisanya SANGAT BERMANFAAT, semoga semakin SUKSES dan BANJIR ORDER. Amin...
    Dari: Bpk. Iwan, Ibu Tri | http://superdetergentultracomatic.blogspot.com/ | Email: detergentultracomatic@gmail.com | Tlpn: 087.722.777.439 (XL), 081.221.433.309 (Telkomsel)

    ReplyDelete
  7. Tulisanya SANGAT BERMANFAAT, semoga semakin SUKSES dan BANJIR ORDER. Amin...
    Dari: Kacang Almond MURAH | http://kacangalmond.com/ | +62.857.2801.6909 (INDOSAT) | FB: https://www.facebook.com/pages/Kacang-Almond-Murah/533330553425189

    ReplyDelete
  8. AthaRizky menyediakan berbagai Baju MUSLIM Modern, JUAL Baju Grosir Murah, GROSIR Mukena Murah, Daster SOLO Murah, Grosir DASTER Solo, maupun baju biasa yang TRENDY dan UPDATE. banyak brand asli Indonesia yang kami sediakan dengan berbagai MODEL dan VARIASI terbaru yang tidak kalah dengan brand-brand luar. Serta kami menjual barang-barang yang MURAH MERIAH dan PAS DI KANTONG pelajar/mahasiswa/ibu rumahtangga.

    HUBUNGI KAMI 24 JAM:
    1. FB: Atharizky (https://www.facebook.com/ovi.indrihastuti)
    2. FP: Grosir Mukena Daster Solo (https://www.facebook.com/mukenadastersolo/)
    3. FP: Grosir Murah Daster dan Batik Solo (https://www.facebook.com/grosirmurahdastersolo/)
    4. FP: Supplier/Grosir Mukena & Daster Solo (https://www.facebook.com/jualgrosirbatiksolo/)
    5. Grup fb Grosir Murah Daster dan Batik Solo
    6. Email: oviiee_indri@yahoo.co.id, oviieeindri2015@gmail.com
    7. Pin BB: 7D07DD5A/5E527A1A
    8. WA/Tlpn: :081.231.598.647 (SIMPATI).

    Atau KUNJUNGI YOUTUBE KAMI di:
    1. https://www.youtube.com/watch?v=1Xcjr_DK3_c&feature=youtu.be
    2. https://www.youtube.com/watch?v=Sg3MHcC92Cw&feature=youtu.be
    3. https://www.youtube.com/watch?v=Q1UcySi22oc&feature=youtu.be
    4. https://www.youtube.com/watch?v=WSbVvGJMuMU&feature=youtu.be
    5. https://www.youtube.com/watch?v=_fI-iB-Pd1o&feature=youtu.be
    6. https://www.youtube.com/watch?v=iDjl03gMfpQ&feature=youtu.be
    7. https://www.youtube.com/watch?v=5Ab94vg7OZ0&feature=youtu.be
    8. https://www.youtube.com/watch?v=xJoK6a0dC-g&feature=youtu.be
    9. https://www.youtube.com/watch?v=9MFuvzQh1qU&feature=youtu.be
    10. https://www.youtube.com/watch?v=82cTikQFfkY&feature=youtu.be.

    Baju BARU, Baju BARU Alhamdulillah, Baju MUSLIM Modern 2014, Baju PENGANTIN, Baju MUSLIM Modern 2014, BAJU Muslim Modern 2015, BAJU Merah
    BAJU Muslim 2015, BAJU Muslim Pesta, BAJU Muslim Modern, BAJU Muslim Terbaru, BAJU Muslim TANAH Abang, BAJU Muslim Terkini
    MODEL Baju Muslim TERBARU, Trend Baju MUSLIM 2014, TUTORIAL Baju Muslim, MODEL Baju Muslim WANITA Terbaru, gamis collection, supplier hijab solo, tokopakaian, pusatgrosir, batiksolo, distributor baju muslim murah, jilbab solo, gamis solo, distributor baju
    model baju islami terbaru, model baju muslim yang terbaru, baju jilbab terbaru, baju muslim yg terbaru, lihat baju muslim terbaru
    lihat model baju muslim terbaru, baju terbaru muslim, gaya baju muslim terbaru, baju muslim yang terbaru, baju busana muslim wanita terbaru, baju muslim terbaru murah
    baju wanita muslim terbaru, cari baju muslim terbaru, baju muslim pesta terbaru, model baju dress muslim terbaru, jual baju muslim terbaru, baju muslim terbaru wanita
    baju busana terbaru, baju muslim online terbaru, tren baju muslim terbaru, baju baju terbaru, model baju koko terbaru
    fashion baju muslim terbaru, mode baju muslim terbaru, baju baju muslim terbaru, model baju busana muslim terbaru, model terbaru baju muslim, koleksi baju terbaru
    baju muslim terbaru online, baju busana muslim terbaru, baju muslim terbaru 2014,baju muslim terbaru 2013, baju muslim model terbaru, baju muslim wanita terbaru

    ReplyDelete
  9. Kami Bergerak Dalam Pembibitan Durian BAWOR, Durian MONTONG, Durian Menoreh Kuning, Durian Musang King dan Durian Unggulan Lainya.

    Kami Siap Melayani Pesanan baik GROSIR atau eceran

    Alamat : Purwosari Rt06/01 Kecamatan Puring Kab Kebumen.

    Telpon: 0813 2711 9234 (Simpati) / 0857 4775 4569 (IM3) / 0878 3730 0839 (XL)

    PIN BB: 29EB 46D9

    Website : www.jualbibitdurian.com, www.bibitdurianbawor.blogspot.com, www.durianmusangking.blogspot.com, web www.bibitduriansiapbuah.blogspot.com

    ReplyDelete
  10. Kami Bergerak Dalam Pembibitan Durian BAWOR, Durian MONTONG, Durian Menoreh Kuning, Durian Musang King dan Durian Unggulan Lainya.

    Kami Siap Melayani Pesanan baik GROSIR atau eceran

    Alamat : Purwosari Rt06/01 Kecamatan Puring Kab Kebumen.

    Telpon: 0813 2711 9234 (Simpati) / 0857 4775 4569 (IM3) / 0878 3730 0839 (XL)

    PIN BB: 29EB 46D9

    Website : www.jualbibitdurian.com, www.bibitdurianbawor.blogspot.com, www.durianmusangking.blogspot.com, web www.bibitduriansiapbuah.blogspot.com

    ReplyDelete
  11. Kami Bergerak Dalam Pembibitan Durian BAWOR, Durian MONTONG, Durian Menoreh Kuning, Durian Musang King dan Durian Unggulan Lainya.

    Kami Siap Melayani Pesanan baik GROSIR atau eceran

    Alamat : Purwosari Rt06/01 Kecamatan Puring Kab Kebumen.

    Telpon: 0813 2711 9234 (Simpati) / 0857 4775 4569 (IM3) / 0878 3730 0839 (XL)

    PIN BB: 29EB 46D9

    Website : www.jualbibitdurian.com, www.bibitdurianbawor.blogspot.com, www.durianmusangking.blogspot.com, web www.bibitduriansiapbuah.blogspot.com

    ReplyDelete
  12. Kami Bergerak Dalam Pembibitan Durian BAWOR, Durian MONTONG, Durian Menoreh Kuning, Durian Musang King dan Durian Unggulan Lainya.

    Kami Siap Melayani Pesanan baik GROSIR atau eceran

    Alamat : Purwosari Rt06/01 Kecamatan Puring Kab Kebumen.

    Telpon: 0813 2711 9234 (Simpati) / 0857 4775 4569 (IM3) / 0878 3730 0839 (XL)

    PIN BB: 29EB 46D9

    Website : www.jualbibitdurian.com, www.bibitdurianbawor.blogspot.com, www.durianmusangking.blogspot.com, web www.bibitduriansiapbuah.blogspot.com

    ReplyDelete