Usng string values from enums in Instrument Panels

Comprehensive CAN monitor for Windows® and its add-ins: Plotter, CANdb Import, Instruments Panel, and J1939
Post Reply
mwbevington
Posts: 13
Joined: Thu 28. Jul 2011, 19:02

Usng string values from enums in Instrument Panels

Post by mwbevington » Sun 7. May 2023, 22:54

Hi,

I know I have had this working before, but can't seem to figure it out today, plus could not find anything in the forum.
I have a symbol file (FormatVersion=5.0) for which I have enums assigned for some symbols. I'd like to be able to see the text associated with the symbol in a ValueInidcator in a Instrument Panel file, instead of the numeric value. How do I do it?

Example, for ChainLatchStatus)

Code: Select all

{ENUMS}
enum ChainLatchStatus (0="Default ERROR", 1="UnLatched", 2="Latched", 3="In Transit", 4="Valve Driver Fault")

{SENDRECEIVE}
[Hitch_Status_1]
ID=18FFE042h    // 0xFFE0, SA=0x42 (66), Rep = 50 mS
DLC=8
CycleTime=50
Var=HydraulicPressure                           unsigned   0,16 /o:0 /f:0.1 /u:PSI      // Does not use metric, i.e. does not conform to SAE spec for liquid pressure
Var=InsufficientHydraulicPressure          unsigned  16,2 /o:0 /f:1.0
Var=StartHitch_UnHitchStatusNumeric   unsigned  18,4 /o:0 /f:1.0					
Var=HitchHoodStatusNumeric                unsigned  22,4 /o:0 /f:1.0		
Var=PintleReleaseStatusNumeric            unsigned  26,4 /o:0 /f:1.0		
Var=TongueLockStatusNumeric              unsigned  30,4 /o:0 /f:1.0		
Var=KickstandStatusNumeric                 unsigned  34,4 /o:0 /f:1.0		   
Var=HitchLockStatusNumeric                 unsigned  38,5 /o:0 /f:1.0		
Var=ChainLatchStatusNumeric               unsigned  43,5 /o:0 /f:1.0 /e:ChainLatchStatus
ChainLatchStatusValueIndicator.JPG
ChainLatchStatusValueIndicator.JPG (12.48 KiB) Viewed 5091 times
Last edited by M.Gerber on Mon 8. May 2023, 09:22, edited 1 time in total.
Reason: Inserted [code] tag for improved readability.
Mark W. Bevington
Maven Engineering
Yerington, NV, USA
e) mark@maveneng.net
c) 775.315.3088

User avatar
M.Gerber
Design & Documentation
Design & Documentation
Posts: 68
Joined: Mon 13. Sep 2010, 16:34

Re: Usng string values from enums in Instrument Panels

Post by M.Gerber » Mon 8. May 2023, 09:25

Hello mwbevington,

The Label instrument is your friend. If you apply a Signal to this kind of instrument, the Signal's Enum texts are displayed.

Kind regards
Mark

mwbevington
Posts: 13
Joined: Thu 28. Jul 2011, 19:02

Re: Usng string values from enums in Instrument Panels

Post by mwbevington » Mon 8. May 2023, 20:43

Hi,

I can't find any property mentioned in the Property Editor for this ValueIndicator. See screensnip below. Also, I do not know of any /parameter
named label in a Peak Format version 5.0 symbol file, e.g. /e:=enum

How do I do this?
ValueIndicator9_ChainLatchStatus.JPG
ValueIndicator9_ChainLatchStatus.JPG (86.45 KiB) Viewed 5083 times
Thanks,
Mark
Mark W. Bevington
Maven Engineering
Yerington, NV, USA
e) mark@maveneng.net
c) 775.315.3088

mwbevington
Posts: 13
Joined: Thu 28. Jul 2011, 19:02

Re: Usng string values from enums in Instrument Panels

Post by mwbevington » Tue 9. May 2023, 04:13

I figured it out. Needed to use the "Label" element from within the Instrument Panel and assign the appropriate symbol to it. Here's a pic on where to find it, in case anyone else ever gets stuck on this...or....in case I forget how to do it again sometime in the future :lol:
Label4Capture.JPG
Label4Capture.JPG (63.41 KiB) Viewed 5083 times
Mark W. Bevington
Maven Engineering
Yerington, NV, USA
e) mark@maveneng.net
c) 775.315.3088

Post Reply