NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Colour selection teststand

Solved!
Go to solution

Hi,

 

I have created a VI to display a dialog box to a user during a TestStand test sequence.  Among other attributes I've brought out colour (sorry color!) controls into TestStand to change font and front panel background etc. for flexibility and re-use.

My question is, since the colour controls appear in TestStand parameters as simply U32 numerics is there any facility in TestStand to have a colour picker instead of having to know what the number equals in colour?

The alternative is to use enumerated lists to specify colour 'names' but this is a little painful and limited.

 

Regards,

 

0 Kudos
Message 1 of 5
(4,570 Views)

Running LabVIEW 8.6 and TestStand 4.1 by the way!

0 Kudos
Message 2 of 5
(4,569 Views)

Hi,

 

Just remembered the colours can be chosen in TestStand using the constants from the expression browser (e.g. tsBlack etc.).  This is still limited but easier than creating code to handle enumerated list(s) controls.

However, it seems between LabVIEW and TestStand red and blue are interchanged.  Specifiying in TestStand tsRed produces the colour in LabVIEW as blue (effectively tsBlue) and it is the same for dark colours but not green.  I read in TestStand help that LabVIEW and LabWindows use a different endian format to Windows and ActiveX which would explain this partially - shouldn't the endian format carry over to TestStand without conversion?

 

If this is a bug fixed after my versions of LabVIEW and TestStand then apologies.  I can't find any other post discussing this in relation to TestStand.

 

Regards,

0 Kudos
Message 3 of 5
(4,563 Views)
Solution
Accepted by topic author WiMAX_Eng

Hey WiMAX_Eng!!

 

You have asked a great question here - one which had me stumped for a while! I am working with TestStand 4.2, and I was seeing the same issue. However, exactly as you mentioned, the colour (sorry, color - ha) formats in TestStand and LabVIEW are different endians.  This is discussed below...

 

Color values are typically four-byte integers and commonly use little-endian and big-endian format. Windows and ActiveX use the little-endian format, which stores red, green, and blue color components in the 0x00BBGGRR byte positions. LabVIEW and LabWindows/CVI use the big-endian format, which stores the color components in the 0x00RRGGBB byte positions.


...essentially, this is expected behavior.


Fortunately, there is a very simple way of getting around this issue. There is a function in TestStand that convert between the 2 different colour formats. So sending the following expression into a LabVIEW code module...


ConvertColor(tsRed)


...will pass the colour Red into LabVIEW in the format that LabVIEW will correctly interpret.


In effect, the ConvertColor() function implements the same functionality as this piece of LabVIEW code.

 

23716i6ED0B1B76F6B34A4

 

I hope this has been helpful.
Best wishes,

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
Message 4 of 5
(4,518 Views)

Hi Rich,

 

Thank you for the code and your comments.  I found the ConvertColor() function in TestStand the other day and I thought I might be stuck with it.  This messes up the parameters a little in TestStand and possibly adds confusion to anyone adopting the sequence/step so I'm glad I can incorporate those conversions into LabVIEW.

 

 

Many Thanks

0 Kudos
Message 5 of 5
(4,506 Views)