11-06-2012 09:37 AM
Hey guys, I'm new to labview and I'm working on a project for work. I have my program set up but I would like to add a control that would let me put in a specific cycle value on the front panel, that would allow me to capture data of only the specifed cycles: say 30, or 2000. I already have a cycle counter...is there anyway I could revise my code to allow for a control of these cycle counts?
Solved! Go to Solution.
11-06-2012 09:52 AM - edited 11-06-2012 09:52 AM
Hi skinner,
- you should make the constant to initialize the counter shift register an integer like I32...
- you should also wire the FALSE case of your counter case structure...
- you should use on of the comparison functions to check your counter value against your limit and wire the result to the loop stop condition...
- you should delete the outer while loop as it's useless...
- you should do some other things as well, but I leave the RubeGoldberg hunting up to you... 😄
11-06-2012 09:58 AM
Good morning Gerd, ok, I get making a control for the shift register, although it would be a constant; how could I change this value via the front panel? I'm not understanding what you mean about wiring the False condition of the case structure. Also, yes, the While loop is meaningless.
11-06-2012 10:02 AM
Hi skinner,
- I didn't mention any controls, you should change the datatype of that constant!
- You didn't wire the FALSE case of that case structure. Instead the output is set to "default if unwired", which (i think) is bad for a counter...
11-06-2012 10:06 AM
So how to I change the data type? I'm hopeless, I know! 😄
11-06-2012 10:10 AM
11-06-2012 10:25 AM
Actually the beginners course was more of a sales pitch for the compact RIO. I've done most of my learning on my own and through your help.I think I changed the data type of the register. Now, onto this "wiring" of the false case...any pointers?
11-06-2012 10:48 AM
I think I made some progress...is this what I should be doing?
11-06-2012 11:49 AM
@glskinner wrote:
Now, onto this "wiring" of the false case...any pointers?
See those case structures with the output tunnels? Notice that the tunnels are not filled in solid? That means that not all of the cases are giving an output for that tunnel. It will output the default value for that data type (typically 0 or FALSE) when it is not wired. In general, you should not have those. Define a specific value for those tunnels in each case.
Now in the case of your loop count, I think you just want to wire the input tunnel straight to the output tunnel in the FALSE case.
11-06-2012 04:19 PM - edited 11-06-2012 04:20 PM
@glskinner wrote:
I think I made some progress...is this what I should be doing?
Most of your code still does not make a lot of sense.
...