01-29-2012 07:15 PM
My question is more a labview code issue more than a lifa question. but anyway. ive uploaded a vi which i am trying to read the state of one of the arduino digital pins. but with the way i am running my main while loop it will not execute unless an event happens. I thought that my default case would execute always but it seems like my main loop only executes when my event loop and message queue tell it to go. how can i make it so that my main loop runs continuoulsy and executes my default state. One solution I came up with is in a disable structure at the bottom with a small while loop. but it seems that when the value is changed the property node does not trigger my event message queue either solution would be fine, but I would prefer to not have an extra parrallel loop. Thanks.
01-30-2012 09:41 PM
Hey,
I think you have the right idea already with the Timeout case for the event structure - I think you will want to set the timeout to 1ms (or larger) instead of 0 though. This will make it so that if no other event is triggered then every 1 ms you execute that case instead.
01-31-2012 11:37 PM
Okay awesome that seemed to work I have to work out somemore logic with that whole thing but at least now it is functioning properly. I had another question which LV help and google haven't been to helpful with. In the Arduino you can use the map value funciton to map one value to another range. Is there a function in Labview that can do that. I guess it would be pretty easy to make one, but why reinvent the wheel. Thanks
02-01-2012 11:48 AM
I would probably just do the math to scale it - there might be some functionality burried in one of the math pallettes that could do this but I think its easier just to make a sub VI which will do a linear scaling (should just be y=mX+b)