05-25-2012 03:58 AM
Hi,
I'm completely new to Labview and I'm working on a project that includes controlling CANalyzer from LabView by an ActiveX control.
In CANalyzer I have a CAPL function that I need to call from LV. The problem is that the function must be created in the onInit event when starting a canalyzer measurement. The only way I have found to create the function is to use a "reg event call back" and create the function in a "static vi reference". This works and I can call the funtion from that vi, but I'm not able to call the function from anywhere else but from the "static vi reference" and since it must be strictly typed I can not add any output connector where I can add a reference.
I've been trying to solve this for thee days now and it's starting to feel hope less.
In VB the complete code would look something like:
Dim WithEvents gCANApp As CANalyzer.Application
Dim WithEvents gMeasurement As CANalyzer.Measurement
Dim gSendFunction As CANalyzer.CAPLFunction
Dim Y
Set gCANApp = New CANalyzer.Application
gCANApp.Open ("C:\...xxxx.cfg")
Set gMeasurement = gCANApp.Measurement
gMeasurement.Start
gSendFunction.Call
'Measurement OnInit event handler
Private Sub gMeasurement_OnInit()
Set gSendFunction = gCANApp.CAPL.GetFunction("MyFunction")
End Sub
This would work fine since I have a reference to gSendFunction in my main code.
My LV code looks like this:
and my static vi ref looks like this:
What I think I need is a reference to the data thread coming from "GetFunction"
If any one can help me solve this I would be very happy!
Best Regards
Henrik
06-26-2012 08:34 AM
Hi,
you could add another input to your static vi ref where you input the reference to a reference display element which sits in your other vi (upper image).
Then you could make a signaling value change to the reference display element from within your static vi ref.
In your other vi set up an event structure to detect the value change. In that event close the vi - this will let you have the desired reference as output of that vi.
Regards Florian
01-25-2013 06:14 AM
Hi Henrik,
Im also trying to access the CANoe CAPL function from the Labview but i struggling to do that. I done for remaining Signal read, EV read/write and all now i am struggling to access the CAPL. if you found any approach please share.
Thanks in Advance,
Kalanga