Example – Kontron KTLX800-pITX User Manual

Page 29

Advertising
background image

KTD-S0023-A

Page 26

JIDA32 Interface


KTLX800/pITX Software Guide

8.8.3

Program Language VISUAL BASIC (VB.NET)

The demo program shows the board count value and activates the watchdog (timeout = 10 seconds).

Example:

Public Class JidaTest

Declare Auto Function JidaDllInitialize Lib "JIDA.DLL" () As Boolean

Declare Auto Function JidaDllUninitialize Lib "JIDA.DLL" () As Boolean

Declare Auto Function JidaDllIsAvailable Lib "JIDA.DLL" () As Boolean

Declare Auto Function JidaBoardCount Lib "JIDA.DLL" _

(ByVal classstr As String, ByVal flags As UInteger) As UInteger

Declare Auto Function JidaBoardOpen Lib "JIDA.DLL" _

(ByVal classstr As String, ByVal num As UInteger, ByVal flags As UInteger, _

ByRef handle As UInteger) As Boolean

Declare Auto Function JidaBoardClose Lib "JIDA.DLL" (ByVal handle As UInteger) As Boolean

Declare Auto Function JidaWDogSetConfig Lib "JIDA.DLL" (ByVal handle As UInteger, _

ByVal type As UInteger, ByVal timeout As UInteger, ByVal delay As UInteger, _

ByVal mode As UInteger) As Boolean


Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Const JIDA_BOARD_CLASS_CPU = "CPU"

Const JIDA_BOARD_OPEN_FLAGS_PRIMARYONLY = 1

Const JIDA_BOARDINFO_FLAGS_DEFAULT = 0

Const TIMEOUT_VALUE = 10000

Const DELAY_VALUE = 0

'Delay not supported

Const REBOOT_BOARD = 0

'NMI not supported

Dim handle As UInteger

If JidaDllInitialize() Then

If JidaDllIsAvailable() Then

If

JidaBoardOpen(JIDA_BOARD_CLASS_CPU,

0, JIDA_BOARDINFO_FLAGS_DEFAULT, handle) Then

MsgBox("BoardCount = " & JidaBoardCount(JIDA_BOARD_CLASS_CPU, _

JIDA_BOARD_OPEN_FLAGS_PRIMARYONLY))

JidaWDogSetConfig(handle, 0, TIMEOUT_VALUE, DELAY_VALUE, REBOOT_BOARD)

JidaBoardClose(handle)

End If

End

If

JidaDllUninitialize()

End

If

End

Sub

End Class



Advertising
This manual is related to the following products: