07-23-2015 10:33 AM - edited 07-23-2015 10:54 AM
You're probably thinking too linearly here with respect to the tabs. You don't neeeed tabs, all the controls can be displayed at once, it's up to you. The application is your playground, you can make it switch tabs, you can make it trigger a specific state, you can do whatever you want. Personally, I wouldn't make it change tabs for the user, let the user change the tabs themselves.
In order to keep a continuous amount of data coming in to your plot during the acquisition state, you want to implement a second loop that just does the acquisition. The "Acquire" state in your main loop can trigger this loop to acquire. Then the "StopAcq" state (or whatever you want to call it) can trigger for that loop to stop.
I got a little carried away and altered the last VI you attached here to do this. You'll have to edit your version to include the Start and Initialize, or whatever buttons your want, because I just did the Stop button case. I disconnected the type-def state control as well, so you just want to edit your version once learning from mine.
I also edited your File IO express VI to not prompt the user, that would seize up the loop until the user finished and could result in lost data.
There is a horrible lack of error handling in this application, but you should be fine with Automatic Error Handling for right now unless you plan on adding a whole bunch more functionality.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-24-2015 07:50 AM
Dear,
Thank you James, your program is working a lot more fluent than mine, is this a state machine with a master slave architecture?
I've attached the program I have untill now, I reworked my state machine in the way it needs to be to become a real state machine, I guess. I find it very useful that the tabs change automaticaly, so the user can't click on anything wrong or something, he just needs to follow the buttons... I will also try to disable the buttons of zero and measurement when the program starts, after the users pressed the 'configurate channels' button, the other buttons will be set to able again, so the users really needs to follow the steps.
I will now try to implement your version into mine, because the acquisition of your program is a lot (read: enormously) faster 🙂
With kind regards,
Peter
PS: Thank you for the effort to make an example!
07-24-2015 09:30 AM
@PeteTheGod wrote:
is this a state machine with a master slave architecture?
It's not a master-slave architecture because that would include a queue of commands and/or data to be communicating between the master and slave. This is really a very simple parallel While loop architecture and isn't very scale-able. You shouldn't use what I made beyond your single acquisition application because it can get out of hand really fast. A better, more complicated (but robust) architecture is the Queued Message Handler.
PeteTheGod wrote:I will now try to implement your version into mine, because the acquisition of your program is a lot (read: enormously) faster 🙂
Yeah, you were pulling a single point with each loop and reinitializing the DAQmx task every time as well. So you were essentially turning this awesome hardware that can do it's own data timing and limiting it to your own loop speed. What I did was add a Timing node in the initialization state that sets that sample rate and the other loop just pulls all available data points instead of 1.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
07-24-2015 01:38 PM
Dear James,
I have implemented your vi into mine, and it works! Eureka!!
Could you check my program for some main errors? I need to get started with the error handling now, what's the basic principle of it? Do I just need to connect all the error outs and error ins with eachother?
After the error handling, I need to filter and process my signals, but I'm already very happy with what I have now.
With much thanks
Kind regards,
Peter
07-24-2015 03:19 PM - edited 07-24-2015 03:21 PM
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'