为什么在TestStand 3.0 中使用Parallel 或者Batch Model 时出现数据库登录错误



主要软件:
主要软件版本: 3.0
主要软件修正版本: N/A
次要软件: N/A

问题:
有时候,当我禁止数据库记录选项和当我运行一个基于Batch model的简单序列时,会报错。我在可执行程序间共享数据链接和禁止了事务处理。我所得到的错误如下所述。在某些情况下,这些错误发生之后,TestStand 会暂停,如何修正。
  • 错误1
    An error occurred calling 'LogResults' in 'ITSDBLog' of 'DBLog 1.0 Type Library'
    An error occurred executing a statement.
    Schema: Generic Recordset (NI)
    Statement: STEP_RESULT.
    The field 'STEP_RESULT.UUT_RESULT' cannot contain a Null value because the Required property
    for this field is set to True. Enter a value in this field.
    Source: TSDBLog
    Error Code:
    -2147217887; User-defined error code.
    Location:
    Step 'Log Results to Database' of sequence 'Log To Database' in 'Database.seq'

  • 错误 2
    An error occurred calling 'LogResults' in 'ITSDBLog' of 'DBLog 1.0 Type Library'
    An error occurred executing a statement.
    Schema: Generic Recordset (NI).
    Statement: STEP_RESULT. (Can contain any table such as UUT_RESULT, NUMERIC_LIMIT etc.)
    Error Code:
    -2147352567; User-defined error code.
    Possible System Error: Exception occurred.



  • 解答:
    在TestStand 3.0中, 如果以下条件存在,数据库的记录会发生错误:
    1. 在同一时间有多于一个的程序进行数据记录。如:使用 Parallel 和 Batch  models.。
    2. 没有使能 On-The-Fly Database Logging 选项。
    3. 在Database 选项对话框中使能了 Share Datalink Between Executions 选项。
    4. 在Database 选项对话框中禁止了 Use Transaction Processing 选项。


    这是由于在同一时间两个线程使用了一个句柄导致的,这种不安全的操作就会导致上面的错误。然而,这些错误可以通过以下的方法解决。

    首先,将附件中的 DBLog.dll 文件放到 <TestStand>\Components\User\ 目录中。然后使用regsvr32.exe注册DBLog.dll 文件。可以通过以下操作完成:选择 开始»运行 并输入以下命令:
    regsvr32 C:\Program Files\National Instruments\TestStand 3.0\Components\User\DBLog.dll.

    注意: 这是假设了 TestStand 是安装在 C:\Program Files\National Instruments\TestStand 3.0下的。如果不是,请修改为你的TestStand的安装目录。


    相关链接:

    附件:


    DBLog.dll - DBLog.dllStatement.cpp - Statement.cpp


    报告日期: 03/09/2004
    最近更新: 07/10/2011
    文档编号: 36QF9H77