LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two equal consecutive integers

Solved!
Go to solution

An here's a (maybe) slightly more elegant solution. 😉

 

0 Kudos
Message 11 of 32
(1,025 Views)

altenbach; I have changed the way i represented the wait (should have guessed to represent it as the TF array). I removed the constant value linked to N but I haven't understood the particular comments: 

"For small array diagram constant, I would always show the first out of range element so it is clear how big the array really is. If you don't, it could be much longer than the display. (For large array diagram constants, simply show the scrollbar)."

 

"You could also use a feedback node."

 

As for the second solution, I'll try to understand the %09d format.

 

0 Kudos
Message 12 of 32
(1,016 Views)

A.A.A. wrote:

"For small array diagram constant, I would always show the first out of range element so it is clear how big the array really is. 


Your array diagram constant was sized to exactly show the array elements. Since I don't trust what I see, I resized it one element bigger to ensure we are at the end of the array. The container size and the actual arrays size are independent.


@A.A.A. wrote:

You could also use a feedback node."


Well, in my Mod2 example I used a feedback node instead of a shift register. same difference.


@A.A.A. wrote:

As for the second solution, I'll try to understand the %09d format. 


What is there to understand. It simply formats the number in decimal with a minimum size of 9 digits and adds leading zeroes if the number is smaller than 9 digits. Check the help on Format Specifier Syntax. Do you understand the rest, e.g. why we subtract 48?

 

0 Kudos
Message 13 of 32
(1,008 Views)

Sorry I didn't reply earlier; It was almost 1 a.m.

 

If I am not mistaken the %09d format changes the number to x.xxxxxxxx

I didn't find the palette that is linked to the Enter Your Number ID, but I think we subtracted the 48 due to the 8 digits (represented as hexa decimal) after the decimal point. The maximum distance between 00000000 and 77777777 is 48

I'm not sure though.

 

If I'm mstaken how does it represent for example 123456789?

 

0 Kudos
Message 14 of 32
(991 Views)

Don't you think we've done enough of your homework?

0 Kudos
Message 15 of 32
(976 Views)

LOL thats my friend!

I told him that ni has forums that both help and teach you new programing ideas.

I am sorry if we caused any inconvience but we came to learn\improve from our LabVIEW mistakes.

0 Kudos
Message 16 of 32
(965 Views)

Hmmm.... two people working on exactly the same problem. Hmmm.....

 

Honesty is a rare commodity these days.

0 Kudos
Message 17 of 32
(954 Views)

A.A.A. wrote:

If I am not mistaken the %09d format changes the number to x.xxxxxxxx


No!


A.A.A. wrote:

I didn't find the palette that is linked to the Enter Your Number ID, but I think we subtracted the 48 due to the 8 digits (represented as hexa decimal) after the decimal point. The maximum distance between 00000000 and 77777777 is 48


No!

 

0 Kudos
Message 18 of 32
(948 Views)

Both of us are working on the exactly the same problem of a homework ...

But what differs us from the rest of the class is that we ask what is vague and...

 

Other examples:

http://forums.ni.com/t5/LabVIEW/How-to-use-the-XY-graph/m-p/1757526#M613034

 

http://forums.ni.com/t5/LabVIEW/Problems-with-the-quot-INSERT-quot-button/m-p/1765592#M614473

I have mentioned here thatI had a homework but I needed help in it.

 

 

 

0 Kudos
Message 19 of 32
(944 Views)

There is nothing wrong with asking for help with homework, especially if you try to solve most of it yourself and ask specfic questions here (e.g. "Is there a way without using local variables to do that?") is a good question. 😉

 

The internet is a great resource to solve problems and asking questions in a forum is a valuable learning tool too. 😄

0 Kudos
Message 20 of 32
(934 Views)