PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI-8433 Transmitting Negative Numbers

Solved!
Go to solution

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

Jordan McBain, PhD
LabVIEW Controls Engineer
Revolutionary Engineering
0 Kudos
Message 1 of 5
(5,658 Views)

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?

0 Kudos
Message 2 of 5
(5,635 Views)

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.

Jordan McBain, PhD
LabVIEW Controls Engineer
Revolutionary Engineering
0 Kudos
Message 3 of 5
(5,632 Views)

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.

Jordan McBain, PhD
LabVIEW Controls Engineer
Revolutionary Engineering
0 Kudos
Message 4 of 5
(5,630 Views)
Solution
Accepted by topic author JordanJMcBain

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

 

 

Jordan McBain, PhD
LabVIEW Controls Engineer
Revolutionary Engineering
0 Kudos
Message 5 of 5
(5,601 Views)