CANoe Value Ranges of the Data Types

Limitation of Lengths

Object

Limitation of Length

Note

strings

Version 4.0...6.0 256 characters, previously 79 characters.

CANdb
(signal names in LDF files)

maximum: 128 characters

With longer names, only 128 characters are taken into account.*

CANdb
(environment variable names)

maximum: 80 characters

With longer names, only 80 characters are taken into account.*

CANdb
(other object names)

maximum: 32 characters

With longer names, only 32 characters are taken into account.*

names of variables/functions

maximum: 128 characters

Starting with CANoe Version 5.2.
Version 4.1-5.1 50 characters, previously 32 characters.
With longer names, only 128 characters are taken into account.

line length

Up to and including CANoe Version 4.1: when compiling from CANoe no limitation.
When compiling from the CAPL Browser, maximum 253 characters per line.

Starting with version 5.0: unlimited overall

Value Ranges

Number of bits, signed/unsigned by integral data types:

Object

Limitation in bytes

Value Range

Note

char

1 byte

-128...+127

C/C++: char

byte

1 byte

0...255

C/C++: unsigned char

int

2 bytes

-32768...+32767

C/C++: short

word

2 bytes

0...65535

C/C++: unsigned short

long

4 bytes

-2147483648
...+2147483647

C/C++: long

dword

4 bytes

0...4294967295

C/C++: unsigned long

int64

8 bytes

-9223372036854775808
...9223372036854775807

C/C++: long long

qword

8 bytes

0...
18446744073709551615 (0xffffffffffffffff)

C/C++: unsigned long long

Display of floats (64-bit IEEE-float):

Object

Limitation in bytes

Value Range

Note

double, float

8 bytes

-1.7E +/- 308
...+1.7E +/- 308

C/C++: double

Limitation of Lengths and Numbers

Object

Limitation

Note

function names in
CAPL DLLs

maximum length: 20 characters

when using
CAPL_DLL_INFO

maximum length: 50 characters

when using CAPL_DLL_INFO2 *

when using CAPL_DLL_INFO3 *

parameters in CAPL functions

maximum number: 64

Intrinsic functions and functions in CAPL DLLs.

Maximum parameter number up to and including CANoe version 8.0: 10.

databases that can be assigned to a node

unlimited number

CAPL DLLs
that can be assigned to a node

unlimited number

case in switch instructions

unlimited number

Starting with CANoe Version 6.0, previously 97.

Data Types for Variables

数据转换:

  {
  // Float32 转 U32
    float in_float = 123.456;   
    dword out_dword;   
    out_dword = interpretAsDword(in_float);    
    write("out_dword =0x%x, ",out_dword);  
  }
		
  {
      //U32 转 Float32
    dword in_dword = 0x42f6e979;  
    float out_float;
    out_float = interpretAsFloat(in_dword);    
    write("out_float =%.3f, ",out_float);  
  }
out_dword =0x42f6e979, 
out_float =123.456001, 

数据转换计算平台:

IEEE-754 Floating Point Converter

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值