ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I keep trailing zeroes before a value?

Solved!
Go to solution

Hi guys:)

 

I'm afraid this will be the first of a series of question as I stumble into my first complex program. Until now I've only done smaller scale, but this is more heavy.

The program will do a series of test for 10 circuits attached in 1 panel. Each circuit have their own serialnumber the user have to input in my program.

 

The serialnumber have a letter first (A = year 2010, B = year 2011 and so on). After that there is a five digit number.

 

Example: A00001, A00002, A00003 ...... etc.

 

Because there are 10 serialnumbers I would like that user inputs the first serialnumber: A00001. Then my program automatically increments the serialnumber by 1 for each circuit. Since the letter is changed per year I have put it as text to the left of the numeric control, so the user only have to input "00001".

 

My program increments the serialnumber correctly and I can see the serialnumber for each circuit. The only problem is:

 

What I want to see:

User input: 00001

SN1: 00001

SN2: 00002

....

SN10: 00010

 

What I see:

 

User input: 00001 (Changes into 1)

SN1: 1

SN2: 2

....

SN10: 10

 

Labview removes my zeroes to the left of the value. Any ways to change this? I tried to change from DBL till i32 or u32. I have only managed to get zeroes after ",".

 

I could probably make the whole input as a string, but then I cannot increment it so user have to input 10 serialnumbers. Where I work it is very important that the testcrew use as short time per test as possible.

 

Thanks and regards,

 

Even

 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 1 of 4
(3,029 Views)
Solution
Accepted by topic author EvenDeejay

Just give Format string as "A%04d" in the numeric control ->Advanced Editing mode.

 

-Kumar.B

Message 2 of 4
(3,019 Views)

Properties -> Display Format - > Use Minimum Field Width -> 5, Pad with zeros on left

 

- Rkll

 

21964iF8D31349D2E0AEA5

Message 3 of 4
(3,015 Views)

Both worked so Kudos till you both, but I have to put one as solution so I put the first one.

 

Thanks

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 4 of 4
(3,005 Views)