LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HEX Problem

Solved!
Go to solution

@Detox92 wrote:

38 3832 34 as my data to send is incorrect  im trying to send 8624 and it sends 3836 3234  instead (the ASCII version being converted to HEX i presume.)



Change your Number to Hex String to a Typce Cast.


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 11 of 29
(862 Views)

Can you please post your code so I can see what you're doing?  I really think you're making things harder by using codes display or hex display as they show what is being sent in a less understandable fasion.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 12 of 29
(859 Views)

Yep, you are converting your number to a hexadecimal string, i.e., sending out the hex characters for "8","6","2","4". You want to typecast it (under Numeric->Data Manipulation). Use a string constant (any string) for data type. You won't see "8624", but "5618" because this is the hex version. If you really want to send "8624" then you multiply your original number (MHz) by 16, instead of 10.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 13 of 29
(857 Views)

I think we're all making things harder than they are.  A simple string containing the characters you want should do the job.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 14 of 29
(853 Views)

Code Added 

0 Kudos
Message 15 of 29
(840 Views)

You forgot to replace that "convert number to hexadecimal string" to with "typecast":

 

typecast.png

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
Message 16 of 29
(835 Views)

I'm not sure that's the problem.  I think the problem comes where you split the hex string into 2 parts and add a 0 if needed.  You're switching the noorder of the string and adding the 0 to the wrong part.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
Message 17 of 29
(829 Views)

Oh, I didn't notice that split string fork. Throw all that out.

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 18 of 29
(824 Views)

Also, your string constants are in hex display instead of normal display.  What are you trying to send?  Do you need to send ASCII Hex or numeric values?  If ASCII Hex this won't work because what you see is not what you get because of the display setting of your string constants.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 19 of 29
(817 Views)

Assuming you want to send ASCII Hex try this:

 

Hex Data.png

 

The string constants are set to NORMAL display.  The upper one has a space at the end, the lower one has a space at the beginning.

The TRUE case is just wired straight through.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 20 of 29
(807 Views)