04-05-2017 10:50 AM
Sure Altenbach,
Valid serial number: 1234ADCF
But user has the option to assign the serial number as per the HW connected.
And, serial number should not be more than 32 bit length after converting to hex, so user can not enter more than 32 bit character.
Pls let me know if that helps to understand.
Regards
Aniket
04-05-2017 11:05 AM - edited 04-05-2017 11:07 AM
So the serial number is a hex formatted U32 value.
Again, use a U32 control and set the format to hexadecimal (%08x) and invalid values cannot be entered. No need for any code. You can always format it as hexadecimal string if needed elsewhere inside the code.
04-05-2017 11:11 AM - edited 04-05-2017 11:20 AM
But also wanted to prompt users about the out of range data entered.
And, it should be string input (with Normal display) with limit in length.
Regards
Aniket
04-05-2017 11:19 AM
@aniketjha wrote:
But also wanted to prompt users about the out of range data entered.
As I said, this cannot happen if you use my advice. No code needed.
04-05-2017 11:42 AM
Altenbach,
What if the input is string(Normal display), then how to proceed further and length 32 character maximum.?
04-05-2017 11:49 AM
@aniketjha wrote:
Altenbach,
What if the input is string(Normal display), then how to proceed further and length 32 character maximum.?
Simply don't do it that way if a much better solution exists.
You need to be consistent. You randomly mix 32 bits, 32 characters, 8 characters, etc. These are all very different definitions!
04-05-2017 11:57 AM
@aniketjha wrote:
Altenbach,
What if the input is string(Normal display), then how to proceed further and length 32 character maximum.?
Why even have it as a string? Just make the input a numeric 32 bit number displayed as hex.
04-05-2017 12:03 PM
04-05-2017 12:04 PM
@altenbach wrote:
@billko wrote:
en have it as a string? Just make the input a numeric 32 bit number displayed as hex.exactly! 😄
I wasn't trying to steal your thunder - I was emphasizing your lightning. 😉
04-05-2017 12:11 PM
Is this is to capture a Model number of an instrument like AFG3102 (A dual channel Arbitrary / Function Generator from Tektronix) or a Serial Number of C022080? Not all Serial numbers (MY41047333) nor Model Numbers (AFG3102) are valid in their hexadecimal representation. The Model number that I have listed has a non-Hexadecimal character 'G'. How would that be handled? Could you give us a few valid entries and a few invalid entries to help clarify things further?