LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

little endian

Dear forum members. I connect one device with RS232 port to computer. The commands of Visa Write will be " 0x01 0x80 0x58 0x84 0x0c 0x10 0x0a " (7 byte). These are Hex digits and already little endian. How can I write in Labview?  0x no need?
Can you attach the simple example... How I will operate the device with this command?
Please help me..
 
Thanks in advise..
Sincerely Harutyun Melikyan!
I used Labview 8.0. 
0 Kudos
Message 1 of 12
(5,301 Views)
Just use a string control, set it to hex display, and enter the numbers. Then send it to the serial port.
 
Little/big endian does not matter for "hex digits". Only of groups of these digits represent flattenend multibyte numbers you would need to worry about endian. Cna you better explain what you mean?
Message 2 of 12
(5,296 Views)
Command is 0x01 0x80 0x58 0x84 0x0c 0x10 0x0a, this is Hex digits 7byte.
Freq. command is 0x01
Frequency is 210.000.000 which converts HEX 0xC845880. If little indian method 0x80 0x58 0x84 0x0C
0x10 means average factor 10
and 0x0a for read the data....
 
How I will type commands using Labview?
Can you help me?
0 Kudos
Message 3 of 12
(5,290 Views)

RIght-click you "string to write" string control and select "Hex Display". Now simply enter your hex digits without any spaces and it will look as follows.

Try it! 🙂

 

Message Edited by altenbach on 09-07-2007 12:21 AM

Message 4 of 12
(5,286 Views)

Dear Altenbach I solved the problem, thank you very much.

Now have only 1 problem. I can obtain the data using "Hex Display". But need this Hex display digits convert to Decimal, I showes the example. I attach the Vi.

Can you help me?

Thanks in advise...

Best regards

Harutyun Melikyan!

0 Kudos
Message 5 of 12
(5,250 Views)
Hi,
You could try string to byte array conversion and then join hi and low, see attached picture.
 
BR /Sture
Message 6 of 12
(5,243 Views)
You are doing all this way too complicated. Just use flatten/unflatten from string. That's why we have it!
 
I think your original conversion is also wrong, because you are generating a hexadecimal formatted string instead of a binary string.
 
Most likely my code needs some modifications and tweaks, but it can point you in the right direction. You really should keep your representations straign. It does not make much sense to display a 2 byte value as I32, for example.

Message Edited by altenbach on 09-08-2007 08:00 AM

Message 7 of 12
(5,209 Views)
Dear forum members can you help me?
I attach the Vi with my questions.
 I want to obtain the "018058840CA0A" but cannot. The first 01 and the end 0A cannot obtain.
Please help me.
 
Thanks in advise.
Sincerely yours
Harutyun Melikyan!
0 Kudos
Message 8 of 12
(5,138 Views)
Sorry I did a mistake....I need " 0180 5884 0CAA ".
0 Kudos
Message 9 of 12
(5,133 Views)

You are still confusing a formatted hex string, consisting exclusively of the letters 0..F when the string indicator is set to normal display (2 characters per byte), and a binary string (consisting of possible bytes from 00 to FF, 1 character per byte)  that shows the desired pattern when set to HEX display.

You need to understand the difference and you need to know what you want. 🙂

The attached example shows both possible implementations.

Message Edited by altenbach on 09-11-2007 06:22 PM

Download All
Message 10 of 12
(5,129 Views)