Wow..! That's quite a bit of research :). Those are exactly my reference documents.

Yes, I am setting the value of the KSENT_TXInit as per the document (and getting an "all OK" return from the call) before calling the KSENT_TX function

I wasn't so sure of the description in the document regarding the length of the information to be sent and hence contacted the developer of the DLL who replied saying that "the *data is a pointer to an array of unsigned chars were each char is a SENT nibble"

So i tried quite a few possibilities in addition to the one mentioned in the original query

passing only the 3 nibbles as 3 unsigned chars  my $data_ref = pack ('U0C*', 0x01,0x05,0x05);

and passing the 3 nibbles in 2 octets

 my $data_ref = pack ('U0C*', 0x01,0x55);

and passing all the 8 nibbles as 8 unsigned chars

my $data_ref = pack ('U0C*', 0x08,0x01,0x05,0x05,0x00,0x00,0x0E,0x00);

All of it still crashes with the same error. On hindsight, I think the correct windows error would be "Perl interpreter encountered an issue". I will try dumping the details of the failure if it helps further.


In reply to Re^6: How to pass a pointer to an array of 'unsigned char' C data type with Win32::API (debug) by apeks_okad
in thread How to pass a pointer to an array of 'unsigned char' C data type with Win32::API by apeks_okad

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.