Windows® Compatible Software for Displaying LIN Messages


Postby otahh » Sun 2. Dec 2018, 17:28

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!
Posts: 1
Joined: Sun 2. Dec 2018, 17:22

Re: Master_Zaehler

Postby M.Riedl » Mon 3. Dec 2018, 12:02


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
      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

More information about VB script support you can find it in the online help of the PLIN-View Pro.
PLinViewProVBScriptHelp.JPG (94.51 KiB) Viewed 320 times

User avatar
Software Development
Software Development
Posts: 13
Joined: Wed 22. Sep 2010, 12:28

Return to PLIN-View Pro

This website uses cookies for analytics, for logins to the online shop and the forum, and for the handling of an order. By browsing this website you agree to the use of cookies. Detailed information on their use can be found in our privacy policy.

OKPrivacy Policy