When adding CDD/.pdx file in canalyzer. my vba call to capl function not working

Status
Not open for further replies.

hemantMkumar

Newbie level 1
Joined
May 13, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,304
Issue:

'no error is found while running the code.
Scenario:
'If i am not adding .pdx/.cdd file into the canalyzer configuration file[.cfg] , and i run my code i can see the function callevent in canalyzer write window as soon as on press of my vb button [MsgSend_Click]
.
but the problem arises when i add .pdx/.cdd file no msg appears in the canalyzer write window..no exception in vb also...


Things i tried:
1-> i changed the program node location to analysis branch, it worked [.pdx/.cdd added in .cfg] but here in this case i cannot perform
read data identifier things.so i cannot go with this..

Pl help.........

below is the code:



Code Visual Basic - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Public WithEvents mCANalyzerApp As CANalyzer.Application
    Public WithEvents mCANalyzerMeasurement As CANalyzer.Measurement
    Public ExternFunc As CANalyzer.CAPLFunction
 
 Private Sub MeasurementInitiated()
    
        Try
     
 
            CANalyzerCAPL.Compile(Nothing)
            ExternFunc = CANalyzerCAPL.GetFunction("samplefun")'function is defined in capl
          
        Catch ex As Exception
 
        End Try
 
 
    End Sub
 
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      
        Try
            mCANalyzerApp = New CANalyzer.Application
 
 
            mCANalyzerApp.Open("-path to .cfg", True, True)
        mCANalyzerMeasurement = mCANalyzerApp.Measurement
 
            AddHandler mCANalyzerMeasurement.OnInit, AddressOf MeasurementInitiated
 
 
 
   Catch ex As Exception
 
        End Try
 
 
    End Sub
 
 Private Sub start_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Start.Click
 
         mCANalyzerMeasurement.Start()
 
 
 
 
 
   Private Sub MsgSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MsgSend.Click
      
        Try
 
            TextBox1.Text = ExternFunc.Call()'call to capl function
      
 
 
 
        Catch ex As Exception
 
        End Try
 
 
 
    End Sub
 
 
 
 
 
**********************************CAPL code*********************************************
 
variables
{
 
}
 
 
void samplefun()
{
 
Write("Hello in capl");
 
}

 
Last edited by a moderator:

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…