From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in display of HEX

Solved!
Go to solution

I have send a hex code as shown in diagram.By the output I am getting in array Is coming out as shown.I want the output also to be displayed in HEX (ie same format as i have send ).What is the error.?

please help... 

0 Kudos
Message 1 of 9
(3,596 Views)
You need to change the radix of the display to hexidecimal.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 9
(3,577 Views)

Hi Mike, 

After i changed the radix to hexadecimal, This is what I am getting ie a shifted pattern.

0 Kudos
Message 3 of 9
(3,564 Views)
Good! -- or is this not what you expected?

Mike. .

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 9
(3,545 Views)

Why is the element 'CA' is 1st in output whereas I send it last in input..

Thanks 

0 Kudos
Message 5 of 9
(3,539 Views)
Solution
Accepted by topic author archit0392

Is it returning the data from a previous execution? If you somehow wrote more data than (I'm assuming it's a loopback) you're reading then you will have items in your serial buffer that will remain until you either flush the buffer or read them all out (which won't happen if you write and then read 8 bytes every time).

 

You can try the 'get bytes at port' property node to see how many items are in the serial buffer.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 6 of 9
(3,534 Views)

Thanks sam.

I used a property node(no of bytes) before VISA read and got the exact data. 

0 Kudos
Message 7 of 9
(3,513 Views)

Did you use the output of the node to define how many bytes you are reading?

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 9
(3,502 Views)

1. You should probably flush the VISA buffer right after you configure the port (before the loop).  This will make sure there is not any data left in the buffer from a previous run.

2. If you know how many bytes are in your message to read, read that many bytes.  Using the Bytes At Port can introduce some interesting race conditions or cause you to insert a lot of delay that is not necessary.

3. I highly recommend showing your radix on numerics, especially if they are not using the normal display.  This help eliminate a lot of confusion.  "I am sending you 10."  "Then why am I seeing 16?  Are you in decimal or hex?" (actual conversation)


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 9
(3,477 Views)