05-17-2024 07:44 AM
Flattening the code linked to that "10" constant, it gives this :
By simplifying it, we obtain the following :
The boolean in output is True 1 out of N iterations of the While Loop, depending of the TC/TUC input.
Increasing the "10" will lower the frequency, decreasing the "10" will higher the frequency.
My guess is your colleague wanted a way to "double" the While Loop : some actions are done at full speed, some others are at lower speed (1/N).
05-17-2024 02:05 PM
he showed me something but we were too busy with other things today and i wasnt able to catch him before his china trip. but what i can definitely say is that he used "time count" like on the picture i posted. but i dont understand the idea of it atm i need more skills. you guys gave me some homework and i am diligently reading.
the event case is pretty interesting and i ve never used it like that. it seems to be a mighty tool and i had no idea how useful it is.
but thats a little snip of all i can remember. the clock here is for sure the rest is incomplete. maybe it makes some sort of sense for you to implement this code somehow instead of the "10"
05-21-2024 12:45 AM
puh i stuck totally 😞
i guess i ll never be able to catch it. really frustrating.
05-21-2024 02:53 AM
Take a look at some NI exercices : https://learn-cf.ni.com/custed/Certification/Prep%20Material/CLD/cld_success_package.zip
The third can be suitable for your case.
05-21-2024 03:43 AM
thank you ...reading 🙂
05-22-2024 02:51 AM
I built some array to "log" or better visualize the timing of the loop and there are some inconsistency. not sure if the inaccuracy of the loop affects the constant 10 but is it possible to prevent this behavior with a simple code which is connected to the loop?
also i implemented a method to measure the time (hopefully corretly). maybe you could stablilize or force the timing for the loop to make the 10 constant unnecessary?
(there are 2 loops. while and for loop) ?
05-22-2024 04:00 AM
As the "10" constant is linked to the iteration terminal "i", the inconsistency of the execution time of the While loop therefore will affects frequency of actions after the "10".
There are multiple ways to control frequency of a While loop, here are some of them.
The best solution is the one that fully meets your needs. Perhaps neither of the previous two answers it and you have to create your own.
Note that you should create FGV to manage time. Perhaps you've seen this concept in the NI exercises I sent out.
About the measurement of time, your method is good. Just consider rotating the array the other direction (-1) and using right encoding (U32).
05-22-2024 06:10 AM
thank you pinguX. yes i read the FGV thing. i'll have to study it a little bit mote to understand how i could use the code. i have the problem to simulate my code.
i have to connect it to the hardware. i wasnt able to simulate it with MAX or anything else.