09-23-2016 10:14 AM
Hey
I have been trying to look it up for so long and I can not seem to find any help to this problem. I can log my data but I want the user to be able to choose how often the data is logged. If they want it to be logged every second or every 10 seconds. I use express vi's so I know it is the "wrong way" to code but I am still trying to learn.
DP
09-23-2016 10:14 AM
Hey
I have been trying to look it up for so long and I can not seem to find any help to this problem. I can log my data but I want the user to be able to choose how often the data is logged. If they want it to be logged every second or every 10 seconds. I use express vi's so I know it is the "wrong way" to code but I am still trying to learn.
DP
09-23-2016 10:26 AM
Yes, you should not use Express VIs. You can see many examples using binary, text and TDMS file handling. You can see these examples via the Help menu point.
Regarding to the logging frequency, use a modulo devision along with a Case structure. In this case of course you need to know the timing of your loop. I show an example here with a loop which iterates at 1 Hz:
The next step in your learning curve should be the State Machine. Using a state machine, you can give the user more options, like start and stop file record, DAQ task, etc...
09-23-2016 10:54 AM - edited 09-23-2016 10:56 AM
Hey Blokk
I have a hard time understanding what is going on in that piece of code you attached. It would really help if you could show me how to implement a solution inside my code so I could see it working aswell. Maybe I am asking for too much but as a new guy with no youtube video or anything showing an example it is really hard. I really appreciate your help. Right now my data is written every 0.010 seconds which is really over the top.
DP
09-23-2016 11:18 AM
You have a rate of 1000 Hz and samples 100 for your DAQ Assistant. It means it executes in every 0.1 sec. This is the while loop iteration time. So if you want to log data at every 1 sec, you need to use a value of 10 for the modulo devision as devider, see my example VI and implement it for your VI. If you do not understand the VI how it works, you should really go through the basics. If you are a student, or you have LV licence, you can access the Core 1-2-3 teaching videos. Besides, I do not want to make your home-work for you 😉
Another thing is that useless DAQ Assistant express VI. You should also learn how to use proper DAQmx functions, so you could get rid of that Express VI, and its evil sidekick the dynamic data wire 🙂
So you want to measure 2 K-type thermocouples and a current, using a cDAQ device, yes? There are lots of examples via the help menu where you can see how to program using low level DAQmx functions...
09-26-2016 10:33 AM
Hi Blokk
I can not make it work :(. I am trying to understand but it is not that easy. How do I finish the VI I attached?
DP