LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx multiple reads of force sensor in same case structure

Hi, i am currently trying to retrieve data from 4 force cells from a DAQmx. I have the code set up, and when i run the first case all works right, but when I go to the next, and sometimes on startup it tosses an error. "DAQmx Start Task.vi:7220007<append> <B>Task Name: </B>_unnamedTask<DC>" and -50103 is the code. what settings will i kneed to change in order to get the reading to work? attached is a simplified version of what i am trying to do. The vi is written in 2017, I can convert if requested.

0 Kudos
Message 1 of 7
(2,437 Views)

I can't open your code (I'm on 2016) but have you tried Googling the error code? Don't use the "-" in front of it.

 

I came across someone else with a similar issue trying to do multiple readsa:

 

https://forums.ni.com/t5/LabVIEW/Error-50103-occurred-at-DAQmx-Start-Task-vi-2/td-p/853314

 

Error -50103 means a resource is reserved, so I'd guess you're trying to start multiple acquisitions instead of doing one acquisition with 4 channels. Look in the NI Example Finder (Help->Find Examples) and look for multiple channel analog input example programs and see if that helps. You can also reupload your VI as 2016 and I can take a look, but I'd just Google the error code and check the examples first.

 

Also, it's easier for people to see  your code if you upload a VI Snippet rather than a whole VI. That way uploads a picture along with the source code, so anyone can at least see it even if they don't have your software version.

0 Kudos
Message 2 of 7
(2,426 Views)

I have looked at that forum, but I am using a 9237 card not a counter. If I do the multiple acquisition setup but only pull from 1 data input set, will it effect the data that I do want with data I don't? converted to

0 Kudos
Message 3 of 7
(2,414 Views)

All 4 of your DAQ Assistants look identical to me reading a channel called "Force".

 

What are you really trying to do?  When you run one DAQ Assistant and it is for Continuous Samples, then go and start another one, whether it is for the same channel, or a different channel on the same device, you are going to get the -50103 error because your first task is already running using the timing clock.

 

You mention 4 different load cells.  So just create 1 DAQ Assistant that reads the 4 load cells at the same time.  You can add 4 channels to a single acquisition.

0 Kudos
Message 4 of 7
(2,409 Views)

I took a look at  your VI. I would heartily recommend against using the DAQ assistant and timed loops, and certainly not running it at 1 kHz. The way you have it right now you're trying to read continuous samples from each DAQ assistant. Switching between the two will cause weirdness when one may or may not stop correctly; I don't know how the DAQ assistant handles continuous tasks (I've never actually used it). It's going to be much better going forward to just learn the actual DAQmx functions directly.

 

You want to set your sample timing rate with your DAQmx function calls, not an external loop. And you can also just read all 4 channels and throw away the rest of the data you don't want.

0 Kudos
Message 5 of 7
(2,407 Views)

what i did was pull in a DAQmx assistant and told it force and set the channel to read, then i went and did the same procedure 3 more times for each channel.Ii will try and read with 1 DAQmx assistant, but the case structure is practicality set due to the setup of the program. i have a main program with a selector and a case structure, all in a timed loop. from there i have a separate vi in each case that will run when called. the cases have different algorithms in each for the different data collections and for there analysis witch works with fake data. 

0 Kudos
Message 6 of 7
(2,400 Views)

Right now you have 4 DAQ Assistants and they all read a signal called "Force", but drilling deeper, I see they are set for different analog input channels.

 

You cannot do that.

 

Put one DAQ Assistant in the Loop.  Set it to read all 4 channels, and give each one a meaningful name besides "Force".  Split the signal into 4.  Then feed those into your case structure and use the appropriate wire along with whatever subVI you want.

 

One thing confusing is that you are trying to select among different inputs and feed them into a waveform chart.  A Waveform chart has history.  So when you change your control, you'll start showing channel 3 data, for example, right after you showed channel 1 data.  It will look very strange on the front panel until the older data scrolls out of history.

0 Kudos
Message 7 of 7
(2,393 Views)