03-13-2014 09:39 AM
I have a serial device to which I am attempting to send negative commands but I am having difficulties. The device receives positive commands and processes them in a correct fashion but cannot interpret negative commands. The protocol consists of 5 bytes - one lead character (one byte), one command character (one byte), two bytes for the command payload (data high followed by data low), and a checksum. The payload requires two's complement and I have this coded.
Can anyone think of any reasons off the top of his/her head why I might be having these problems? (e.g. big endianness vs. little endianness?)
Regards,
Jordan
Solved! Go to Solution.
03-14-2014 02:15 PM
When you say the device that cannot work with negative commands, do you mean the third party or the PXI-8433?
Which device do you have?
03-14-2014 02:21 PM
I am certain at this point that the problem is with LabVIEW/PXI. I can restate the question as follows: If I write a byte of 254 by itself to the serial port, the correct value is written to the serial line (as indicated by Versa-Tap serial spy device from Stratus Engineering). If I write a U8 array with a value of 254 (FE) in it, the serial spy device indicates that 126 (7E) has been written to it.
This irregular behaviour only happens when I write a value over 127 as an element of an array to the VISA port. I am not sure how I could write one byte at a time to my device and have it accept it but I am looking into it right now.
BTW: I am using LabVIEW 2009 SP1.
03-14-2014 02:27 PM
If I put "ASRL End IN" and "ASRL End Out" to "none" (rather than Last bit), I can successfully write an array of bytes with a value like 254 in it. My device, however, does not seem to recognize this. The problem is with LabVIEW/PXI and not my device though - I feel fairly certain.
03-17-2014 07:23 AM
With "ASRL End Out" set to "None" rather than "Last Bit," I was able to write a byte array having values greater than 127. I consider this very unusual behaviour and I suspect that it is a bug.
I would not have been able to resolve this issue without the Versa Tap serial spy device: http://www.stratusengineering.com/VersaTap.html