Vector CANOE VT2516A配置详解

Vector CANoe CAPL系列相关文章导览,下面链接可直接跳转

Vector CANoe VT System系列板卡文章导览,下面链接可直接跳转

引言

本章节继续聊VT2516A数字板卡的功能,板卡详细内容见VT_System_Manual_EN.pdf,内容为个人理解,如有错误,欢迎指正

The Digital Module VT2516A is connected to up to 16 mainly digitally used inputs and outputs of an ECU. Mainly digitally used means that the signals have two states. In real in-vehicle operation actuators like signal lamps or sensors like switches are connected to these ECU I/Os.

The VT2516A provides several features to check the ECU behavior regarding these ECU inputs/outputs:

  • For ECU output:
    • Measurement of the digital ECU output signal (incl. PWM) and the ECU output voltage
    • Simulation of the actuator load by an externally mounted load (e.g. a resistor)
  • FOr ECU input:
    • Sensor simulation by output of a digital or PWM signal with defined high/low level
    • Sensor simulation by switching the ECU line to ECU ground or V b a t t V_{batt} Vbatt
  • Relays to connect the ECU input or output to the original sensor or actuator
  • Relays to generate electrical errors like disconnection of ECU lines (“open load, broken wire”)

好长一段内容,说的啥呢

  1. VT2516A板卡总共有16个数字型输入/输出通道,注意是单端信号
  2. 支持PWM测量和输入信号的电压测量
  3. 输出数字、PWM信号模拟传感器;将ECU引脚短接到地、电源模拟传感器。
  4. 通过继电器控制ECU输入输出,传感器和执行器的通断。
  5. 通过继电器制造电器故障,如断开负载,线路开路。
  6. 通过继电器接入真实负载/传感器
  7. 通过继电器接入模拟上拉或下拉电阻工况

VT2516A FPGA

手上暂时没有这个可编程板卡,等遇到了再补充

前后面板图

front

Usage

Basic Connection Scheme

Connecting the ECU

手册里面讲了很多典型应用场景

注意接线的时候是接在ECU侧的

Signal Path Switching

Signal Path Switching

左侧对应ECU,中间是通过继电器切换的几种功能,右侧是可以实现的功能,如测量PWM、电压,输出电压,输出PWM。图很清晰,可以自己研究一下。

Bus Bars

Bus Bars

由于是单端信号,line b通过一个继电器切换到 V b a t t V_{batt} Vbatt或者GND

Measuring the Digital Input Signal

测量数字输入信号

采样频率为50us,具体信号操作对应在CANoe中的系统变量,后面会介绍到。

Voltage Measurement

测量区间 -40V ~ +40V, 后面会介绍详细参数

测量电压信号,具体信号操作对应在CANoe中的系统变量,后面会介绍到。

Outputting a Digital Signal

输出数字信号,高低电平,PWM信号等,具体信号操作对应在CANoe中的系统变量,后面会介绍到。

Load or Pull-up/down Resistor

接入真实负载(如接个LED),模拟上拉或下拉电阻。

接插件定义

手册5.4章节

Technical Data VT2516A

手册中都有,这里再贴一下

General

General

Input Signals and Switches

Input Signals and Switches

Digital Input

Digital Input

PWM Measurement

PWM Measurement

Voltage Measurement

Voltage Measurement

测量电压的精度取决于两个部分(值的百分比 + 偏移)

例如,如果测量电压为 -5 V,则精度为 ±175 mV(5V的 0.5 % + 150 mV)。

Digital Output

Digital Output

PWM Generation

PWM Generation

CAPL实例

VT System Configuration

连接板卡,不知道咋操作的,看这里里面有详细说明

VT System Configuration

VT System Control

VT System Control

Output settings通过CAPL脚本来控制

type

CAPL函数库

Functions

(搜索这个文件CAPLfunctionsVTSystemOverview.htm,有详细介绍,包括函数使用示例等)

System Variables

system-defined

system-defined

创建variables

根据需要创建如下variables以便于后续panel和capl进行调用

user-defined

制作Panel

panel

  • 数字量电压输出
  • PWM输出
  • 电压采集
  • PWM采集

编写CAPL脚本

输出模式枚举

variables
{
  // Defines the modes in which each channel can be
  enum VT2516Modes { None, DigitalOut, PWMGenerator };

  // Stores the mode in which each channel is
  enum VT2516Modes VT2516Ch1Mode = None;
  enum VT2516Modes VT2516Ch2Mode = None;
  enum VT2516Modes VT2516Ch3Mode = None;
  enum VT2516Modes VT2516Ch4Mode = None;

  // Used to refresh measurement values
  msTimer refreshTimer;
}

控制输出模式

switchModeVT2516 ( int channel, enum VT2516Modes mode )
{
    if( channel == 1 )
    {
        if( VT2516Ch1Mode != mode )
        {
            VT2516Ch1Mode = mode;
            if( mode == DigitalOut )
            {
                // Configure VT module channel as a digital output generator
                // See the CANoe help for details
                sysvar::VTS::Digital_Ch1.SetPWMVoltageHigh (5.0);
                sysvar::VTS::Digital_Ch1.SetPWMVoltageLow (0.0);
                sysvar::VTS::Digital_Ch1.SetCurveType (0);
                sysvar::VTS::Digital_Ch1.SetStimulationMode (1);
            }
            else if( mode == PWMGenerator )
            {
                // Configure VT module channel as a PWM generator
                // See the CANoe help for details
                sysvar::VTS::Digital_Ch1.StopStimulation();
                sysvar::VTS::Digital_Ch1.SetStimulationMode(1);
                sysvar::VTS::Digital_Ch1.SetCurveType(1);
                sysvar::VTS::Digital_Ch1.SetPWMVoltageLow(0.0);
                sysvar::VTS::Digital_Ch1.SetPWMVoltageHigh(5.0);
                sysvar::VTS::Digital_Ch1.SetPWMRepeats(0);
                sysvar::VTS::Digital_Ch1.StartStimulation();
                @sysvar::VTS::Digital_Ch1::PWMOutputDC = 40;
                @sysvar::VT2516::Ch1_DigitalOut = 0;
            }//end if
        }//end if
    }
    else if (channel == 2)
    {
        // add code ...
    }
}

Go to PWM output mode

on sysvar sysvar::VT2516::Ch1_Frequency
{
  // Enable PWM
  @sysvar::VT2516::Ch1_PWMActive = 1;

  // Go to PWM output mode on this channel (switchMode function handles the VT configuration change)
  switchModeVT2516( 1, PWMGenerator );
  // Send setting from the panel to the VT module
  @sysvar::VTS::Digital_Ch1::PWMOutputFreq  = @sysvar::VT2516::Ch1_Frequency;
}

// Enable PWM
on sysvar sysvar::VT2516::Ch1_PWMActive
{
  if( @sysvar::VT2516::Ch1_PWMActive == 1 )
  {
    switchModeVT2516( 1, None );
    switchModeVT2516( 1, PWMGenerator );

  }
  else
    sysvar::VTS::Digital_Ch1.StopStimulation();
}

Go to digital output mode

on sysvar sysvar::VT2516::Ch1_DigitalOut
{
  // Go to digital output mode on this channel (switchMode function handles the VT configuration change)
  switchModeVT2516( 1, DigitalOut );
  // Send setting from the panel to the VT module
  @sysvar::VTS::Digital_Ch1::DigitalOutput  = @sysvar::VT2516::Ch1_DigitalOut;

  // Disable PWM
  @sysvar::VT2516::Ch1_PWMActive = 0;
}

Read value and display on the panel

在timer里面调用或者根据需要采用其他方式

void readValueFromVT2516()
{
    /* Read the current voltage value and store it in the
    // corresponding system variable to display it in the panel.
    */

    @sysvar::VT2516::Ch1_Voltage = @sysvar::VTS::Digital_Ch1::Cur;

    /* Read the current frequency value and store it in the
    // corresponding system variable to display it in the panel.
    */
    @sysvar::VT2516::Ch1_PWM = @sysvar::VTS::Digital_Ch1::PWMFreq;

    // add code ...
}

编译返回canoe主界面测试,在测试前请先确认接线!!!

项目实例

根据实际工况进行处理,不外乎上面的几种情况,只是和具体项目上的信号功能对应,有些可能是急停信号,碰撞信号,高压互锁输入,高压互锁输出,U/V/W三相PWM等等,如有问题,请关注,点赞,收藏,后台私信~~~

当前使用场景也比较单一,文中可能有部分内容未提及,或有误,请指出,谢谢!


公众号

欢迎关注公众号,加入专业技术交流。

公众号

  • 22
    点赞
  • 29
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
### 回答1: Vector Canoe是一款领先的CAN总线分析软件,它可以高效地诊断CAN总线上的通讯问题,并提供一些实用的功能,例如实时数据采集、监视和仿真等。 对于Vector Canoe上位机的官方例程,首先需要明确的是,这些例程主要提供了一些基础的功能和操作指南,以帮助用户快速上手和使用这款软件。 例如,官方例程中提供了一些CAN通信的基础概念和操作方法,例如如何建立一个CAN总线网络、如何发送和接收CAN报文、如何配置和设置CAN总线的参数等等。这些内容对于初学者而言非常重要,可以帮助他们快速理解CAN通信的工作原理和应用场景。 此外,Vector Canoe上位机的官方例程还提供了一些实际案例和应用,例如如何使用Canoe分析工具查找故障、如何诊断设备的CAN通信问题等等。这些案例可以帮助用户更好地了解Canoe的实际应用和使用方法,从而更好地应用这款软件进行CAN通信分析和诊断。 总之,Vector Canoe上位机官方例程对于使用这款软件的用户而言是非常有用的,它提供了一些实用的功能和操作指南,可以帮助用户更好地理解CAN通信的工作原理和应用场景,并掌握Canoe工具的应用方法和技巧。 ### 回答2: vector canoe是一种用于开发CAN总线应用的工具,通过与上位机相连,可以对CAN总线进行调试、诊断和监测。vector canoe上位机官方例程是vector官方提供的一种示例代码,旨在帮助开发者更快地学习和掌握使用vector canoe的方法。 vector canoe上位机官方例程主要包括两个方面的内容,一是基本的CAN通信程序,包括初始化CAN总线、发送和接收CAN数据帧等功能;二是实现进一步的CAN数据处理和分析,例如过滤和解析CAN数据、显示CAN数据的状态和参数等。 在使用官方例程的过程中,首先需要对vector canoe及其相关的开发环境进行搭建和配置,包括安装Canoe Development Kit(CDK)、配置CAN总线连接、设置CANoe工程等。然后,运行例程程序,可以通过CANoe界面对CAN总线进行实时的监测和调试,同时也可以根据需求对程序进行修改和扩展。 通过学习和使用vector canoe上位机官方例程,开发者可以更加深入理解CAN总线的工作原理和应用场景,并可以快速上手使用vector canoe进行CAN应用的开发和调试工作。同时,官方例程也为开发者提供了一个可靠的参考模板,可以根据具体需求进行灵活的调整和扩展,以满足不同CAN应用的需求。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

diagCar

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值