Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

CCP How to read more signals defined at the same address

Hello,

 

I have an a2l file with characteristics.

At a certain adress I have defined a signal called X of uint8 datatype.

At the same address I have defined others signals of type uint(1) named A, uint (1,1) named B, uint (1,2) named C... and so on till uint(1,6). Basically could be flags of an array of bits.

How can I read based on the signal name (A, B, C) only the coresponding value and not the full size which I got now, e.g. read only signal B which is one bit from all uint.

 

Thanks in advance,

Vincent

0 Kudos
Message 1 of 9
(8,764 Views)

Hello Vincent,

 

To get a clearer picture of how you are reading this file in LabVIEW so that we can help, could you post your code? Or even a screen shot and also one of the result string as well as an example of what you want the read string to be.

 

Thanks,

National Instruments
0 Kudos
Message 2 of 9
(8,726 Views)

I am using the ECU MC's toolkit "MC Characteristic Read.vi" the DBL output, to which I provide the name of the Characteristic defined in the A2L database.

 

code.PNG

 

The characteriscs which are defined in the a2l file at the same addres are identified by some bitmasks:

 


    /begin CHARACTERISTIC X "X comment"
      VALUE 0x8001912 __UBYTE 0 CNV_FN2  0 255
      ECU_ADDRESS_EXTENSION 0x0
      EXTENDED_LIMITS 0 255
      BIT_MASK 0xFF
      FORMAT "%.3"
      /begin IF_DATA CANAPE_EXT
        100
        DISPLAY 0 0 255
      /end IF_DATA
    /end CHARACTERISTIC

    /begin CHARACTERISTIC A "A comment"
      VALUE 0x8001912 __UBYTE 0 CNV_FN2  0 255
      ECU_ADDRESS_EXTENSION 0x0
      EXTENDED_LIMITS 0 255
      BIT_MASK 0x1
      FORMAT "%.3"
      /begin IF_DATA CANAPE_EXT
        100
        DISPLAY 0 0 255
      /end IF_DATA
    /end CHARACTERISTIC

    /begin CHARACTERISTIC B "B comment"
      VALUE 0x8001912 __UBYTE 0 CNV_FN2  0 255
      ECU_ADDRESS_EXTENSION 0x0
      EXTENDED_LIMITS 0 255
      BIT_MASK 0x8
      FORMAT "%.3"
      /begin IF_DATA CANAPE_EXT
        100
        DISPLAY 0 0 255
      /end IF_DATA
    /end CHARACTERISTIC

    /begin CHARACTERISTIC C "C comment"
      VALUE 0x8001912 __UBYTE 0 CNV_FN2  0 255
      ECU_ADDRESS_EXTENSION 0x0
      EXTENDED_LIMITS 0 255
      BIT_MASK 0x4
      FORMAT "%.3"
      /begin IF_DATA CANAPE_EXT
        100
        DISPLAY 0 0 255
      /end IF_DATA
    /end CHARACTERISTIC

    /begin CHARACTERISTIC D "D comment"
      VALUE 0x8001912 __UBYTE 0 CNV_FN2  0 255
      ECU_ADDRESS_EXTENSION 0x0
      EXTENDED_LIMITS 0 255
      BIT_MASK 0x2
      FORMAT "%.3"
      /begin IF_DATA CANAPE_EXT
        100
        DISPLAY 0 0 255
      /end IF_DATA
    /end CHARACTERISTIC

    /begin CHARACTERISTIC E "E comment"
      VALUE 0x8001912 __UBYTE 0 CNV_FN2  0 255
      ECU_ADDRESS_EXTENSION 0x0
      EXTENDED_LIMITS 0 255
      BIT_MASK 0x40
      FORMAT "%.3"
      /begin IF_DATA CANAPE_EXT
        100
        DISPLAY 0 0 255
      /end IF_DATA
    /end CHARACTERISTIC

    /begin CHARACTERISTIC F "F comment"
      VALUE 0x8001912 __UBYTE 0 CNV_FN2  0 255
      ECU_ADDRESS_EXTENSION 0x0
      EXTENDED_LIMITS 0 255
      BIT_MASK 0x20
      FORMAT "%.3"
      /begin IF_DATA CANAPE_EXT
        100
        DISPLAY 0 0 255
      /end IF_DATA
    /end CHARACTERISTIC

    /begin CHARACTERISTIC G "G comment"
      VALUE 0x8001912 __UBYTE 0 CNV_FN2  0 255
      ECU_ADDRESS_EXTENSION 0x0
      EXTENDED_LIMITS 0 255
      BIT_MASK 0x10
      FORMAT "%.3"
      /begin IF_DATA CANAPE_EXT
        100
        DISPLAY 0 0 255
      /end IF_DATA
    /end CHARACTERISTIC

    /begin CHARACTERISTIC H "H comment"
      VALUE 0x8001912 __UBYTE 0 CNV_FN2  0 255
      ECU_ADDRESS_EXTENSION 0x0
      EXTENDED_LIMITS 0 255
      BIT_MASK 0x80
      FORMAT "%.3"
      /begin IF_DATA CANAPE_EXT
        100
        DISPLAY 0 0 255
      /end IF_DATA
    /end CHARACTERISTIC

 

Is there a Vi which read the characteristics considering this bitmasks?

 

Thanks and regards,

Vincent

0 Kudos
Message 3 of 9
(8,714 Views)

What I forgot to say previous...

 

If I provide to signal name the  B for example I have as result the value of  X provided ok, but not what I am expecting, a value dependent of the predefined bitmasks...

0 Kudos
Message 4 of 9
(8,710 Views)

Problem still not solved on my system

Any help is highly apreciated....

 

Vincent

0 Kudos
Message 5 of 9
(8,600 Views)

Hi Vincent,

 

You are correct.  When you read the characteristic B, you should get data from the applied bit mask, not the same value as X. 

 

Example:

Value to be masked     BIT_MASK         Result
10110110                    0x1 = 1 (bin)         0 (bin)
10110110                    0x2 = 10 (bin)        1 (bin)
10110110                    0x6 = 110 (bin)     11 (bin)

 

The toolkit's behavior is wrong.  A Corrective Action Request (#254903) has been filed so the issue may be fixed in the next release of the toolkit.  I apologize for the inconvenience. 

O. Proulx
National Instruments
www.ni.com/support
0 Kudos
Message 6 of 9
(8,591 Views)

Thansk for reply and for the info,

 

Do you know when it is scheduled the next release of the toolkit with this CR included?

 

Regards,

Vincent

0 Kudos
Message 7 of 9
(8,564 Views)

Hello ,

 

Is there any new update?

 

Thanks for the answer and regards,

Vincent

0 Kudos
Message 8 of 9
(8,130 Views)

The next release of the ECU MC Toolkit is scheduled for Q3 2011.

 

If you would need a beta version sooner please let us know and contact us by email under

 

canpse@ni.com

 

Thanks

Roland

0 Kudos
Message 9 of 9
(8,128 Views)