02-26-2013 05:02 AM
Hello guys!
I have the following situation:
the picture I attached displays a for loop implementation to detect certain CAD angles (rising and falling) to be input by the user and up on detection it is desired to output a pulse between the two values ( the rising of the pulse will be when I detect rising CAD input value and the falling of the pulse output will be when I detect the falling CAD input value).
I autoindexed the incoming CAD array to the for loop so that the algorithm runs for every element ( am I correct here?). The CAD array comes in the range [-360, 360] and when I output the indexed elements out to the front panel via a numeric display, I expect to see every element. Strange though it is always displaying the first few elements (360 and around). The CAD array has about 5110 elements with in the range. Why is these all elements not shown in the display? It is strange because I have tried the logic implemented in a simulation environment and it works just fine. But now running live, the results are affected.
Could someone help out?
Thanks
02-26-2013 09:03 AM
Hello henok
You are right. Autoindexing gives you the possibily to go through each individual element in the FOR LOOP. you can read and process every element in that array by enableing auto index. You also can enable auto-indexing by configuring a For Loop to return an array of every value generated by the loop.
I didnt understand your question actually. Do you have problems in displaying the CAD array ( that you have connected )in the front panel? And how are the results affected? Can you be more precise in your question?
02-26-2013 10:19 AM
My guess will be that the FOR loop is runing so fast that you can't see the values changing.
If you need to see the values changing, place a wait of 200ms in the FOR loop. That will slow down the loop.
You can also try to place an indicator connected to the I terminal of the FOR loop.
02-26-2013 11:54 AM
02-26-2013 11:58 AM
...here is a picture of results and a simulated input to the FOR LOOP.
02-27-2013 04:00 AM - edited 02-27-2013 04:02 AM
Hello henok
I dont see the problem u mentioned. The CAD values in the frontpanel runs from -360 to 360 with 0.1 interval and the rising and falling edges are detected as you have programmed.
I dont see any problems.
Put a 5ms wait ms inside the FOR LOOP and you can see the values in the frontpanel changing from -360 to 360
02-27-2013 04:53 AM
02-27-2013 10:32 AM
May be as dkfire mentioned , the FOR loop is runing so fast that you can't see the values changing even the boolean indicator. If it works with wait ms , then it should be working wihtout it.
Yeah i guess the wait inside the FOR Loop may also affect the graphic display.