Display CAN Signals on Instrument Panel

Comprehensive CAN monitor for Windows® and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
akanti
Posts: 4
Joined: Fri 19. May 2017, 04:13

Display CAN Signals on Instrument Panel

Post by akanti » Fri 19. May 2017, 04:20

Hello,

I am trying to display certain signals that are visible in the Receive/Transmit tab in a Text Box like object on the Instrument Panel. The signal should only be displayed if it has a certain value.

Is this possible with the existing features?

Thanks!

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Display CAN Signals on Instrument Panel

Post by PEAK-Support » Fri 19. May 2017, 11:44

at the moment you could not hide/show a control via script. This is a feature that comes only in the PCAN-Explorer 6 Version within the next weeks. You could try to set the x/y position depending on the signal to a negative value, so that the control is out off the view if the signal is not valid. Problem is, that you also do not see the control in Design mode! A second solution could be the using of the scene feature - but this enable / disable always a complete panel.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

akanti
Posts: 4
Joined: Fri 19. May 2017, 04:13

Re: Display CAN Signals on Instrument Panel

Post by akanti » Fri 19. May 2017, 19:21

U.Wilhelm wrote:at the moment you could not hide/show a control via script. This is a feature that comes only in the PCAN-Explorer 6 Version within the next weeks. You could try to set the x/y position depending on the signal to a negative value, so that the control is out off the view if the signal is not valid. Problem is, that you also do not see the control in Design mode! A second solution could be the using of the scene feature - but this enable / disable always a complete panel.
Thank you for your reply Mr. Wilhelm,

Could you please tell me how a Received Signal Value can be used to move a Control?

And what are the steps for the scene feature be used?

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Display CAN Signals on Instrument Panel

Post by PEAK-Support » Wed 24. May 2017, 16:51

Here a simple code sample how to get the reference to a Label on a panel:

Code: Select all

 Dim PanelDoc, panel, scene, label, i
  Set PanelDoc = Documents.Open("Panel1.ipf")
  If Not PanelDoc Is Nothing Then
    Set panel = PanelDoc.ActiveWindow.Object	
    Set scene = PanelDoc.ActiveWindow.Object.ActiveScene
    For i = 1 to scene.Controls.Count
    	If scene.Controls.Item(i).Name = "myLabel" Then 
			Set label = scene.Controls.Item(i)
		End If	
	Next 	
  End If
later on in the code, you could use the reference to set properties while your script is running:

Code: Select all

  ' Create the sinus signal
  x = 0
  Do While StopSig.Value = 0
	x = x + .05
	SinusSig.Value = Sin(x) * 50
	label.Left = SinusSig.Value + 260
	label.Top = SinusSig.Value + 50
	label.Caption = SinusSig.Value
	Wait 50
  Loop
So you could move the object (in this case a label) to any place on your panel you like. See my sample screen. (animated GIF) If you use negative positions, the control is not visible anymore. (be carefull! if you stop the macro, and the position is not visible, you could not "find" the control on the panel..)

How to work with different scene is part of the online help. It is also well documented.
Attachments
2017-05-24_16-46-40.gif
2017-05-24_16-46-40.gif (875.75 KiB) Viewed 6711 times
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

akanti
Posts: 4
Joined: Fri 19. May 2017, 04:13

Re: Display CAN Signals on Instrument Panel

Post by akanti » Thu 25. May 2017, 19:25

Thank You!

Post Reply