LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can NI DAQ max driver can be used by Matlab and Labview? If not What is the solution?

Hello Everyone,

 

This might sound silly and stupid thing to do, but I am stuck, so need some help!

 

I have a Matlab written software (http://scanimage.vidriotechnologies.com/pages/viewpage.action?pageId=26509474) it uses NIMAX driver. Some part of the device is not been able to control by the Matalb software. 

So, I thought I can use Labview to run some part and some part by Matlab (which uses NIMAX driver). I thought, Labview based part can take trigger from Matalb running device. But I am getting error that NIMAX been used - Error -50103 .

 

Is it possible to run Labview/Matlab without this error? Or I need to use two PCs?

 

Let me know if you have any suggestion!

 

Thanks,

Anand

 

 

0 Kudos
Message 1 of 7
(3,883 Views)

-50103 is basically you have a resource sharing conflict.  You can't have two tasks running at the same time on the same DAQ device.  This is a common you find people asking about on the forums  (search error 50103), but it is typically because people are trying to run multiple DAQ tasks in the same VI at the same time.  The other less common cause is that someone is running a test in Measurement Automation Explorer and starts the VI without stopping the task in MAX.

 

Your case is a little more unusual in that it sounds like you are running a task in Matlab at the same time in LabVIEW.  But the same thing still applies.  You can only run one task at a time no matter what software is running it.

 

Two PC's wont' help.  You just need to make sure that either LabVIEW or Matlab handles the task passes any data to the other program through other means such as TCP/IP.

Message 2 of 7
(3,865 Views)

Hi,

 

Just to make sure you got everything, let me explain it again

 

My PC has two cards

1- PCIe 6374 runs scanner (AO0-1) and shutters (user1) and PMT inputs (AI1-2)---> Matlab runs these very well (Scaimage)

2- PCI 6321 runs Pockel cell, basically uses AO-1 (0-2 voltage) to control power

 

Somehow these two cards do not work together on ScanImage (Matlab environment, supports NI 6110 and 6321 together but not 6374PCIe with 6321 PCIe). So I thought, I can use labview to create AO for 6374.

 

And that is where I am getting the error.

 

Thanks

0 Kudos
Message 3 of 7
(3,854 Views)

Whether or not Matlab can run DAQmx tasks by itself, I have no idea.  I have never used Matlab.  I believe there probably is a way as DAQmx is a driver that many different software can run.   I have have used Microsoft Excel Visual Basic for Applications to grab data from a DAQmx device.

 

I do know that you cannot run two different tasks on a card at the same time.  Whether that is two in LabVIEW, one in LabVIEW and one in MAX, or one in LabVIEW and one in another outside application.  That sounds like this is what you are trying to do.

 

What is Scanimage?  What is Pockel Cell?

 

Why do you need Matlab in your application at all?  What is it doing that LabVIEW can't do for you?

0 Kudos
Message 4 of 7
(3,851 Views)

Sorry for my ignorance!

 

I do know that you cannot run two different tasks on a card at the same time.  --> I am using two different cards (in same PC)

1- PCIe 6374 runs scanner (AO0-1) and shutters (user1) and PMT inputs (AI1-2)---> Matlab runs these very well (Scaimage, a matlab based code to take image data by controlling PMT input data (a sensor) and galvo scanners and laser shutters)

2- PCI 6321 runs Pockel cell (part of device which controls laser output by changing the input voltage) device, basically uses AO-1 (0-2 voltage) to control laser power

 

So these two cards are different and do different tasks, they both use NIMAX driver. 

 

 

What is Scanimage? --> A matlab based microscope control software to control different devices and to acquire data.

What is Pockel Cell?--> A device to control laser light input for the microscope. User can define the input voltage (0-2V) to set laser power output. It works independently from other device, but one can set an input trigger from the other part of the device like galvo scanners or shutters (laser ON/OFF shutter).

 

Why do you need Matlab in your application at all? ---> Yeah, in principle one could run everything on the Labview but it just Matlab based (Sacnimage already does most of the job) provides very complex task and if I have to do it in Labview it would take lots of time to optimize and synchronization. So, this is the reason I am looking for this patchup.

 

Thanks for your reply! And sorry for not being very clear.

 

Thanks

0 Kudos
Message 5 of 7
(3,829 Views)

Okay.  It wasn't clear from the original posts that only once program was only using one card at a time.  At least verify that you accidentally aren't doing 2 things like Matlab using one card while you have MAX open looking at the same card at the same time.

 

Don't worry about both cards at once yet.

Prove you can get a simple LabVIEW application with the one card.

Then with all of that closed, prove that the Matlab can work with the other card.

Get things working individually.  Only then worry about getting them working together.

0 Kudos
Message 6 of 7
(3,813 Views)

Thanks.

 

Prove you can get a simple LabVIEW application with the one card.-

 

Then with all of that closed, prove that the Matlab can work with the other card.

*******

yes, I have tested labview and Matlab works individually.

 

Thanks

 

 

 

0 Kudos
Message 7 of 7
(3,764 Views)