LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

C Problem in VI

Looks to me like MaxAch > spec, thus sending out spec?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 24
(1,227 Views)

but spec is 2x10^6 which isnt being output?

0 Kudos
Message 12 of 24
(1,225 Views)

Meh, remake it with LV primitives, it'll be easier to debug. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 13 of 24
(1,222 Views)

Zwired1 

 

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

0 Kudos
Message 14 of 24
(1,195 Views)

theres the variables & controls

0 Kudos
Message 15 of 24
(1,175 Views)

Calulating manually i get 1666666,6...

a=0

sClk=60M

inte = 36

maxACH=sCLK/inte=1666666,6

 

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 16 of 24
(1,156 Views)

when i did it manually, trying to follow code, i got ridiculus answers!

0 Kudos
Message 17 of 24
(1,154 Views)

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

0 Kudos
Message 18 of 24
(1,139 Views)

 

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"?     

0 Kudos
Message 19 of 24
(1,117 Views)

@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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 20 of 24
(1,101 Views)