LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

New NXT-G block, need some help

Hi, I'm making a new NXT-G block and I have a question. I'm making a block that tells the speed that the motors are going. I need to know how make it give me "values" for each "level". The levels go from 0 to 100. Level 100's value is 850, and level 0's is 0. How can I make it know all the values of the levels in between, without telling it anything but the first and last ones?


Message Edited by MindstormsKid on 07-15-2008 08:57 AM
0 Kudos
Message 1 of 28
(8,559 Views)

Hi Mindstorm...,

calculate a factor and offset of your ranges and use this to calculate your values. X = factor*input+offset.

Hope it helps.
Mike

0 Kudos
Message 2 of 28
(8,555 Views)
Sorta... How do I do what you said? I may not be a LabVIEW newb, but I'm not an expert. I've attached the file.
0 Kudos
Message 3 of 28
(8,550 Views)
Hi Mindstorm...,
in your case factor is 8.5 and offset is 0. So multiply your input with 8.5 and you have your result.

Hope it helps.
Mike
0 Kudos
Message 4 of 28
(8,546 Views)
Ok, I made a Sub VI with it, and put together a simple program. When I try to download it to my NXT, it gives me the error "Cannot open a VI because it is password protected."

Any idea on how to fix this?
Download All
0 Kudos
Message 5 of 28
(8,542 Views)
Hi Mindstrom...,
i think the problem is that you use the timed loop. I´m not sure if this loop is available on nxt. I can´t find it on my nxt palette.

Mike
0 Kudos
Message 6 of 28
(8,531 Views)
I know it will let you use some blocks that aren't in the toolkit. Anyway, it's always said that a block you used isn't allowed. Any idea on what to use instead?

BTW, it's MindstormsKid. It's just to long for the forum to display.


Message Edited by MindstormsKid on 07-15-2008 03:47 PM
0 Kudos
Message 7 of 28
(8,527 Views)
Ok, I made a new one. However, the "wait until ms multiple" isn't supported. Any idea on what to do?
0 Kudos
Message 8 of 28
(8,514 Views)
Hi MindstormsKid,
you can use the "NXT_Timer.vi". Use only functions from the NXT Libraries.

Mike
0 Kudos
Message 9 of 28
(8,501 Views)
Ok, I did that. I found that "absolute value" doesn't work, and floating-point data types are not allowed. Now it downloads and runs, but it won't display anything.
0 Kudos
Message 10 of 28
(8,481 Views)