hakannn Posted June 6, 2008 Report Share Posted June 6, 2008 hello everybody, i read AI but just one input but i have to read 6 input... i sent my program. pls hep me i need your help... thanks for everything hakan... Quote Link to comment
Mikrobi Posted June 6, 2008 Report Share Posted June 6, 2008 Constant physical channels you currently set as single chanel. Open physical channels and select Browse... then click with Ctrl button pressed to select more than one physical channel. You could also set adress that way: QUOTE Dev1/ai1:5 then you will use channel 1, 2, 3 , 4 and 5 Quote Link to comment
hakannn Posted June 7, 2008 Author Report Share Posted June 7, 2008 hi again, i added "physical channel" and the program is running. but it's show me just one signal... :headbang: why couldn't i show 6 signals? look forward your reply... thanks for your help hakan Quote Link to comment
jgcode Posted June 7, 2008 Report Share Posted June 7, 2008 QUOTE (hakannn @ Jun 6 2008, 02:27 PM) i added "physical channel" and the program is running. but it's show me just one signal... :headbang: why couldn't i show 6 signals? Hi Hakan It is collecting 5 signals and returning 5 pts of data and writing them to disk - which is fine. But for display you are taking that 1D array putting it into another 1D array (the waveform graph). What you will get is a large 1D array with all the channels interleaved (mixed up). You need to build up a 2D array. Examples of different ways to do it: 1) The picture shows one way but it is bad as it causes repeated memory allocations - but it illustrates the point. 2) Have a search on initialising arrays and using replace array subset. You will have to declare you array size before you enter the loop for this. 3) Build a circular buffer, you initialise this buffer, then when the display buffer is full, instead of overflowing, you overwrite the old data and your program can run for ever. 4) You may wish to use a second parallel loop to handle your display (depending on cohesion needs, aquisition speeds, time) etc... http://lavag.org/old_files/monthly_06_2008/post-10325-1212741824.png' target="_blank"> Quote Link to comment
hakannn Posted June 7, 2008 Author Report Share Posted June 7, 2008 hi jgcode, thanks for your reply. i tryied your solution but i couldn't managed it. ( The next step is to build a circular buffer" i couldn't understand, what does it means "circular buffer"?? :s ) after i tryied other solution and i saw signals. the last problem about program, The program can't save the "coefficent" and "plus" number. can i save this number. i don't want to write it everytime when i open the program i hope i'll solve that problem. again, thanks for everything... hakan... Quote Link to comment
jgcode Posted June 7, 2008 Report Share Posted June 7, 2008 QUOTE (hakannn @ Jun 6 2008, 07:37 PM) hi jgcode, thanks for your reply. i tryied your solution but i couldn't managed it. ( The next step is to build a circular buffer" i couldn't understand, what does it means "circular buffer"?? :s ) after i tryied other solution and i saw signals. the last problem about program, The program can't save the "coefficent" and "plus" number. can i save this number. i don't want to write it everytime when i open the program Making a 2D array is a solution for a waveform GRAPH Another solution is to use the waveform CHART like you have done and let the chart handle buffering (which is statically set). You may find handling your own buffer is more flexible, but if you are after a quick solution the chart is actually probably the easiest. If you need to save your scale and offset and the values do not change per collection then convert them to a string and write them to disk as a header in your collection file is an option.Do this before you enter the loop. If the values do not change there is no point continually polling the FP panel every time you do a read. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.