LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PXIe-6349 Sample Timing

Solved!
Go to solution

I'm trying to use this card for both analog inputs and boolean inputs and outputs. I usually have each output on its own task since they are based off of user commands. I'm not writing waveforms, just a new power output when requested. On this card, I'm getting a resource error when I try to start a second task. I know some cards have a limit of software timers for outputs and such, however I cannot find any User Manual for this particular card to tell me how I can properly do this. Do I have to put all boolean outputs on the same task or is there another way to just say "write once and now" ? I don't have a lot of experience with sample timings so any advice is appreciated. 

 


Error -89137 occurred at DAQmx Start Task.vi:7220002

Possible reason(s):

Specified route cannot be satisfied, because it requires resources that are currently in use by another route.

Property: RefClk.Src
Source Device: MultiIO_1
Source Terminal: None

Required Resources in Use by
Task Name: MultiAI_1
Source Device: MultiIO_1
Source Terminal: PXIe_Clk100
Destination Device: MultiIO_1
Destination Terminal: RefClockInternal

Task Name: HTR-2022-EN

Download All
0 Kudos
Message 1 of 7
(822 Views)

Hi Furbs,

 


@Furbs wrote:

I usually have each output on its own task since they are based off of user commands.

 

Do I have to put all boolean outputs on the same task or is there another way to just say "write once and now" ? 


What's the problem to hold ALL DO channels in just one task, set to "on demand"?

All you need to do is to buffer the DO states in your own routine.

(And maybe you get the advantage to handle all DO channels with just one U8/U16/U32…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(769 Views)
Solution
Accepted by topic author Furbs

Can you explain in detail *exactly* why you are manually configuring a Reference Clock?

 

If not, you probably shouldn't be trying to do it at all.  Just delete that part of the code.  I've done a lot of mid-level DAQ and almost never need to set up a Reference Clock manually.

 

 

-Kevin P

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 3 of 7
(752 Views)

That part, I can't say exactly. The timing code I posted is kind of SOP here for this small shop, so I've followed suit. There was also some talk about which card should be setup as the "main" card for the clock and how some types of input cards are more reliable than others for timing or something. We do commonly get kilohertz data and want to make sure all of it shows the same timestamp for TDMS files. 

0 Kudos
Message 4 of 7
(748 Views)

I've thought of that, trying it out for the analog outputs at least. The discretes didn't need it on a pure discrete card. I'd like some clever way to dynamically assign this kind of thing. I am trying to make it so my users can load a CSV file and reassign whatever input/outputs they want. Especially on some of these cards were it could be either or even every other one, it seemed difficult to invent a system where I parse it out the inputs if they are consecutive. Currently the data being passed to the write command isn't even a task, its just a string that matches the name of the task. So the user can make a valve on the screen, update a CSV file and restart the DAQ. Then they can click on the valve, it'll send a string command to the real-time which will try to write to that task. If the CSV and valve don't match, they will get an error. I love how dynamic it is, but running into a decent amount of challenges with "LabView isn't designed for that". I come from the world of PLCs so timing issues and not "knowing" what your output is currently sending is new to me. 

 

Initially it seemed silly to write to 8 outputs when only one is changing, plus the added work of remembering the others. 

0 Kudos
Message 5 of 7
(745 Views)

Hi Furbs,

 


@Furbs wrote:

Initially it seemed silly to write to 8 outputs when only one is changing, plus the added work of remembering the others. 


  • For 8 DO channels you only need an U8 value, you can change each single bit as needed.
  • The "added work" is mainly a simple shift register...
  • It has advantages to use an intermediate buffer: you can apply several changes to your U8 value and write all of them with a single DAQmxWrite command...

@Furbs wrote:

 I am trying to make it so my users can load a CSV file and reassign whatever input/outputs they want.


I used a LUT for this purpose: define all needed channels using a large Excel spreadsheet.

Then inside my testbench software the channel names were applied to the UI elements, inactive channels became "disabled and grayed-out", and there is a "gatekeeper" part that only allowed to send new values to output channels marked as "active", and so on...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(742 Views)

That second half sounds similar to how I'm setup too. I use the Label Names as the Channel name basically, so you just have to drop a new valve down and no linking is required. Equipment will turn disabled and yellow backgrounds when they aren't found so the user doesn't start the test if there's an obvious issue. 

 

I did manage to get the booleans all on their own tasks after I deleted the clock source and reserve hardware. I was told that was to put in place so all the cards will work off of a single trigger and clock and that some cards are more reliable that others when it comes to being the trigger. Basically, we wait for x samples on the main card (usually representative of half a second of data), then run an event to read all cards again. Trying to make sure that the TDMS file has all the cards start reading at the same time. I'm open to suggestions on how to do this better or what is "normal" to get kHz data in sync. 

0 Kudos
Message 7 of 7
(730 Views)