11-10-2014 04:55 AM
Looks to me like MaxAch > spec, thus sending out spec?
/Y
11-10-2014 04:58 AM
but spec is 2x10^6 which isnt being output?
11-10-2014 04:59 AM
Meh, remake it with LV primitives, it'll be easier to debug. 🙂
/Y
11-10-2014 08:15 AM
maxFFin = 2E+6
sCLKin = 60000000
ffin = 200000
bit = 18
taq = 3E-7
spec = 200000
those are the inputs, same as he screenshots of the probes i sent
11-10-2014 09:27 AM
theres the variables & controls
11-10-2014 10:19 AM
Calulating manually i get 1666666,6...
a=0
sClk=60M
inte = 36
maxACH=sCLK/inte=1666666,6
/Y
11-10-2014 10:23 AM
when i did it manually, trying to follow code, i got ridiculus answers!
11-10-2014 12:34 PM - edited 11-10-2014 12:34 PM
That shows one of two things: (1) Tedious calculations shoudl always be left to computers, or (2) the code does not do what you want it to do.
We do not know what the expected results are. We do not know what the permissible ranges and combinations of input values are. We do not know what this code is supposed to do.
So. We cannot tell whether the algorithm is correct. We cannot tell whether the algorithm accounts for roundoff correctly. We cannot tell which these versions is correct or whether they are all wrong.
Here is my VI showing how I implemented my interpretation of your formula nodes in LV primitives. As you can see there are multiple versions of some parts where I tried variations in representation and algortihm. Note that where comparing floating point numbers I used In Range & Coerce with a tolerance of +/-1E-6 (arbitrarily chosen). See maxFFcheck as an example. I did not clean it up or document things. If you have questions, please post them. I also added some extra outputs and indicators in the formula nodes for troubleshooting purposes.
Lynn
11-11-2014 03:27 AM
Lynn
i appreciate/acknowledge your effort, thanks. But when VI is run, an output of 1.67x10^6 is still produced, therefore producing the message at the end, "sampling rate has changed to"?
11-11-2014 05:34 AM
@dhanna wrote:
Lynn
i appreciate/acknowledge your effort, thanks. But when VI is run, an output of 1.67x10^6 is still produced, therefore producing the message at the end, "sampling rate has changed to"?
Then your formula is wrong?
/Y