LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone ever try to use Max instead of daq timing vi to setup and read from a 9234 at a rate of 50k and 50k samples?

It fails for us and requires use of timing vi instead of being able to configure from MAX.  We have a fix but wondered if anyone knows why this happens?

 

Seems MAX should have had same result as daq timing vi.  Example vi pic attached.  Locks up without the timing vi even with task defined in max that runs in MAX.

 

Thanks

Randy

0 Kudos
Message 1 of 5
(2,871 Views)

Hello Randy,

 

So does the VI throw an error at all or does it just hang?  Have you tried using highlight execution to see exactly where it's getting hung up at?  There are a couple of reasons why I could see your programming causing problems.  For instance, why are you starting and stopping the task each time in the loop?  Generally, you only want to start the task once, before the loop, and then stop it after the loop.  Starting and stopping the task each time will also slow down your loop execution time.  I noticed you don't have any timing within your loop either.  You should place a Wait Until Next ms Multiple VI inside your while loop so that you can free up your processor.  Without this, your loop will run as fast as the CPU will allow and this will end up bogging down your processor making it harder for other tasks to complete, such as updating the chart on your front panel.  A wait of 50-100ms is all that's necessary to free up your processor.

 

Also, whenever you use a task from MAX it should include the timing already so that you don't have to use the DAQmx Timing VI.  A neat feature of LabVIEW is the ability to physically drag your task from MAX and generate an example from it.  If you click on your task in MAX and drag it over to the block diagram in LabVIEW you will have a task constant placed on your block diagram.  Right-click on the output of the task constant and select Generate Code » Configuration and Example.  This will generate a configuration subVI which will create your virtual channel and configure your timing based off of what you have set in MAX, and then will also generate the rest of the code (DAQmx Start VI, DAQmx Read VI, DAQmx Clear VI, and the while loop if your task is set to continuous).  Try this out and let me know if you are still experiencing problems.

 

Regards,

Message 2 of 5
(2,846 Views)

Thanks for the response Brandon.  It was actually locking up and required a reboot to get debugging again. I got pulled in to assist and built the small vi I attached to be able to debug at my desk. The lack of the wait was an oversight on my part just in a hurry.  As far as where the start and the stop are we had to put them where they are based on the sampling mode. Which you will notice is determined by the case structure. Our problem turned out to be that it would not run if the parameters were not set in the VI. Seemed like something was not being passed thru from MAX.  The developer that was working on the project wanted all of it in MAX.  We never found a setup that worked at full sample rate. It would work at lower rates but not at full rate. I'll go back and look maybe we were missing something there as well.

 

I did learn quite a bit about the placement of the start and stop structures depending on the sampling mode selected. So not all was lost.

 

Thanks

Randy

0 Kudos
Message 3 of 5
(2,749 Views)

Hello Randy,

 

I think you may have forgot to attach the VI.  Either way, it sounds like you have made some progress, but I was wondering if you are still experiencing problems.  Please let me know if any additional troubleshooting is need, and also feel free to attach your VI so that I may take a look at it.

 

Regards,

0 Kudos
Message 4 of 5
(2,727 Views)

Oh guess it would help to attach it.  Here is the final version that I used as a troubleshooting aid then demo to explain. I would be curious if there is a better way.  Thanks Randy

 

 

0 Kudos
Message 5 of 5
(2,709 Views)