LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Instr. and DAQ Assistants - Time to take off the training wheels?

Hi everyone,

I have written a control system program using a producer/consumer with state machine architecture - textbook LabVIEW beginner intermediate.

In the producer, I have 6 different DAQ assistants taking AI and DI data from PXI mounted data acquisiton cards and two Instr. Assistants taking data from PXI serial ports.  In the consumer, I have a similar situation.  There are 7 DAQ assistants sending digital and analog requests to 3 different PXI chassis and one Instr. asssistant sending requests to a PXI serial port. 

Is this frowned upon?  Would any of you pros call this a finished job if it is still bound with Assistants?  I have looked at the code involved in making these assistants into LabVIEW code (writing them out, so to speak), but it is complex and I haven't been able to put in the time to learn all of the different DAQmx and VISA functions and subVI's. 

However, I have some difficulties that arise when, for instance, a component that is monitored/written to by a serial port is turned to manual control and the assistant times out.  It times out the entire control system, which is not desirable.  Is the fix in error handling, or getting rid of the assistants altogether?

Any responses are appreciated - even if you are the bearer of bad news!

Brad
0 Kudos
Message 1 of 6
(4,117 Views)

As long as

  • The overheads are not an issue and they not affecting your vi's performance
  • Your program is giving desired response with the expected time

You may continue to retain the Assistant functions in your VI.

but on the long run, it would be a good practice to switch on to DAQmx and VISA functions. This way you will get a leaner and more efficient vi


 have some difficulties that arise when, for instance, a component that is monitored/written to by a serial port is turned to manual control and the assistant times out.  It times out the entire control system, which is not desirable.  Is the fix in error handling, or getting rid of the assistants altogether?


We could comment on this better if we could take a look at your vi.

would it be possible for you to post your vi??

0 Kudos
Message 2 of 6
(4,106 Views)
Hi Brad,

Using DAQ assistants in a loop does come with some overhead. However if you are acquiring at relatively low speeds and do not want to use the DAQmx VIs, it shouldn't be a problem. Though programming using DAQmx VIs might look somewhat intimidating it follows a general priciple common to most I/O in LabVIEW. You open/create a channel, configure it, read or write and then close it. Generally, only the read or write VIs will be in the loop. So doing the creation and configuration every iteration of the loop is the overhead.

I am not entirely sure what is timing out and what you are doing to cause a time out. There are two ways to generally fix time out errors. One, as you pointed out, is to handle the error. You can do this by unbundling the cluster to look at the error code, if it is a time out error, you can reset the error cluster.

The other solution is to increase the timeout for the DAQ assistant. (Wire the time (in seconds) you want it to wait, to the timeout input of the DAQ Assistant).

Cheers
Malay Duggar
NI
0 Kudos
Message 3 of 6
(4,082 Views)
Thanks for the tips.  I will gradually try to take off the training wheels if only to learn more about programming. 

One more question:  Is it OK to use DAQmx and VISA in the same VI?  I realize that it is not good to use DAQ traditional and DAQmx in the same VI, but I have not seen many posts asking about VISA and DAQ. 


0 Kudos
Message 4 of 6
(4,057 Views)
Brad,

DAQmx and VISA are not the same area. It is a bit like comparing sound- and videodrivers.....
So you will not have any interferance between the two drivers (infact, VISA is a layer between your ADE = Application Developement Environment and the actual hardwaredriver) unless you don't insert it yourself.
How could you do that?
Simply by making timing-dependencies......

hope this helps,
Norbert B.
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 6
(4,053 Views)
Hey CFAMS Brad,

You can use Traditional DAQ and DAQmx in the same VI but not on the same device. Ie. You cannot use two drivers to access the same device. So if you had two boards in your computer, you could control one with Traditional DAQ and one with DAQmx from the same program. VISA is generally used for communicating with instruments. So if you wanted to use VISA to communicate with the serial port and use DAQmx to acquire data from your DAQ board, it will not be a problem.

Cheers
Malay Duggar
NI
0 Kudos
Message 6 of 6
(4,030 Views)