Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to transmit 64 bit Hex config commands in aspect 1

Status
Not open for further replies.

PaulSandhu

Technical User
Jul 12, 2011
2
0
0
GB
Hi

I am trying to transmit a bit 64 config command in Hex, I have tried transmit [RAW], $txdata, strfmt commands but I think aspect is changing the Hex string before it transmits the Hex. The Hex command is shown below, I just need a point in the right direction, as I don't have much experience with aspect.

00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF
00 00 00 01 00 3C 18 00 2C 01 3C 1E 00 03 00 00
00 00 06 00 3C 0A 01 00 00 00 01 00 00 00 01 00

Many Thanks
 
Do you have all of that in one string, or do you have individual bytes in an integer variable one byte at a time? If the former, I saw this script in the ASPECT help file that should do the trick. If the formatting comes out wonky, check out the strgetc command in the ASPECT help file to see the original.

proc main
integer Pos = 0 ; Integer index within string.
integer Chr = -1 ; Character from string.
string TextStr ; String to get characters from.
string HexStr = "" ; String to contain hex values.
string Hex ; String used for hex conversion.

TextStr = "Add these characters!" ; Assign text to string.
while Chr != 0 ; Loop while character not null.

strgetc TextStr Pos Chr ; Get character from string.
strfmt Hex "%02X " Chr ; Convert character to hex.
strcat HexStr Hex ; Add char to string of hex values.
Pos++ ; Increment index within string.
endwhile
usermsg HexStr ; Display newly created hex string.
endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top