05-14-2010 09:29 PM
05-15-2010 09:15 PM
05-17-2010 08:59 AM
It’s a little difficult to describe and what I said is probably misleading. If the FPGA VI is started and stopped without changing the analog inputs, the value (i.e. Total Load) seems to always be correct. However, if I stop the VI, change the input values and then restart the VI , the Total Load value will be incorrect basedon what is at the analog inputs. It will then correct itself if I restart the VI without changing the analog input values.
It’s unclear how to reset the FIFO at startup and why does the FIFO not clear itself out after a number (i.e. 256) of iterations?05-17-2010 09:09 AM
05-17-2010 09:34 AM
05-17-2010 10:10 AM
05-18-2010 07:35 AM
attached is revised code including reset and ititializaiton code.
on the example that you provided, you recoded the math after the moving average and conversion to AO. I replaced this with the code from my previous example. I have found that it is better to be explicit about the number types being used rather than letting the number propogate to very large bit-widths.
good luck
05-18-2010 08:41 AM
05-18-2010 09:35 AM - edited 05-18-2010 09:38 AM
do a "create constant" at the AO terminal to see the data type expected by the I/O node. +20,-5 allows 0 to .0312 range. enough for the 0-.020 mA range of module.
looking at it again the final span and offset should have higher resolution to insure that the +20,-5 resolution is preserved. set the output type of both mult and add to +20,-5.
05-21-2010 09:12 AM
Hi Stu,
Earlier you mentioned to use normal arithmetic functions as opposed to high throughput. For reasons unknown to me it will not compile when using the normal functions because there are timing problems. It’s unclear how to solve the timing problems so I reverted back to using the high throughput versions. However, I’m having trouble with accuracy in the calculations. In other words, it does not add and multiply correctly. I don’t know if this has something to do with the high throughput or my lack of understanding how to work with FXP; or both. It takes a full 2 hours to compile so I’m easily sidetracked, which makes it difficult to finish the project.
When is it appropriate to use high throughput versus the normal arithmetic functions?