vxi_11 transaction reason

  • J.B. Looney

    J.B. Looney - 2007-08-24

    I can see this isn't exactly a well used forum, but hey, can't hurt to try.

    I recently downloaded the PythonLabTools specifically for using the vxi11 classes.  The classes are great.  The only thing that would be nice is slightly more detailed commenting of expected use for some of the functions.  But, I've figured out how to use everything I need without much issue.

    So, the reason for the post.  I'm trying to figure out what the reason value means from the tuple returned by vxi_11_connection.transaction.  It returns (error, reason, results).

    If anyone reads this and knows the answer, I'd definitely appreciate it.  I tried working my way through the various function calls, and unless I missed something, it appears as though the reason comes several parents above vxi_11_connection.

    -James Looney

    • Marcus Mendenhall

      Hi, James.  The fields in this are defined in the VXI-11 standard, so I return them.  Normally, all you really need is the error flag.  however, if you go to


      and download the VXI-11 specifications (which are surprisingly readable) and look in section B.6.4.device_read on page 30 of the vxi-11.pdf file, they discuss the meaning of the fields returned from a read operation.

      Hope this helps.  Feel free to contact me for any more information.  I apologize for the somewhat belated response here.  Since no-one has posted a real qustion to the forum before, I had pretty much quit looking!

      Marcus Mendenhall

    • Marcus Mendenhall

      The short answer to this (which I should have posted, too) is that reason is an inclusive OR of 3 bits. 

      Bit 2  = END/EOI received,
      bit 1 = Terminating Character received
      bit 0 = full requested byte count received.

      Normally, the reason is likely to be 2, since EOI normally terminates a read.  However, if you are using terminating characters, or reading indeterminately long byte streams into finite sized buffers, you could easily get other bits set.


      • Marcus Mendenhall

        oops, 'reason' should really normally be 4, not 2. It is bit 2 that is normally set.  Sorry.


    • J.B. Looney

      J.B. Looney - 2007-08-31

      Thanks for the answer Marcus.  Makes sense.  I'll let you know if I come up with any other questions.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks