Hallo,
I am trying to figure out, how to simulate "Master_Zaehler" field in LIN frame. It means a value that goes from 0 to 15 and is incremeted after sending each message.
Is this possibility in PLIN-View Pro?
I am trying to use the schedule table and define the frame 16 times, but still could not figure out the way how to define the frame content in schedule table...
Thanks in advance for the help!
Ota
Master_Zaehler
Re: Master_Zaehler
Hello,
With a VB script you can control some functions of the PLIN-View Pro.
With that you can manage rolling counting yourself.
Here is a simple example to send a rolling counter:
More information about VB script support you can find it in the online help of the PLIN-View Pro.
Regards
M.Riedl
With a VB script you can control some functions of the PLIN-View Pro.
With that you can manage rolling counting yourself.
Here is a simple example to send a rolling counter:
Code: Select all
' Enumeration PLIN Mardware Mode
const plinHardwareModeNone = 0
const plinHardwareModeSlave = 1
const plinHardwareModeMaster = 2
' Enumeration PLIN Direction
const plinDirectionDisabled = 0
const plinDirectionPublisher = 1
const plinDirectionSubscriber = 2
const plinDirectionSubscriberAutoLength = 3
' Enumeration PLIN Checksum Type
const plinChecksumTypeClassic = 1
const plinChecksumTypeEnhanced = 2
const plinChecksumTypeAutomatic = 3
Dim appObj
Set appObj = CreateObject("Peak.Lin.ViewPro.COM.Interfaces.Application")
If Not appObj Is Nothing Then
WScript.Sleep 100
' Connect to a LIN hardware
' =============================================
' 1. Parameter: Device
' 2. Parameter: Channel
' 3. Parameter: Mode
' 4. Parameter: Bit rate
If appObj.ConnectTo(1, 1, plinHardwareModeMaster, 19200) Then
For i = 0 To 15 Step 1
' Publish Frame Data
' =============================
' 1. Parameter: ID
' 2. Parameter: Length
' 3. Parameter: Checksum Type
' 4. Parameter: Data
If Not appObj.PublishData(0, 8, plinChecksumTypeEnhanced, Array(i And &hFF, &h00, &h00, &h00, &h00, &h00, &h00, &h00)) Then
MsgBox "Error on publish Frame with ID 0"
End If
appObj.Wait 50
Next
Else
MsgBox "LIN is NOT connected"
End If
If MsgBox ("Close Application?", vbYesNo, "Rolling Counter Script") = vbYes Then
appObj.Close false
End If
Set appObj = Nothing
End If
M.Riedl