キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

unsigned bytes

解決済み
解決策を見る

Hello All,

 

i have a 3 different strings of Ascii  which i want to convert into Hex with a Checksum,

 

however i think i have gone wrong somewhere,

 

if i have one of my strings as a U8 and the others as U16 and U32 my byte array will not add the elements together, unless i

 

make all of them them a U32 (which i dont want) as i will have extra 0s padding my string, when i put them together

 

can someone help me with this please.

 

Thanks in advance

 

Thomas

0 件の賞賛
メッセージ1/12
5,677件の閲覧回数

Hi Thomas,

 

you really should attach an example of your "strings having them as U8/U16/U32". No idea what you're talking about...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ2/12
5,676件の閲覧回数

Post your VI friend (2011) with your required input.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 件の賞賛
メッセージ3/12
5,672件の閲覧回数

on the front panel i have Addr Data and command Data needs to be of a variable length however read/write only needs to be a Unsigned 8 i dont want any zeros in the concatnated string but when if i do this i can bnot add the elements in the array for the checksum

0 件の賞賛
メッセージ4/12
5,667件の閲覧回数

also i know there are  alot of things that dont need to be there they are only there for my purposes only and will be remove one i have it working!!

 

0 件の賞賛
メッセージ5/12
5,663件の閲覧回数

Hi Thomas,

 

can you also give some typical data?

 

It doesn't seem to be useful to typecast some strings to convert them back to strings to again convert them to an array of numbers to decimate that array. Seems not useful at all...

 

So we need:

- typical data for "addr", "status" and "Data"

- result needed for those data

- formula for your checksum calculation

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ6/12
5,661件の閲覧回数

addr ="xxxx"

data= is variable length

status= 4 Ascii caracters

read/write=r or w

checksum= sum of all above in hex or with 80hex

0 件の賞賛
メッセージ7/12
5,653件の閲覧回数

checksum= sum of all above ORed with 80hex

0 件の賞賛
メッセージ8/12
5,652件の閲覧回数
解決策
トピック作成者thomasd6が受理

Hi Thomas,

 

you have been asked to provide some real data and the needed output, but have failed to...

 

Just a rough sketch:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
メッセージ9/12
5,643件の閲覧回数

thanks GerdW  one quick question i see that you ff anded with the result could you explain that to me please,

 

it works like a dream!! i didnt even know that i had a add array element function 

0 件の賞賛
メッセージ10/12
5,636件の閲覧回数