LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

Re: HEX Problem

@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.

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

Re: HEX Problem

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
Message 12 of 29
(757 Views)

Re: HEX Problem

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>
Message 13 of 29
(755 Views)

Re: HEX Problem

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
Message 14 of 29
(751 Views)

Message 15 of 29
(738 Views)

Re: HEX Problem

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

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
(733 Views)

Re: HEX Problem

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
(727 Views)

Re: HEX Problem

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>
Message 18 of 29
(722 Views)

Re: HEX Problem

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
Message 19 of 29
(715 Views)

Re: HEX Problem

Assuming you want to send ASCII Hex try this:

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
Message 20 of 29
(705 Views)