Support Note

 
       
   

How to use different DRVcan modes from a CAPL program

Here's an example of how to set a DRVcan 1053 to standby mode.

variables {
}
on key ’2’
{
    write ("CAN1 lowspeed: normal");
    setPortBits (0x01);
}
on key ’1’
{
    write ("CAN1 lowspeed: standby");
    setPortBits (0x02);
}
on key ’3’
{
    write ("CAN2 lowspeed: standby");
    setPortBits (0x08);
}
on key ’4’
{
    write ("CAN2 lowspeed: normal");
    setPortBits (0x04);
}

And here's an example of how to send WAKEUP signals using a DRVcan-S.

variables {
    // port settings for the transceiver CAN1 in HiVolt mode
    const dword HiVoltCan1=0x0d;
    // port settings for the transceiver CAN2 in HiVolt mode
    const dword HiVoltCan2=0x07;
    dword HiVoltCan;
    const dword NormalCan=0x0f;
    message 0x100 mHLVW ={DLC =0};
}
on start
{
    // set, if single wire CANcab is connected to CAN1.
    HiVoltCan = HiVoltCan1;
    mHLVW.CAN=1;
    // set, if single wire CANcab is connected to CAN2.
    //HiVoltCan = HiVoltCan2;
    //mHLVW.CAN=2;
}
on key ’w’
{
    // switch transceiver in High Level Voltage Wake up
    setPortBits(HiVoltCan);
    output(mHLVW);
    // after sending the wake up message, the transceiver
    // is switched to normal mode.
    setPortBits(NormalCan);
}
on message *
{
   output(this);
}

      
 

 

 

Back to Technical Notes index

 
 
 


© Kvaser AB - All rights reserved | Contact us | Webmaster | Sitemap
Direct link to this page: