From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from RS485 board ASCII

Hi,
 
I am trying to read and understand data I am getting from the RS485 NI card (PXI-8431) I am using. We have a custom board that utilizes an FPGA. The FPGA is sending out an FE01(Hex) and I use a Serial read to collect the data from the 8431 Card. When I view the data in Labview it shows as a 7F80. I think this might have something to do with the ASCII format, but I am not sure. I assume the Visa Read is reading the string in an ASCII format and the conversion gets the Bytes and bits swapped around.
 
If I look at the data, at the bit level, it looks as though is some big endian, little endian swapping going on, but I am nopt absolutely sure of this. Any help would be greatly appreciated.
 
Jeff C.
0 Kudos
Message 1 of 6
(3,852 Views)
Visa is sending bytes in binary. Ascii is one represenation, hex another one and binary can also be 01010101.
What I mean is that the hex representation you use (FE01) is sent out exactly the same way as the bitpattern it represents.

What could be the ssolution to the riddle is 7 bit wit odd or even parity on one or the other side.
The way to communicate here is 8 bit no parity and see what happens.


greetings from the Netherlands
0 Kudos
Message 2 of 6
(3,841 Views)
It would seem your board is sending the bits in reverse order. If you are using the string to byte array, you can try the Rotate function in to get them in the order you expect.
0 Kudos
Message 3 of 6
(3,840 Views)
You are right Dennis

reverse byte order and so to see inverted bits
greetings from the Netherlands
0 Kudos
Message 4 of 6
(3,830 Views)
Thanks for the response guys,
 
Here is my scenario. I have a power PC that generates the message, it is then sent to our custom board that has an FPGA which in turn sends it out on a 422 transciever chip.
I did some research this weekend and discovered that the power PC uses big endian and the INTEL chip uses liitle endian when dealing with messages so I think this is where the byte swapping is happening.
I am going to try the byte swap that you guys have suggested and see if that helps.
 
Thanks,
Jeff C
0 Kudos
Message 5 of 6
(3,793 Views)
It's a bit swap like this.
0 Kudos
Message 6 of 6
(3,787 Views)