简体   繁体   中英

How to assign a CHAR Array to a SIGNAL (64 Bits) in CAPL script (CANOE)

How do I assign a CHAR ARRAY (8 Bytes) into a SIGNAL (64 Bits) in CAPL script?

Convert array to 64-bit variable minding the endianness.

Here's an example code:

qword value;
value = 0;
for(i = 0; i < 8; i++)
{
    value = value | (qword)array[i] << (8* (7 - i));
}

Due to the fact the signals longer than 52 bits in CAPL may cause some data loss in order to assign the converted value by using raw64 property.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM