08-15-2012 08:37 AM
Hi,
I'm a complete newb to Labview v8.6.1. I come from the .Net world and I'm having difficulty making the transition, some guidance would be greatly appreciated.
I've attached my .vi that I came up with but I've hit a wall and I can't get this design to work correctly:
I have two buttons on my .vi, a Sample button and a Calibrate button. When I hit the sample button, I need to write out the values from my linear sensors to a file, this actually works fine. When I hit the calibrate button, I need to get the values from the sensors, store them in an array for later use. This works fine as well.
The problem I'm having is I need to use the stored values in the array in my Sample button logic which doesn't work because I don't have cases for my "False" condition.
Am I even close to the right solution here?
Thanks for any guidance.
Solved! Go to Solution.
08-15-2012 08:54 AM
08-15-2012 09:01 AM
Do you have access to the Event Structure? It will work a lot better for GUI like this instead of polling the buttons (and using a lot of CPU).
You should look into shift registers to store your calibration array. I think the resources nyc gave should mention these somewhere in there.
08-15-2012 09:09 AM
There are different ways of doing it. You need shift registers. you can also use event structure. I tried to modify your existing vi just a little, and hope this is what you are looking for.
08-15-2012 09:41 AM
Thanks for all the help and suggestions. odessy, that's exactly what I was looking for. I need to look at the shift register in more detail, my vi was just a sample. I have 16 sensors that I need to store in the shift register, not sure if I just add more shift registers or if I can use just one shift register to store all 16 values.
Thanks again for all the help, it's been a little overwhelming.
08-15-2012 09:57 AM
You can create a shift register for an array. build an array for all 16 values, and then create one shift register for that array. Also, in future you might want to get rid of express vi s for data acquisition. They are good way to start learning but not very efficient way of programming. There are plenty examples you can search at labview>>help>>find Examples.
Good Luck!